POST
POST /agents — OpenAI API
OpenAI API key (required); https://api.openai.com/v1
OpenAI APICreate an agent
- Base URL
- https://api.openai.com/v1
- Auth
- Authorization: Bearer <OPENAI_API_KEY>
- Last verified
- 2026-10-20 · upstream hash matched
Actions Try in browser→
Agents: curl -H "Accept: text/markdown" this URL
→ 394 tokens · Vary: Accept
→ 394 tokens · Vary: Accept
Critical gotchas
The Responses API is the primary interface for new text and tool workflows; Chat Completions remains a separate compatibility API.
Audio transcription uploads use multipart form data rather than a JSON request body.
cURL
curl -X POST 'https://api.openai.com/v1/agents' \ -H "Authorization: Bearer $OPENAI_API_KEY" \ -H 'Content-Type: application/json' \ -d '{ "model": "example-model"}'
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| metadata | body | object | No | Up to 16 string key-value pairs, with keys up to 64 and values up to 512 characters. Omission or null defaults to an empty map. |
| name | body | string | No | A human-readable name for the agent. Omission or null leaves the agent unnamed. |
| model | body | string | Yes | The model to use for the agent. The requested model name is preserved. |
| reasoning | body | object | No | Configuration for model reasoning. Omission uses the model's default effort. |
| text | body | object | No | Configuration for generated text. Defaults to the `text` format and medium verbosity. |
| service_tier | body | string | No | The service tier used for model requests. Defaults to `auto`. |
| instructions | body | string | No | Additional instructions appended to the agent's default base instructions. Omit or set to null to add no custom instructions. |
| tools | body | object[] | No | Tools available to the agent. Defaults to an empty list. The tool list must fit within 3 MiB (3,145,728 bytes) of compact UTF-8 JSON. |
| multi_agent | body | object | No | Configuration for creating and coordinating subagents. Subagent tools are disabled by default. |
Response 200 OK
{
"id": "string",
"object": "agent",
"created_at": 0,
"updated_at": 0,
"name": "string",
"metadata": {},
"model": "string",
"reasoning": {
"effort": "none",
"summary": "concise"
},
"text": {
"format": {
"type": "text"
},
"verbosity": "low"
},
"service_tier": "auto",
"instructions": "string",
"tools": [
{
"type": "function",
"name": "string",
"description": "string",
"parameters": {},
"defer_loading": true
}
],
"multi_agent": {
"enabled": true,
"max_concurrent_subagents": 0
}
} Get a free OpenAI API key → sponsored Affiliate link - we may earn a commission, at no extra cost to you.