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

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

**Prerequisites**

- [MCP toolbox URL and key](docId\:JqY6i5aCFIm-kOm9ERv7A)&#x20;

To connect to your MCP toolbox through the OpenAI API:

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

```json
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 TOOLBOX URL>/t/<TOOLBOX KEY>/<TRANSPORT METHOD>",
      }
    ]
  }'
```
:::

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

- `MCP TOOLBOX URL`: The URL generated when you created the MCP toolbox.&#x20;
- `TOOLBOX KEY`: The key generated when creating an MCP toolbox.&#x20;
- `TRANSPORT METHOD`: The path of your preferred transport method. Stateless Streamable HTTP (`/stateless`) is recommended due to its connection reliability.&#x20;

:::hint{type="info"}
If you experience connection issues, add `/stream` instead of `/stateless` to the end of the URL.&#x20;
:::

Example configuration:

```json
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/•••••••••••••/stateless",
      }
    ]
  }'
```
::::
:::::

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.
:::

