Connect to OpenAI API
1 min
In this guide, learn how to connect your MCP toolbox through the OpenAI API.
Prerequisites
To connect to your MCP toolbox through the OpenAI API:
Use the following configuration for your API call:
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>",
}
]
}'In server_url, replace the placeholders with your actual values:
- MCP TOOLBOX URL: The URL generated when you created the MCP toolbox.
- TOOLBOX KEY: The key generated when creating an MCP toolbox.
- TRANSPORT METHOD: The path of your preferred transport method. Stateless Streamable HTTP (/stateless) is recommended due to its connection reliability.
If you experience connection issues, add /stream instead of /stateless to the end of the URL.
Example configuration:
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.
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.