---
title: Connect to OpenAI API
slug: connect-to-openai-api
createdAt: 2026-02-03T14:53:46.921Z
---

In this guide, learn how to connect your MCP toolbox through the OpenAI API.

**Prerequisites**

- [MCP toolboxes](docId\:JqY6i5aCFIm-kOm9ERv7A)

To connect to your MCP toolbox through the OpenAI API:

::::WorkflowBlock
:::WorkflowBlockItem
Use the following configuration for your API call:

```bash
curl https://api.openai.com/v1/responses \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $OPENAI_API_KEY" \
  -d '{
    "model": "gpt-4.1",
    "input": "List all available tools.",
    "tools": [
      {
        "type": "mcp",
        "server_label": "make",
        "server_url": "<MCP SERVER URL>/t/<API KEY>"
      }
    ]
  }'
```
:::

:::WorkflowBlockItem
In `server_url`, replace the placeholders with your actual values:

- `<MCP SERVER URL>`: The URL generated when you created the MCP toolbox.
- `<API KEY>`: The API key generated for the MCP toolbox.

Example configuration:

```bash
curl https://api.openai.com/v1/responses \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $OPENAI_API_KEY" \
  -d '{
    "model": "gpt-4.1",
    "input": "List all available tools.",
    "tools": [
      {
        "type": "mcp",
        "server_label": "make",
        "server_url": "https://eu2.make.com/mcp/server/•••••••••••••/t/•••••••••••••"
      }
    ]
  }'
```
:::
::::

You've now connected your MCP toolbox through the OpenAI API.

:::hint{type="info"}
**MCP toolbox timeout:** Your MCP toolbox scenarios must finish running within 40 seconds. If a scenario runs longer, the connection times out and no outputs are returned to the client.
:::

