POST /v1/responses
OpenAI Responses-kompatibler Endpunkt für Text, Tools, gehostete Websuche und Codex CLI.
POST /v1/responses
Anfrage
curl https://api.model-gate.com/v1/responses \
-H "Authorization: Bearer mg_live_..." \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-5.4",
"input": [
{
"role": "user",
"content": [{"type": "input_text", "text": "Summarize the release."}]
}
],
"stream": false
}'
Antwort
{
"id": "resp_example",
"object": "response",
"status": "completed",
"model": "gpt-5.4",
"output": [
{
"type": "message",
"role": "assistant",
"content": [{"type": "output_text", "text": "The release adds synchronized documentation and model aliases."}]
}
],
"usage": {
"input_tokens": 18,
"output_tokens": 14,
"total_tokens": 32
}
}
Gehostete Websuche
Hinzufügen:
{
"tools": [{"type": "web_search"}],
"tool_choice": "required",
"include": ["web_search_call.action.sources"]
}
Es gibt keine separate Unterstützung /v1/web-search Vertrag. Verwenden Sie das Responses-API-Tool.
Asynchron
"async": true wird nur mit unterstützt "stream": false.