Skip to content
中文

POST /v1/responses

Method: POSTEndpoint: /v1/responses

https://platform.openai.com/docs/api-reference/responses/create

Some OpenAI models support only the Responses format, such as o3-pro and codex-mini-latest.

Request Parameters

Header Parameters

text
Authorization
string
Optional
Default Value:
Bearer {{YOUR_API_KEY}}

Body Parameters application/json

text
model
string
Required
input
array
[object]
Required
role
string
Optional
content
string
Optional
Example
{
"model"
:
"gpt-4.1"
,
"input"
:
[
{
"role"
:
"user"
,
"content"
:
"Write a one-sentence bedtime story about a unicorn."
}
]
}

Example Request

Shell

bash
curl --location --request POST '/v1/responses' \
--header 'Authorization: Bearer {{YOUR_API_KEY}}' \
--header 'Content-Type: application/json' \
--data-raw '{
    "model": "gpt-4.1",
    "input": [
        {
            "role": "user",
            "content": "Write a one-sentence bedtime story about a unicorn."
        }
    ]
  }'

Response

🟢 200 Success

Content Type: application/json

Response Schema

text
object

Example

json
{
    "id": "resp_67ccd2bed1ec8190b14f964abc0542670bb6a6b452d3795b",
    "object": "response",
    "created_at": 1741476542,
    "status": "completed",
    "error": null,
    "incomplete_details": null,
    "instructions": null,
    "max_output_tokens": null,
    "model": "gpt-4.1-2025-04-14",
    "output": [
        {
            "type": "message",
            "id": "msg_67ccd2bf17f0819081ff3bb2cf6508e60bb6a6b452d3795b",
            "status": "completed",
            "role": "assistant",
            "content": [
                {
                    "type": "output_text",
                    "text": "In a peaceful grove beneath a silver moon, a unicorn named Lumina discovered a hidden pool that reflected the stars. As she dipped her horn into the water, the pool began to shimmer, revealing a pathway to a magical realm of endless night skies. Filled with wonder, Lumina whispered a wish for all who dream to find their own hidden magic, and as she glanced back, her hoofprints sparkled like stardust.",
                    "annotations": []
                }
            ]
        }
    ],
    "parallel_tool_calls": true,
    "previous_response_id": null,
    "reasoning": {
        "effort": null,
        "summary": null
    },
    "store": true,
    "temperature": 1,
    "text": {
        "format": {
            "type": "text"
        }
    },
    "tool_choice": "auto",
    "tools": [],
    "top_p": 1,
    "truncation": "disabled",
    "usage": {
        "input_tokens": 36,
        "input_tokens_details": {
            "cached_tokens": 0
        },
        "output_tokens": 87,
        "output_tokens_details": {
            "reasoning_tokens": 0
        },
        "total_tokens": 123
    },
    "user": null,
    "metadata": {}
}