curl --request POST \ --url https://api.zerogpu.ai/v1/responses \ --header 'Content-Type: application/json' \ --header 'x-api-key: <api-key>' \ --data '{ "model": "llama-3.1-8b-instruct-fast", "input": "NASA announced that its Artemis III mission is now scheduled for late 2026, marking the first time astronauts will land on the lunar surface since Apollo 17 in 1972. The mission will send a crew of four to the Moon aboard the Orion spacecraft, with two astronauts descending to the south pole using SpaceX Starship as a lunar lander. Scientists are particularly excited about exploring permanently shadowed craters that may contain water ice, which could be critical for sustaining long-term human presence on the Moon."}'
{ "id": "resp_abc123", "object": "response", "created": 1710000000, "model": "llama-3.1-8b-instruct-fast", "output": [ { "type": "message", "role": "assistant", "content": [ { "type": "output_text", "text": "Artemis III, slated for late 2026, will return astronauts to the Moon for the first time since 1972, landing two crew at the south pole to study shadowed craters that may hold water ice." } ] } ], "usage": { "input_tokens": 112, "output_tokens": 44, "total_tokens": 156 }}
API Reference
Responses
Send input to an AI model and receive a response.
POST
/
responses
curl --request POST \ --url https://api.zerogpu.ai/v1/responses \ --header 'Content-Type: application/json' \ --header 'x-api-key: <api-key>' \ --data '{ "model": "llama-3.1-8b-instruct-fast", "input": "NASA announced that its Artemis III mission is now scheduled for late 2026, marking the first time astronauts will land on the lunar surface since Apollo 17 in 1972. The mission will send a crew of four to the Moon aboard the Orion spacecraft, with two astronauts descending to the south pole using SpaceX Starship as a lunar lander. Scientists are particularly excited about exploring permanently shadowed craters that may contain water ice, which could be critical for sustaining long-term human presence on the Moon."}'
{ "id": "resp_abc123", "object": "response", "created": 1710000000, "model": "llama-3.1-8b-instruct-fast", "output": [ { "type": "message", "role": "assistant", "content": [ { "type": "output_text", "text": "Artemis III, slated for late 2026, will return astronauts to the Moon for the first time since 1972, landing two crew at the south pole to study shadowed craters that may hold water ice." } ] } ], "usage": { "input_tokens": 112, "output_tokens": 44, "total_tokens": 156 }}
One endpoint for every model. Pass text or a document as input; what comes back depends on the model: generated text, a classification, extracted fields, redacted output, and more. The input and output shapes vary by model, so open a model page for a prefilled playground. For the messages-style route, see Chat completions.Install the official SDK from npm or PyPI (pip install zerogpu-api). Source: zerogpu/SDK. Handle errors the same way as API error codes.
Authentication
Send your API key in the x-api-key header or, OpenAI-compatible, as Authorization: Bearer <key>. The x-project-id header is optional; send it only to scope a request to a specific project. See the Quickstart for both forms in each language.
Streaming
Set "stream": true to receive the response as server-sent events (text/event-stream) instead of one JSON body. Pass -N so curl prints each event as it arrives:
cURL
curl -N https://api.zerogpu.ai/v1/responses \ -H "content-type: application/json" \ -H "x-api-key: $ZEROGPU_API_KEY" \ -d '{ "model": "gpt-4.1-mini", "input": "Write one sentence about the sea.", "stream": true }'
Each event is a data: line holding a JSON object with a type and a sequence_number:
The response is complete. response holds the full output and usage.
Reasoning models also send response.reasoning_text.delta or response.reasoning_summary_text.delta events before the answer. Most models end the stream with data: [DONE]; treat response.completed as the end of the response and ignore [DONE]. Task models (classifiers and extractors) don’t stream and return 400 with code stream_not_supported. Each model page says whether the model supports streaming.
Tool calling
Pass function definitions in tools. Each tool has a type of function, a name, a description, and its arguments as a JSON Schema in parameters:
cURL
curl https://api.zerogpu.ai/v1/responses \ -H "content-type: application/json" \ -H "x-api-key: $ZEROGPU_API_KEY" \ -d '{ "model": "gpt-4.1-mini", "input": "What is the weather in Paris right now?", "tools": [ { "type": "function", "name": "get_weather", "description": "Get the current weather for a city.", "parameters": { "type": "object", "properties": { "city": { "type": "string", "description": "City name" } }, "required": ["city"] } } ] }'
When the model calls a tool, output contains a function_call item. arguments is a JSON-encoded string, so parse it before use:
Some models return an empty message item before the function_call, so find the call by its type rather than by position. Run the function yourself, then send the result back. Pass input as an array with the original message, the function_call item, and a function_call_output item with the same call_id, and include tools again:
The model answers with a message that uses the result, for example “The current weather in Paris is 18°C with light rain.” With "stream": true, a tool call arrives as response.function_call_arguments.delta events followed by response.function_call_arguments.done. Models without tool support return 400 with code tools_not_supported; each model page says whether the model supports tool calling.
Authorizations
ApiKeyBearerAuth
x-api-key
string
header
required
Your ZeroGPU API key. Create one in the dashboard under API keys. Send it on every request.
Headers
x-project-id
string
Optional project identifier. Scopes the request to a specific project when provided.
Body
application/json
model
enum<string>
required
Model identifier. Open a model page for a dedicated playground with the correct body for that model.
Available options:
llama-3.1-8b-instruct-fast,
llama-3.2-3b-instruct-fast,
qwen3-30b-a3b-fp8,
llama-guard-4-12b,
LFM2.5-1.2B-Instruct,
LFM2.5-1.2B-Thinking,
gpt-oss-120b,
qwen3.6-35b-a3b,
deepseek-v4.1-flash,
glm-5.3-flash,
gpt-5.4-nano,
gpt-5.6-luna,
gpt-6-luna,
gpt-4.1-mini,
deberta-v3-small,
gliner2.5-base-v1,
gliner2.5-multi-v1,
gliner2.5-decide-v1,
zlm-v1-iab-classify-edge,
zlm-v1-signal-extract,
zlm-v2-iab-classify-edge-enriched,
zlm-v1-iab-domain-classifier,
zlm-v1-tool-decisions,
unlimited-ocr
Example:
"llama-3.1-8b-instruct-fast"
input
string<textarea>(Message · object | Function call · object | Function call output · object)[]
required
The text or document to send, as a plain string. To return a tool result, send an array of input items instead: the conversation so far, the model's function_call item, and a function_call_output item with the same call_id.
Required string length: 1 - 131072
stream
boolean
default:false
If true, the response is sent as server-sent events (text/event-stream) instead of one JSON body. See Streaming for the events. Supported on text-generation models; task models (classifiers, extractors) return 400 with code stream_not_supported.
tools
object[]
Function tools the model may call. When it calls one, output contains a function_call item; see Tool calling. Models without tool support return 400 with code tools_not_supported.
Hide child attributes
tools.type
enum<string>
required
Always function.
Available options:
function
tools.name
string
required
Function name the model uses to call it.
Example:
"get_weather"
tools.parameters
object
required
JSON Schema for the function's arguments.
tools.description
string
What the function does. The model uses this to decide when to call it.
Example:
"Get the current weather for a city."
text
object
Response format configuration.
Hide child attributes
text.format
object
Hide child attributes
text.format.type
string
Output format for the response, for example text.
Example:
"text"
instructions
string
Optional system-style instructions applied on top of input, for models that support them.
metadata
object
Optional model-specific parameters, passed through to the model. For example, the GLiNER2.5 models accept usecase together with labels or schema. See the relevant model page for supported keys.
Response
Success. A JSON response object, or a stream of server-sent events when stream is true.
The generated model response.
id
string
Unique identifier for the response.
Example:
"resp_abc123"
object
string
Object type. Always response.
Example:
"response"
created
integer
Unix timestamp (seconds) when the response was created.
Example:
1710000000
model
string
The model used for inference.
Example:
"llama-3.1-8b-instruct-fast"
output
(object | Function call · object)[]
Output items produced by the model: message items, and a function_call item for each tool the model calls. Reasoning models may also return a reasoning item. Read items by type, not by position.
A single output item from the model.
Option 1
Function call
Hide child attributes
output.type
string
Output item type.
Example:
"message"
output.role
string
Author of the output. Always assistant.
Example:
"assistant"
output.content
object[]
Content parts that make up the message.
Hide child attributes
output.content.type
string
Content part type.
Example:
"output_text"
output.content.text
string
The generated text.
Example:
"Artemis III, slated for late 2026, will return astronauts to the Moon for the first time since 1972."
usage
object
Token usage statistics for the request.
Hide child attributes
usage.input_tokens
integer
Number of tokens in the input.
Example:
112
usage.output_tokens
integer
Number of tokens generated.
Example:
44
usage.total_tokens
integer
Total tokens consumed (input plus output).
Example:
156
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"ZeroGPU","description":"ZeroGPU is the compute efficiency layer for AI inference. It runs repeatable, high-volume tasks - classification, extraction, PII redaction, moderation, summarization, routing - on specialized small and nano language models across an edge-powered network, faster and cheaper than centralized GPUs, through one OpenAI-compatible API. Edge Providers connect Android, Chrome, Telegram, desktop and server devices to the network and earn from the inference they serve.","colors":{"primary":"#15803D","light":"#4ADE80","dark":"#16A34A"},"logo":{"light":"https://mintcdn.com/zerogpu/Gm1fjnUZg6Fa99hP/assets/zerogpu-docs-logo-light.png?fit=max\u0026auto=format\u0026n=Gm1fjnUZg6Fa99hP\u0026q=85\u0026s=78a4ce11cf0b3f707ad7bc829b979475","dark":"https://mintcdn.com/zerogpu/Gm1fjnUZg6Fa99hP/assets/zerogpu-docs-logo-dark.png?fit=max\u0026auto=format\u0026n=Gm1fjnUZg6Fa99hP\u0026q=85\u0026s=a6a992f683e8774df0ea4da0324d659d"},"favicon":"https://mintcdn.com/zerogpu/Gm1fjnUZg6Fa99hP/assets/favicon.ico?fit=max\u0026auto=format\u0026n=Gm1fjnUZg6Fa99hP\u0026q=85\u0026s=492a04e82780c7c9df438a85e80701f1","api":{"params":{"expanded":"all"},"playground":{"display":"interactive","proxy":false},"examples":{"defaults":"required","languages":["curl","python","javascript","rust","go","ruby"],"prefill":true,"autogenerate":true},"mdx":{"server":"https://api.zerogpu.ai/v1"}},"appearance":{"default":"light","strict":false},"background":{"color":{"light":"#F1F4F2"}},"navbar":{"links":[{"icon":"globe","href":"https://zerogpu.ai","label":""},{"icon":"github","href":"https://github.com/zerogpu","label":""},{"icon":"discord","href":"https://discord.gg/58XZuxKyq6","label":""},{"icon":"x-twitter","href":"https://x.com/ZeroGPU_AI","label":""}],"primary":{"type":"button","label":"Platform","href":"https://platform.zerogpu.ai/"}},"footer":{"socials":{"website":"https://zerogpu.ai","github":"https://github.com/zerogpu"}},"fonts":{"heading":{"family":"Geist","weight":500},"body":{"family":"Geist"}},"contextual":{"options":["copy","view","chatgpt","claude"],"display":"header"},"styling":{"latex":true},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"zerogpu","hasAudioNarration":false,"actualSubdomain":"zerogpu","customDomains":["docs.zerogpu.ai"],"gitSource":{"type":"github","owner":"zerogpu","repo":"docs","deployBranch":"main","contentDirectory":"","isPrivate":false,"mountPath":"","label":""},"entitlements":{"AI_CHAT":{"status":"ENABLED"}},"buildId":"6aff16f437c19af492cdc73e","clientVersion":"0.0.4205","searchFilterCounts":[{"language":"default","tag":"Developers","count":104},{"language":"default","tag":"Documentation","count":73},{"language":"default","tag":"API Reference","count":55},{"language":"default","tag":"By model","count":32},{"language":"default","tag":"Integrations","count":31},{"language":"default","tag":"Edge Providers","count":18},{"language":"default","tag":"Cookbook","count":14},{"language":"default","tag":"Integrations \u0026 plugins","count":10},{"language":"default","tag":"Batch API","count":9},{"language":"default","tag":"Models","count":8}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"","hasChatPermissions":true,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-rbac-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"starter-pricing","enabled":true,"variant":{"name":"treatment","enabled":true,"payload":{"type":"string","value":"treatment"},"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"wildcard-email-auth","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":true},"customCss":[{"filePath":"style.css","content":".nav-dropdown-products-selector-trigger{height:2.5rem!important;padding:0.5rem 0.875rem!important;gap:0.625rem!important;font-size:1rem!important;font-weight:600!important;color:#ffffff!important;background-color:rgb(34 197 94 / 0.12)!important;border:1px solid rgb(34 197 94 / 0.5)!important;border-radius:0.75rem!important}.nav-dropdown-products-selector-trigger:hover,.nav-dropdown-products-selector-trigger[aria-expanded=\"true\"]{background-color:rgb(34 197 94 / 0.22)!important;border-color:#22c55e!important}.nav-dropdown-products-selector-trigger>svg:first-child{width:1.125rem!important;height:1.125rem!important;background-color:#4ade80!important}.nav-dropdown-products-selector-trigger>svg:last-child{width:0.875rem!important;height:0.875rem!important;color:#4ade80!important}#zg-audience-switch{display:inline-flex;align-self:center;flex-shrink:0;padding:0.1875rem;gap:0.1875rem;border:1px solid rgb(34 197 94 / 0.45);border-radius:9999px;background-color:rgb(34 197 94 / 0.08)}#zg-audience-switch button{padding:0.25rem 0.95rem;border-radius:9999px;font-size:0.875rem;font-weight:600;line-height:1.25rem;color:#a3ada8;background:transparent;cursor:pointer}#zg-audience-switch button:hover{color:#ffffff}#zg-audience-switch button.is-active{color:#06120b;background-color:#22c55e}html[data-zg-audience=\"agent\"] #content-area>:not(#zg-agent-view){display:none!important}html[data-zg-audience=\"agent\"] #table-of-contents-layout,html[data-zg-audience=\"agent\"] #content-side-layout{display:none!important}#zg-agent-view{margin:0.5rem 0 3.5rem;font-family:ui-monospace, SFMono-Regular, Menlo, monospace;font-size:0.8125rem;line-height:1.65;color:#e7eeeb}#zg-agent-view pre{margin:0;white-space:pre-wrap;word-break:break-word;font:inherit;color:inherit;background:none;border:0;padding:0}.zg-agent-bar{display:flex;flex-wrap:wrap;align-items:center;gap:0.5rem 0.875rem;padding:0.625rem 0.875rem;border:1px solid rgb(34 197 94 / 0.45);border-radius:0.625rem;background-color:rgb(34 197 94 / 0.07)}.zg-agent-badge{font-weight:700;letter-spacing:0.08em;color:#22c55e}.zg-agent-source{color:#e7eeeb}.zg-agent-actions{display:flex;flex-wrap:wrap;align-items:center;gap:0.375rem 0.875rem;margin-left:auto}.zg-agent-btn{padding:0.2rem 0.625rem;font:inherit;font-weight:600;color:#06120b;background-color:#22c55e;border-radius:0.375rem;cursor:pointer}.zg-agent-btn:hover{background-color:#4ade80}.zg-agent-actions a{color:#4ade80;text-decoration:none}.zg-agent-actions a:hover{text-decoration:underline}#zg-agent-view .zg-agent-facts{margin-top:1rem;padding:0.75rem 0.875rem;color:#a3ada8;border-left:2px solid #22c55e;background-color:rgb(255 255 255 / 0.02)}.zg-agent-prompt{margin-top:0.75rem;padding:0.5rem 0.875rem;border:1px dashed rgb(255 255 255 / 0.15);border-radius:0.5rem}.zg-agent-prompt summary{cursor:pointer;color:#4ade80}#zg-agent-view .zg-agent-prompt pre{margin-top:0.625rem}#zg-agent-view .zg-agent-markdown{margin-top:1.5rem;padding-top:1.25rem;border-top:1px solid rgb(255 255 255 / 0.1)}#zg-audience-switch{margin:0 1.5rem 0 0.75rem}html[data-zg-audience=\"agent\"]{--background-dark: 4 15 9}html[data-zg-audience=\"agent\"] #sidebar,html[data-zg-audience=\"agent\"] .nav-tabs,html[data-zg-audience=\"agent\"] #zg-audience-switch{font-family:ui-monospace, SFMono-Regular, Menlo, monospace}html[data-zg-audience=\"agent\"] #sidebar{font-size:0.8125rem}html[data-zg-audience=\"agent\"] .sidebar-title{color:#22c55e;text-transform:lowercase}html[data-zg-audience=\"agent\"] .sidebar-title::before{content:\"## \";color:rgb(34 197 94 / 0.6)}html[data-zg-audience=\"agent\"] #sidebar li a{color:#a3d9b6}html[data-zg-audience=\"agent\"] #sidebar li a:hover{color:#ffffff}html[data-zg-audience=\"agent\"] #navbar-transition{border-bottom-color:rgb(34 197 94 / 0.25)!important}html[data-zg-audience=\"agent\"] .nav-tabs-item{color:#a3d9b6}#page-title,#content h1,#content h2,#content h3,#content h4{font-weight:500!important}#header .text-lg.prose{font-size:1rem!important;line-height:1.625rem!important}#navigation-items>div+div{margin-top:1.25rem!important;padding-top:1.25rem;border-top:1px solid rgb(255 255 255 / 0.08)}html[data-zg-audience=\"agent\"] #navigation-items>div+div{border-top-color:rgb(34 197 94 / 0.2)}html:not(.dark) .nav-dropdown-products-selector-trigger{color:#166534!important}html:not(.dark) .nav-dropdown-products-selector-trigger>svg:first-child{background-color:#15803d!important}html:not(.dark) .nav-dropdown-products-selector-trigger>svg:last-child{color:#15803d!important}html:not(.dark) #zg-audience-switch button{color:#52605a}html:not(.dark) #zg-audience-switch button:hover{color:#0f1a14}html:not(.dark) #zg-audience-switch button.is-active{color:#06120b}html:not(.dark) #zg-agent-view,html:not(.dark) .zg-agent-source{color:#1f2a24}html:not(.dark) .zg-agent-badge,html:not(.dark) .zg-agent-actions a,html:not(.dark) .zg-agent-prompt summary{color:#15803d}html:not(.dark) #zg-agent-view .zg-agent-facts{color:#52605a;background-color:rgb(0 0 0 / 0.03)}html:not(.dark) .zg-agent-prompt{border-color:rgb(0 0 0 / 0.15)}html:not(.dark) #zg-agent-view .zg-agent-markdown{border-top-color:rgb(0 0 0 / 0.1)}html:not(.dark) #navigation-items>div+div{border-top-color:rgb(0 0 0 / 0.08)}html:not(.dark)[data-zg-audience=\"agent\"] .sidebar-title{color:#15803d}html:not(.dark)[data-zg-audience=\"agent\"] .sidebar-title::before{color:rgb(21 128 61 / 0.6)}html:not(.dark)[data-zg-audience=\"agent\"] #sidebar li a,html:not(.dark)[data-zg-audience=\"agent\"] .nav-tabs-item{color:#166534}html:not(.dark)[data-zg-audience=\"agent\"] #sidebar li a:hover{color:#052e16}"}],"page":{"pagePath":"api-reference/responses","slug":"/api-reference/responses","pageMetadata":{"title":"Responses","description":"Send input to an AI model and receive a response.","openapi":"api-reference/openapi/zerogpu.openapi.json POST /responses","href":"/api-reference/responses"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Send input to an AI model and receive a response.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,p:`p`,pre:`pre`,span:`span`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,..._provideComponents(),...props.components},{CodeBlock,Heading,Table}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Table)_missingMdxReference(`Table`,true);return _jsxs(_Fragment,{children:[_jsxs(_components.p,{children:[`One endpoint for every model. Pass text or a document as `,_jsx(_components.code,{children:`input`}),`; what comes back depends on the model: generated text, a classification, extracted fields, redacted output, and more. The `,_jsx(_components.code,{children:`input`}),` and `,_jsx(_components.code,{children:`output`}),` shapes vary by model, so open a `,_jsx(_components.a,{href:`/api-reference/models`,children:`model page`}),` for a prefilled playground. For the `,_jsx(_components.code,{children:`messages`}),`-style route, see `,_jsx(_components.a,{href:`/api-reference/chat-completions`,children:`Chat completions`}),`.`]}),`\n`,_jsxs(_components.p,{children:[`Install the official SDK from `,_jsx(_components.a,{href:`https://www.npmjs.com/package/zerogpu-api`,children:`npm`}),` or `,_jsx(_components.a,{href:`https://pypi.org/project/zerogpu-api/`,children:`PyPI`}),` (`,_jsx(_components.code,{children:`pip install zerogpu-api`}),`). Source: `,_jsx(_components.a,{href:`https://github.com/zerogpu/SDK`,children:`zerogpu/SDK`}),`. Handle errors the same way as `,_jsx(_components.a,{href:`/docs/production-patterns#handle-status-codes-explicitly`,children:`API error codes`}),`.`]}),`\n`,_jsx(Heading,{level:`2`,id:`authentication`,children:`Authentication`}),`\n`,_jsxs(_components.p,{children:[`Send your API key in the `,_jsx(_components.code,{children:`x-api-key`}),` header or, OpenAI-compatible, as `,_jsx(_components.code,{children:`Authorization: Bearer \u003ckey>`}),`. The `,_jsx(_components.code,{children:`x-project-id`}),` header is optional; send it only to scope a request to a specific project. See the `,_jsx(_components.a,{href:`/docs/quickstart#1-grab-your-credentials`,children:`Quickstart`}),` for both forms in each language.`]}),`\n`,_jsx(Heading,{level:`2`,id:`streaming`,children:`Streaming`}),`\n`,_jsxs(_components.p,{children:[`Set `,_jsx(_components.code,{children:`\"stream\": true`}),` to receive the response as server-sent events (`,_jsx(_components.code,{children:`text/event-stream`}),`) instead of one JSON body. Pass `,_jsx(_components.code,{children:`-N`}),` so curl prints each event as it arrives:`]}),`\n`,_jsx(CodeBlock,{filename:`cURL`,numberOfLines:`8`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`8`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -N`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` https://api.zerogpu.ai/v1/responses`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"content-type: application/json\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"x-api-key: `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$ZEROGPU_API_KEY`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -d`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '{`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"model\": \"gpt-4.1-mini\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"input\": \"Write one sentence about the sea.\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"stream\": true`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` }'`})}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`Each event is a `,_jsx(_components.code,{children:`data:`}),` line holding a JSON object with a `,_jsx(_components.code,{children:`type`}),` and a `,_jsx(_components.code,{children:`sequence_number`}),`:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`10`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`10`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`data: {\"type\":\"response.created\",\"response\":{\"id\":\"resp_abc123\",\"object\":\"response\",\"status\":\"in_progress\",\"output\":[],...},\"sequence_number\":0}`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`data: {\"type\":\"response.output_text.delta\",\"item_id\":\"msg_abc123\",\"output_index\":0,\"content_index\":0,\"delta\":\"The sea\",\"sequence_number\":4}`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`data: {\"type\":\"response.output_text.delta\",\"item_id\":\"msg_abc123\",\"output_index\":0,\"content_index\":0,\"delta\":\" hums\",\"sequence_number\":5}`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`data: {\"type\":\"response.completed\",\"response\":{\"id\":\"resp_abc123\",\"object\":\"response\",\"status\":\"completed\",\"output\":[...],\"usage\":{...}},\"sequence_number\":17}`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`data: [DONE]`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsx(_components.p,{children:`Events arrive in this order:`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Event`}),_jsx(_components.th,{children:`Sent when`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsxs(_components.td,{children:[_jsx(_components.code,{children:`response.created`}),`, `,_jsx(_components.code,{children:`response.in_progress`})]}),_jsxs(_components.td,{children:[`The response starts. `,_jsx(_components.code,{children:`response`}),` holds the response object, with an empty `,_jsx(_components.code,{children:`output`}),`.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`response.output_item.added`})}),_jsxs(_components.td,{children:[`An output item starts. `,_jsx(_components.code,{children:`item`}),` is a `,_jsx(_components.code,{children:`message`}),` or a `,_jsx(_components.code,{children:`function_call`}),`.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`response.content_part.added`})}),_jsx(_components.td,{children:`A content part of a message starts.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`response.output_text.delta`})}),_jsxs(_components.td,{children:[`The next chunk of text, in `,_jsx(_components.code,{children:`delta`}),`. Concatenate the deltas to build the text.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`response.output_text.done`})}),_jsxs(_components.td,{children:[`The content part is complete. `,_jsx(_components.code,{children:`text`}),` holds the full text.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`response.function_call_arguments.delta`})}),_jsxs(_components.td,{children:[`The next chunk of a tool call’s arguments, in `,_jsx(_components.code,{children:`delta`}),`.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`response.function_call_arguments.done`})}),_jsxs(_components.td,{children:[`The tool call’s arguments are complete. `,_jsx(_components.code,{children:`arguments`}),` holds the full JSON string.`]})]}),_jsxs(_components.tr,{children:[_jsxs(_components.td,{children:[_jsx(_components.code,{children:`response.content_part.done`}),`, `,_jsx(_components.code,{children:`response.output_item.done`})]}),_jsx(_components.td,{children:`The content part or output item is complete.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`response.completed`})}),_jsxs(_components.td,{children:[`The response is complete. `,_jsx(_components.code,{children:`response`}),` holds the full `,_jsx(_components.code,{children:`output`}),` and `,_jsx(_components.code,{children:`usage`}),`.`]})]})]})]}),`\n`,_jsxs(_components.p,{children:[`Reasoning models also send `,_jsx(_components.code,{children:`response.reasoning_text.delta`}),` or `,_jsx(_components.code,{children:`response.reasoning_summary_text.delta`}),` events before the answer. Most models end the stream with `,_jsx(_components.code,{children:`data: [DONE]`}),`; treat `,_jsx(_components.code,{children:`response.completed`}),` as the end of the response and ignore `,_jsx(_components.code,{children:`[DONE]`}),`. Task models (classifiers and extractors) don’t stream and return `,_jsx(_components.code,{children:`400`}),` with code `,_jsx(_components.code,{children:`stream_not_supported`}),`. Each `,_jsx(_components.a,{href:`/api-reference/models`,children:`model page`}),` says whether the model supports streaming.`]}),`\n`,_jsx(Heading,{level:`2`,id:`tool-calling`,children:`Tool calling`}),`\n`,_jsxs(_components.p,{children:[`Pass function definitions in `,_jsx(_components.code,{children:`tools`}),`. Each tool has a `,_jsx(_components.code,{children:`type`}),` of `,_jsx(_components.code,{children:`function`}),`, a `,_jsx(_components.code,{children:`name`}),`, a `,_jsx(_components.code,{children:`description`}),`, and its arguments as a JSON Schema in `,_jsx(_components.code,{children:`parameters`}),`:`]}),`\n`,_jsx(CodeBlock,{filename:`cURL`,numberOfLines:`21`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`21`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` https://api.zerogpu.ai/v1/responses`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"content-type: application/json\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"x-api-key: `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$ZEROGPU_API_KEY`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -d`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '{`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"model\": \"gpt-4.1-mini\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"input\": \"What is the weather in Paris right now?\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"tools\": [`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` {`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"type\": \"function\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"name\": \"get_weather\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"description\": \"Get the current weather for a city.\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"parameters\": {`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"type\": \"object\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"properties\": {`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"city\": { \"type\": \"string\", \"description\": \"City name\" }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` },`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"required\": [\"city\"]`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` ]`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` }'`})}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`When the model calls a tool, `,_jsx(_components.code,{children:`output`}),` contains a `,_jsx(_components.code,{children:`function_call`}),` item. `,_jsx(_components.code,{children:`arguments`}),` is a JSON-encoded string, so parse it before use:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`17`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`17`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"resp_abc123\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"object\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"response\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"status\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"completed\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"model\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"gpt-4.1-mini\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"output\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: [`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"type\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"function_call\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"fc_abc123\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"call_id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"call_S4s5bz8VtacSuLONhiOHriD7\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"name\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"get_weather\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"arguments\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"{`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:`\\\\\"`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`city`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:`\\\\\"`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`:`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:`\\\\\"`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`Paris`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:`\\\\\"`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`}\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"status\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"completed\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ],`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"usage\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: { `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"input_tokens\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`67`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"output_tokens\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`15`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"total_tokens\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`82`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`Some models return an empty `,_jsx(_components.code,{children:`message`}),` item before the `,_jsx(_components.code,{children:`function_call`}),`, so find the call by its `,_jsx(_components.code,{children:`type`}),` rather than by position. Run the function yourself, then send the result back. Pass `,_jsx(_components.code,{children:`input`}),` as an array with the original message, the `,_jsx(_components.code,{children:`function_call`}),` item, and a `,_jsx(_components.code,{children:`function_call_output`}),` item with the same `,_jsx(_components.code,{children:`call_id`}),`, and include `,_jsx(_components.code,{children:`tools`}),` again:`]}),`\n`,_jsx(CodeBlock,{filename:`cURL`,numberOfLines:`34`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`34`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` https://api.zerogpu.ai/v1/responses`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"content-type: application/json\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"x-api-key: `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$ZEROGPU_API_KEY`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -d`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '{`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"model\": \"gpt-4.1-mini\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"input\": [`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` { \"role\": \"user\", \"content\": \"What is the weather in Paris right now?\" },`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` {`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"type\": \"function_call\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"call_id\": \"call_S4s5bz8VtacSuLONhiOHriD7\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"name\": \"get_weather\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"arguments\": \"{\\\\\"city\\\\\":\\\\\"Paris\\\\\"}\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` },`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` {`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"type\": \"function_call_output\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"call_id\": \"call_S4s5bz8VtacSuLONhiOHriD7\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"output\": \"{\\\\\"city\\\\\": \\\\\"Paris\\\\\", \\\\\"temperature_c\\\\\": 18, \\\\\"conditions\\\\\": \\\\\"light rain\\\\\"}\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` ],`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"tools\": [`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` {`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"type\": \"function\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"name\": \"get_weather\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"description\": \"Get the current weather for a city.\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"parameters\": {`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"type\": \"object\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"properties\": {`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"city\": { \"type\": \"string\", \"description\": \"City name\" }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` },`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"required\": [\"city\"]`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` ]`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` }'`})}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`The model answers with a `,_jsx(_components.code,{children:`message`}),` that uses the result, for example “The current weather in Paris is 18°C with light rain.” With `,_jsx(_components.code,{children:`\"stream\": true`}),`, a tool call arrives as `,_jsx(_components.code,{children:`response.function_call_arguments.delta`}),` events followed by `,_jsx(_components.code,{children:`response.function_call_arguments.done`}),`. Models without tool support return `,_jsx(_components.code,{children:`400`}),` with code `,_jsx(_components.code,{children:`tools_not_supported`}),`; each `,_jsx(_components.a,{href:`/api-reference/models`,children:`model page`}),` says whether the model supports tool calling.`]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Responses","description":"Send input to an AI model and receive a response.","openapi":"api-reference/openapi/zerogpu.openapi.json POST /responses","href":"/api-reference/responses"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Authentication","slug":"authentication","depth":2,"children":[]},{"title":"Streaming","slug":"streaming","depth":2,"children":[]},{"title":"Tool calling","slug":"tool-calling","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":["/_mintlify/custom/zerogpu/8c7bc8a63362c928/agent-mode.js"],"openApiReferenceData":{"operation":{"operationId":"createResponse","summary":"Create response","tags":["Responses"],"requestBody":"13d6abc6-2198-4cb3-8e34-12bbc5af62c8","responses":{"200":"787cdfb4-ce02-4f1b-b9cb-a1278fb4464f","400":"bd5298e1-a8f1-4810-9ca9-082330c2ab8a","401":"aadf1934-4b2f-4d32-a057-496f0af1f7ab","403":"68afc095-e7bb-4d2a-8ee7-4a35ed4f52e6","420":"c89ad14a-8594-4aa2-b1af-e24916f89723","500":"8ed4cc5a-5d18-4de4-ad77-8b389f04690b"},"parameters":["4f041f9a-db39-47d5-bf4c-1a81f09fe638"],"method":"post","type":"path","servers":["f1a1c8b0-c77a-421b-8ef6-fa95c59aa34a"],"security":["69aecfda-ce8e-41b1-a770-10e7a7876b7b","237d0429-ad70-448d-94dc-ca4de60cabad"],"path":"/responses","baseUrlOptions":["https://api.zerogpu.ai/v1"],"title":"Create response","description":"Send input to an AI model and receive a response.","codeSamples":[],"requestExampleLanguages":["bash","python","javascript","rust","go","ruby"],"requiredOnlyExamples":true,"requestExampleType":"generated","responseExampleType":"generated","prefillPlaygroundWithExample":true,"prefillPlaygroundExamples":[{"body.model":"llama-3.1-8b-instruct-fast","body.input.oneOf.0":"NASA announced that its Artemis III mission is now scheduled for late 2026, marking the first time astronauts will land on the lunar surface since Apollo 17 in 1972. The mission will send a crew of four to the Moon aboard the Orion spacecraft, with two astronauts descending to the south pole using SpaceX Starship as a lunar lander. Scientists are particularly excited about exploring permanently shadowed craters that may contain water ice, which could be critical for sustaining long-term human presence on the Moon."},{"body.model":"gpt-4.1-mini","body.input.oneOf.0":"Write one sentence about the sea.","body.stream":true},{"body.model":"gpt-4.1-mini","body.input.oneOf.0":"What is the weather in Paris right now?","body.tools.items.0.type":"function","body.tools.items.0.name":"get_weather","body.tools.items.0.parameters":{"type":"object","properties":{"city":{"type":"string","description":"City name"}},"required":["city"]},"body.tools.items.0.description":"Get the current weather for a city."}],"disableProxy":true},"dependencies":{"parameters":{"4f041f9a-db39-47d5-bf4c-1a81f09fe638":{"name":"x-project-id","in":"header","required":false,"schema":{"type":"string","isRequired":false,"description":"Optional project identifier. Scopes the request to a specific project when provided.","uniqueKey":"","typeLabel":"string"},"description":"Optional project identifier. Scopes the request to a specific project when provided."}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["model","input"],"properties":{"model":{"type":"string","description":"Model identifier. Open a [model page](/api-reference/models) for a dedicated playground with the correct body for that model.","enum":["llama-3.1-8b-instruct-fast","llama-3.2-3b-instruct-fast","qwen3-30b-a3b-fp8","llama-guard-4-12b","LFM2.5-1.2B-Instruct","LFM2.5-1.2B-Thinking","gpt-oss-120b","qwen3.6-35b-a3b","deepseek-v4.1-flash","glm-5.3-flash","gpt-5.4-nano","gpt-5.6-luna","gpt-6-luna","gpt-4.1-mini","deberta-v3-small","gliner2.5-base-v1","gliner2.5-multi-v1","gliner2.5-decide-v1","zlm-v1-iab-classify-edge","zlm-v1-signal-extract","zlm-v2-iab-classify-edge-enriched","zlm-v1-iab-domain-classifier","zlm-v1-tool-decisions","unlimited-ocr"],"example":"llama-3.1-8b-instruct-fast","isRequired":true,"uniqueKey":"model","typeLabel":"enum\u003cstring>"},"input":{"oneOf":[{"type":"string","title":"Text","description":"The text or document to send, as a plain string. To return a tool result, send an array of input items instead: the conversation so far, the model's `function_call` item, and a `function_call_output` item with the same `call_id`.","format":"textarea","maxLength":131072,"minLength":1,"isRequired":true,"uniqueKey":"input.oneOf.0","typeLabel":"string\u003ctextarea>"},{"type":"array","items":{"oneOf":[{"type":"object","title":"Message","description":"One item of an array `input`.","required":["role","content"],"properties":{"role":{"type":"string","description":"Author of the message, for example `user`.","example":"user","isRequired":true,"uniqueKey":"input.oneOf.1.items.[INDEX].oneOf.0.role","typeLabel":"string"},"content":{"type":"string","description":"Message text.","isRequired":true,"uniqueKey":"input.oneOf.1.items.[INDEX].oneOf.0.content","typeLabel":"string"}},"uniqueKey":"input.oneOf.1.items.[INDEX].oneOf.0","typeLabel":"Message · object"},{"type":"object","title":"Function call","description":"One item of an array `input`.","properties":{"type":{"type":"string","enum":["function_call"],"description":"Always `function_call`.","uniqueKey":"input.oneOf.1.items.[INDEX].oneOf.1.type","typeLabel":"enum\u003cstring>"},"id":{"type":"string","description":"Output item ID.","uniqueKey":"input.oneOf.1.items.[INDEX].oneOf.1.id","typeLabel":"string"},"call_id":{"type":"string","description":"ID that links this call to its `function_call_output`.","example":"call_S4s5bz8VtacSuLONhiOHriD7","uniqueKey":"input.oneOf.1.items.[INDEX].oneOf.1.call_id","typeLabel":"string"},"name":{"type":"string","description":"Name of the function to call.","example":"get_weather","uniqueKey":"input.oneOf.1.items.[INDEX].oneOf.1.name","typeLabel":"string"},"arguments":{"type":"string","description":"Arguments as a JSON-encoded string. Parse it before use.","example":"{\"city\":\"Paris\"}","uniqueKey":"input.oneOf.1.items.[INDEX].oneOf.1.arguments","typeLabel":"string"},"status":{"type":"string","description":"Item status, for example `completed`.","example":"completed","uniqueKey":"input.oneOf.1.items.[INDEX].oneOf.1.status","typeLabel":"string"}},"uniqueKey":"input.oneOf.1.items.[INDEX].oneOf.1","typeLabel":"Function call · object"},{"type":"object","title":"Function call output","description":"One item of an array `input`.","required":["type","call_id","output"],"properties":{"type":{"type":"string","enum":["function_call_output"],"description":"Always `function_call_output`.","isRequired":true,"uniqueKey":"input.oneOf.1.items.[INDEX].oneOf.2.type","typeLabel":"enum\u003cstring>"},"call_id":{"type":"string","description":"The `call_id` of the `function_call` this answers.","isRequired":true,"uniqueKey":"input.oneOf.1.items.[INDEX].oneOf.2.call_id","typeLabel":"string"},"output":{"type":"string","description":"The tool result as a string, for example JSON.","example":"{\"city\": \"Paris\", \"temperature_c\": 18, \"conditions\": \"light rain\"}","isRequired":true,"uniqueKey":"input.oneOf.1.items.[INDEX].oneOf.2.output","typeLabel":"string"}},"uniqueKey":"input.oneOf.1.items.[INDEX].oneOf.2","typeLabel":"Function call output · object"}],"uniqueKey":"input.oneOf.1.items.[INDEX]","typeLabel":"Message · object | Function call · object | Function call output · object"},"title":"Input items","description":"The text or document to send, as a plain string. To return a tool result, send an array of input items instead: the conversation so far, the model's `function_call` item, and a `function_call_output` item with the same `call_id`.","isRequired":true,"uniqueKey":"input.oneOf.1","typeLabel":"(Message · object | Function call · object | Function call output · object)[]"}],"isRequired":true,"uniqueKey":"input","typeLabel":"string\u003ctextarea> | (Message · object | Function call · object | Function call output · object)[]"},"stream":{"type":"boolean","default":false,"description":"If `true`, the response is sent as server-sent events (`text/event-stream`) instead of one JSON body. See [Streaming](/api-reference/responses#streaming) for the events. Supported on text-generation models; task models (classifiers, extractors) return `400` with code `stream_not_supported`.","uniqueKey":"stream","typeLabel":"boolean"},"tools":{"type":"array","items":{"type":"object","description":"A function the model may call.","required":["type","name","parameters"],"properties":{"type":{"type":"string","enum":["function"],"description":"Always `function`.","isRequired":true,"uniqueKey":"tools.items.[INDEX].type","typeLabel":"enum\u003cstring>"},"name":{"type":"string","description":"Function name the model uses to call it.","example":"get_weather","isRequired":true,"uniqueKey":"tools.items.[INDEX].name","typeLabel":"string"},"parameters":{"type":"object","additionalProperties":true,"description":"JSON Schema for the function's arguments.","isRequired":true,"uniqueKey":"tools.items.[INDEX].parameters","typeLabel":"object"},"description":{"type":"string","description":"What the function does. The model uses this to decide when to call it.","example":"Get the current weather for a city.","uniqueKey":"tools.items.[INDEX].description","typeLabel":"string"}},"uniqueKey":"tools.items.[INDEX]","typeLabel":"object"},"description":"Function tools the model may call. When it calls one, `output` contains a `function_call` item; see [Tool calling](/api-reference/responses#tool-calling). Models without tool support return `400` with code `tools_not_supported`.","uniqueKey":"tools","typeLabel":"object[]"},"text":{"type":"object","description":"Response format configuration.","properties":{"format":{"type":"object","properties":{"type":{"type":"string","description":"Output format for the response, for example `text`.","example":"text","uniqueKey":"text.format.type","typeLabel":"string"}},"uniqueKey":"text.format","typeLabel":"object"}},"uniqueKey":"text","typeLabel":"object"},"instructions":{"type":"string","description":"Optional system-style instructions applied on top of `input`, for models that support them.","uniqueKey":"instructions","typeLabel":"string"},"metadata":{"type":"object","additionalProperties":true,"description":"Optional model-specific parameters, passed through to the model. For example, the GLiNER2.5 models accept `usecase` together with `labels` or `schema`. See the relevant [model page](/api-reference/models) for supported keys.","uniqueKey":"metadata","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"examples":{"default":{"title":"default","summary":"Text input","value":{"model":"llama-3.1-8b-instruct-fast","input":"NASA announced that its Artemis III mission is now scheduled for late 2026, marking the first time astronauts will land on the lunar surface since Apollo 17 in 1972. The mission will send a crew of four to the Moon aboard the Orion spacecraft, with two astronauts descending to the south pole using SpaceX Starship as a lunar lander. Scientists are particularly excited about exploring permanently shadowed craters that may contain water ice, which could be critical for sustaining long-term human presence on the Moon."}},"streaming":{"title":"streaming","summary":"Streaming","value":{"model":"gpt-4.1-mini","input":"Write one sentence about the sea.","stream":true}},"tools":{"title":"tools","summary":"Tool calling","value":{"model":"gpt-4.1-mini","input":"What is the weather in Paris right now?","tools":[{"type":"function","name":"get_weather","description":"Get the current weather for a city.","parameters":{"type":"object","properties":{"city":{"type":"string","description":"City name"}},"required":["city"]}}]}}},"exampleType":"examples"}},"exampleType":"examples"},"responses":{"787cdfb4-ce02-4f1b-b9cb-a1278fb4464f":{"description":"Success. A JSON response object, or a stream of server-sent events when `stream` is `true`.","content":{"application/json":{"schema":{"type":"object","description":"The generated model response.","properties":{"id":{"type":"string","description":"Unique identifier for the response.","example":"resp_abc123","uniqueKey":"id","typeLabel":"string"},"object":{"type":"string","description":"Object type. Always `response`.","example":"response","uniqueKey":"object","typeLabel":"string"},"created":{"type":"integer","description":"Unix timestamp (seconds) when the response was created.","example":1710000000,"uniqueKey":"created","typeLabel":"integer"},"model":{"type":"string","description":"The model used for inference.","example":"llama-3.1-8b-instruct-fast","uniqueKey":"model","typeLabel":"string"},"output":{"type":"array","description":"Output items produced by the model: `message` items, and a `function_call` item for each tool the model calls. Reasoning models may also return a `reasoning` item. Read items by `type`, not by position.","items":{"oneOf":[{"type":"object","description":"A single output item from the model.","properties":{"type":{"type":"string","description":"Output item type.","example":"message","uniqueKey":"output.items.[INDEX].oneOf.0.type","typeLabel":"string"},"role":{"type":"string","description":"Author of the output. Always `assistant`.","example":"assistant","uniqueKey":"output.items.[INDEX].oneOf.0.role","typeLabel":"string"},"content":{"type":"array","description":"Content parts that make up the message.","items":{"type":"object","properties":{"type":{"type":"string","description":"Content part type.","example":"output_text","uniqueKey":"output.items.[INDEX].oneOf.0.content.items.[INDEX].type","typeLabel":"string"},"text":{"type":"string","description":"The generated text.","example":"Artemis III, slated for late 2026, will return astronauts to the Moon for the first time since 1972.","uniqueKey":"output.items.[INDEX].oneOf.0.content.items.[INDEX].text","typeLabel":"string"}},"uniqueKey":"output.items.[INDEX].oneOf.0.content.items.[INDEX]","typeLabel":"object"},"uniqueKey":"output.items.[INDEX].oneOf.0.content","typeLabel":"object[]"}},"uniqueKey":"output.items.[INDEX].oneOf.0","typeLabel":"object"},{"type":"object","title":"Function call","description":"A tool call made by the model. Returned in `output`; send it back unchanged in `input` together with its `function_call_output`.","properties":{"type":{"type":"string","enum":["function_call"],"description":"Always `function_call`.","uniqueKey":"output.items.[INDEX].oneOf.1.type","typeLabel":"enum\u003cstring>"},"id":{"type":"string","description":"Output item ID.","uniqueKey":"output.items.[INDEX].oneOf.1.id","typeLabel":"string"},"call_id":{"type":"string","description":"ID that links this call to its `function_call_output`.","example":"call_S4s5bz8VtacSuLONhiOHriD7","uniqueKey":"output.items.[INDEX].oneOf.1.call_id","typeLabel":"string"},"name":{"type":"string","description":"Name of the function to call.","example":"get_weather","uniqueKey":"output.items.[INDEX].oneOf.1.name","typeLabel":"string"},"arguments":{"type":"string","description":"Arguments as a JSON-encoded string. Parse it before use.","example":"{\"city\":\"Paris\"}","uniqueKey":"output.items.[INDEX].oneOf.1.arguments","typeLabel":"string"},"status":{"type":"string","description":"Item status, for example `completed`.","example":"completed","uniqueKey":"output.items.[INDEX].oneOf.1.status","typeLabel":"string"}},"uniqueKey":"output.items.[INDEX].oneOf.1","typeLabel":"Function call · object"}],"uniqueKey":"output.items.[INDEX]","typeLabel":"object | Function call · object"},"uniqueKey":"output","typeLabel":"(object | Function call · object)[]"},"usage":{"type":"object","description":"Token usage statistics for the request.","properties":{"input_tokens":{"type":"integer","description":"Number of tokens in the input.","example":112,"uniqueKey":"usage.input_tokens","typeLabel":"integer"},"output_tokens":{"type":"integer","description":"Number of tokens generated.","example":44,"uniqueKey":"usage.output_tokens","typeLabel":"integer"},"total_tokens":{"type":"integer","description":"Total tokens consumed (input plus output).","example":156,"uniqueKey":"usage.total_tokens","typeLabel":"integer"}},"uniqueKey":"usage","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"examples":{"default":{"title":"default","summary":"Text response","value":{"id":"resp_abc123","object":"response","created":1710000000,"model":"llama-3.1-8b-instruct-fast","output":[{"type":"message","role":"assistant","content":[{"type":"output_text","text":"Artemis III, slated for late 2026, will return astronauts to the Moon for the first time since 1972, landing two crew at the south pole to study shadowed craters that may hold water ice."}]}],"usage":{"input_tokens":112,"output_tokens":44,"total_tokens":156}}},"tool_call":{"title":"tool_call","summary":"Tool call","value":{"id":"resp_abc123","object":"response","status":"completed","model":"gpt-4.1-mini","output":[{"type":"function_call","id":"fc_abc123","call_id":"call_S4s5bz8VtacSuLONhiOHriD7","name":"get_weather","arguments":"{\"city\":\"Paris\"}","status":"completed"}],"usage":{"input_tokens":67,"output_tokens":15,"total_tokens":82}}}},"exampleType":"examples"},"text/event-stream":{"schema":{"type":"object","description":"One server-sent event of a streamed response. Each event is sent as a `data:` line holding this JSON object; most models end the stream with `data: [DONE]`.","required":["type","sequence_number"],"properties":{"type":{"type":"string","description":"Event type.","enum":["response.created","response.in_progress","response.output_item.added","response.content_part.added","response.output_text.delta","response.output_text.done","response.content_part.done","response.function_call_arguments.delta","response.function_call_arguments.done","response.reasoning_text.delta","response.reasoning_text.done","response.reasoning_summary_text.delta","response.output_item.done","response.completed"],"isRequired":true,"uniqueKey":"type","typeLabel":"enum\u003cstring>"},"sequence_number":{"type":"integer","description":"Position of the event in the stream, starting at 0.","isRequired":true,"uniqueKey":"sequence_number","typeLabel":"integer"},"output_index":{"type":"integer","description":"Index of the output item the event belongs to.","uniqueKey":"output_index","typeLabel":"integer"},"item_id":{"type":"string","description":"ID of the output item the event belongs to.","uniqueKey":"item_id","typeLabel":"string"},"delta":{"type":"string","description":"On `*.delta` events: the next chunk of text or function arguments.","uniqueKey":"delta","typeLabel":"string"},"text":{"type":"string","description":"On `response.output_text.done`: the full text of the content part.","uniqueKey":"text","typeLabel":"string"},"arguments":{"type":"string","description":"On `response.function_call_arguments.done`: the full JSON-encoded arguments.","uniqueKey":"arguments","typeLabel":"string"},"item":{"type":"object","description":"On `response.output_item.added` and `.done`: the output item (`message` or `function_call`).","uniqueKey":"item","typeLabel":"object"},"response":{"type":"object","description":"On `response.created`, `response.in_progress` and `response.completed`: the response object. On `response.completed` it holds the full `output` and `usage`.","properties":{"id":{"type":"string","description":"Unique identifier for the response.","example":"resp_abc123","uniqueKey":"response.id","typeLabel":"string"},"object":{"type":"string","description":"Object type. Always `response`.","example":"response","uniqueKey":"response.object","typeLabel":"string"},"created":{"type":"integer","description":"Unix timestamp (seconds) when the response was created.","example":1710000000,"uniqueKey":"response.created","typeLabel":"integer"},"model":{"type":"string","description":"The model used for inference.","example":"llama-3.1-8b-instruct-fast","uniqueKey":"response.model","typeLabel":"string"},"output":{"type":"array","description":"Output items produced by the model: `message` items, and a `function_call` item for each tool the model calls. Reasoning models may also return a `reasoning` item. Read items by `type`, not by position.","items":{"oneOf":[{"type":"object","description":"A single output item from the model.","properties":{"type":{"type":"string","description":"Output item type.","example":"message","uniqueKey":"response.output.items.[INDEX].oneOf.0.type","typeLabel":"string"},"role":{"type":"string","description":"Author of the output. Always `assistant`.","example":"assistant","uniqueKey":"response.output.items.[INDEX].oneOf.0.role","typeLabel":"string"},"content":{"type":"array","description":"Content parts that make up the message.","items":{"type":"object","properties":{"type":{"type":"string","description":"Content part type.","example":"output_text","uniqueKey":"response.output.items.[INDEX].oneOf.0.content.items.[INDEX].type","typeLabel":"string"},"text":{"type":"string","description":"The generated text.","example":"Artemis III, slated for late 2026, will return astronauts to the Moon for the first time since 1972.","uniqueKey":"response.output.items.[INDEX].oneOf.0.content.items.[INDEX].text","typeLabel":"string"}},"uniqueKey":"response.output.items.[INDEX].oneOf.0.content.items.[INDEX]","typeLabel":"object"},"uniqueKey":"response.output.items.[INDEX].oneOf.0.content","typeLabel":"object[]"}},"uniqueKey":"response.output.items.[INDEX].oneOf.0","typeLabel":"object"},{"type":"object","title":"Function call","description":"A tool call made by the model. Returned in `output`; send it back unchanged in `input` together with its `function_call_output`.","properties":{"type":{"type":"string","enum":["function_call"],"description":"Always `function_call`.","uniqueKey":"response.output.items.[INDEX].oneOf.1.type","typeLabel":"enum\u003cstring>"},"id":{"type":"string","description":"Output item ID.","uniqueKey":"response.output.items.[INDEX].oneOf.1.id","typeLabel":"string"},"call_id":{"type":"string","description":"ID that links this call to its `function_call_output`.","example":"call_S4s5bz8VtacSuLONhiOHriD7","uniqueKey":"response.output.items.[INDEX].oneOf.1.call_id","typeLabel":"string"},"name":{"type":"string","description":"Name of the function to call.","example":"get_weather","uniqueKey":"response.output.items.[INDEX].oneOf.1.name","typeLabel":"string"},"arguments":{"type":"string","description":"Arguments as a JSON-encoded string. Parse it before use.","example":"{\"city\":\"Paris\"}","uniqueKey":"response.output.items.[INDEX].oneOf.1.arguments","typeLabel":"string"},"status":{"type":"string","description":"Item status, for example `completed`.","example":"completed","uniqueKey":"response.output.items.[INDEX].oneOf.1.status","typeLabel":"string"}},"uniqueKey":"response.output.items.[INDEX].oneOf.1","typeLabel":"Function call · object"}],"uniqueKey":"response.output.items.[INDEX]","typeLabel":"object | Function call · object"},"uniqueKey":"response.output","typeLabel":"(object | Function call · object)[]"},"usage":{"type":"object","description":"Token usage statistics for the request.","properties":{"input_tokens":{"type":"integer","description":"Number of tokens in the input.","example":112,"uniqueKey":"response.usage.input_tokens","typeLabel":"integer"},"output_tokens":{"type":"integer","description":"Number of tokens generated.","example":44,"uniqueKey":"response.usage.output_tokens","typeLabel":"integer"},"total_tokens":{"type":"integer","description":"Total tokens consumed (input plus output).","example":156,"uniqueKey":"response.usage.total_tokens","typeLabel":"integer"}},"uniqueKey":"response.usage","typeLabel":"object"}},"uniqueKey":"response","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"example":{"type":"response.output_text.delta","item_id":"msg_abc123","output_index":0,"content_index":0,"delta":"The sea","sequence_number":4},"examples":{"Example":{"title":"Example","value":{"type":"response.output_text.delta","item_id":"msg_abc123","output_index":0,"content_index":0,"delta":"The sea","sequence_number":4}}},"exampleType":"examples"}},"exampleType":"examples"},"bd5298e1-a8f1-4810-9ca9-082330c2ab8a":{"description":"Bad request (invalid body)","content":{"_mintlify/placeholder":{"schema":{"type":"object","description":""}}}},"aadf1934-4b2f-4d32-a057-496f0af1f7ab":{"description":"Unauthorized (missing API key)","content":{"_mintlify/placeholder":{"schema":{"type":"object","description":""}}}},"68afc095-e7bb-4d2a-8ee7-4a35ed4f52e6":{"description":"Forbidden (invalid API key or permissions)","content":{"_mintlify/placeholder":{"schema":{"type":"object","description":""}}}},"c89ad14a-8594-4aa2-b1af-e24916f89723":{"description":"Insufficient quota (insufficient_quota)","content":{"application/json":{"schema":{"type":"object","description":"Error payload returned on a failed request.","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable error code, for example `insufficient_quota`.","example":"insufficient_quota","uniqueKey":"error.code","typeLabel":"string"},"message":{"type":"string","description":"Human-readable description of the error.","example":"You have insufficient quota to complete this request.","uniqueKey":"error.message","typeLabel":"string"}},"uniqueKey":"error","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"example":{"error":{"code":"insufficient_quota","message":"You have insufficient quota to complete this request."}},"examples":{"Example":{"title":"Example","value":{"error":{"code":"insufficient_quota","message":"You have insufficient quota to complete this request."}}}},"exampleType":"examples"}},"exampleType":"examples"},"8ed4cc5a-5d18-4de4-ad77-8b389f04690b":{"description":"Internal server error","content":{"_mintlify/placeholder":{"schema":{"type":"object","description":""}}}}},"security":{"69aecfda-ce8e-41b1-a770-10e7a7876b7b":{"ApiKey":{"type":"apiKey","in":"header","name":"x-api-key","description":"Your ZeroGPU API key. Create one in the dashboard under API keys. Send it on every request.","scopes":[],"schemeName":"ApiKey"}},"237d0429-ad70-448d-94dc-ca4de60cabad":{"BearerAuth":{"type":"http","scheme":"bearer","description":"OpenAI-compatible: send your ZeroGPU API key as `Authorization: Bearer \u003ckey>`.","scopes":[],"schemeName":"BearerAuth"}}},"servers":{"f1a1c8b0-c77a-421b-8ef6-fa95c59aa34a":{"url":"https://api.zerogpu.ai/v1","description":"Production"}},"processedSecurityOptions":[{"schemes":[{"scheme":{"type":"apiKey","in":"header","name":"x-api-key","description":"Your ZeroGPU API key. Create one in the dashboard under API keys. Send it on every request.","scopes":[],"schemeName":"ApiKey"},"schema":{"title":"x-api-key","type":"string","description":"Your ZeroGPU API key. Create one in the dashboard under API keys. Send it on every request.","isRequired":true,"typeLabel":"string","deprecated":false},"schemeName":"ApiKey","name":"x-api-key"}],"title":"ApiKey"},{"schemes":[{"scheme":{"type":"http","scheme":"bearer","description":"OpenAI-compatible: send your ZeroGPU API key as `Authorization: Bearer \u003ckey>`.","scopes":[],"schemeName":"BearerAuth"},"schema":{"title":"Bearer Auth","type":"string","isRequired":true,"description":"OpenAI-compatible: send your ZeroGPU API key as `Authorization: Bearer \u003ckey>`.","format":"bearer","typeLabel":"string\u003cbearer>","deprecated":false},"schemeName":"BearerAuth","name":"Authorization"}],"title":"BearerAuth"}]},"originalFileLocation":"api-reference/openapi/zerogpu.openapi.json"},"subdomain":"zerogpu","siteName":"ZeroGPU","title":"Responses - ZeroGPU","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-11-12T19:44:42.867Z","originalFileLocation":"api-reference/responses.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"light\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Send input to an AI model and receive a response.\">\u003cmeta data-mint-head name=\"application-name\" content=\"ZeroGPU\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/zerogpu/4ZkKhiBJBB1TJuhq/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/zerogpu/4ZkKhiBJBB1TJuhq/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/zerogpu/4ZkKhiBJBB1TJuhq/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/zerogpu/4ZkKhiBJBB1TJuhq/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/zerogpu/4ZkKhiBJBB1TJuhq/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/zerogpu/4ZkKhiBJBB1TJuhq/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/zerogpu/4ZkKhiBJBB1TJuhq/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/zerogpu/4ZkKhiBJBB1TJuhq/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/zerogpu/4ZkKhiBJBB1TJuhq/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Responses - ZeroGPU\">\u003cmeta data-mint-head property=\"og:description\" content=\"Send input to an AI model and receive a response.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"ZeroGPU\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.zerogpu.ai/api-reference/responses\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://zerogpu.mintlify.site/_mintlify/api/og/v2?division=API+Reference\u0026amp;title=Responses\u0026amp;description=Send+input+to+an+AI+model+and+receive+a+response.\u0026amp;theme=12f23bc6adc376c9475ac27a\u0026amp;signature=a0cfdc0e0cfc30b743b775488fbbe996659be561ceab47196436a97771a6dbbf\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Responses - ZeroGPU\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Send input to an AI model and receive a response.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://zerogpu.mintlify.site/_mintlify/api/og/v2?division=API+Reference\u0026amp;title=Responses\u0026amp;description=Send+input+to+an+AI+model+and+receive+a+response.\u0026amp;theme=12f23bc6adc376c9475ac27a\u0026amp;signature=a0cfdc0e0cfc30b743b775488fbbe996659be561ceab47196436a97771a6dbbf\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/zerogpu/4ZkKhiBJBB1TJuhq/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"ZeroGPU\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#15803D\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.zerogpu.ai/api-reference/responses\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/api-reference/responses.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.zerogpu.ai/#organization\",\"name\":\"ZeroGPU\",\"url\":\"https://docs.zerogpu.ai\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/zerogpu/Gm1fjnUZg6Fa99hP/assets/zerogpu-docs-logo-light.png?fit=max\u0026auto=format\u0026n=Gm1fjnUZg6Fa99hP\u0026q=85\u0026s=78a4ce11cf0b3f707ad7bc829b979475\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.zerogpu.ai#website\",\"name\":\"ZeroGPU\",\"url\":\"https://docs.zerogpu.ai\",\"publisher\":{\"@id\":\"https://docs.zerogpu.ai/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.zerogpu.ai/api-reference/responses#webpage\",\"url\":\"https://docs.zerogpu.ai/api-reference/responses\",\"name\":\"Responses\",\"description\":\"Send input to an AI model and receive a response.\",\"dateModified\":\"2026-11-12T19:44:42.867Z\",\"isPartOf\":{\"@id\":\"https://docs.zerogpu.ai#website\"},\"breadcrumb\":{\"@id\":\"https://docs.zerogpu.ai/api-reference/responses#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.zerogpu.ai/api-reference/responses#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"ZeroGPU\",\"item\":\"https://docs.zerogpu.ai\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Responses\",\"item\":\"https://docs.zerogpu.ai/api-reference/responses\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://docs.zerogpu.ai/api-reference/responses#apireference\",\"headline\":\"Responses\",\"name\":\"Responses\",\"description\":\"Send input to an AI model and receive a response.\",\"url\":\"https://docs.zerogpu.ai/api-reference/responses\",\"mainEntityOfPage\":{\"@id\":\"https://docs.zerogpu.ai/api-reference/responses#webpage\"},\"dateModified\":\"2026-11-12T19:44:42.867Z\",\"publisher\":{\"@id\":\"https://docs.zerogpu.ai/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.zerogpu.ai#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"ZeroGPU\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"ZeroGPU\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/api-reference/responses.md","siteName":"ZeroGPU","nav":{"global":null,"products":[{"product":"Developers","icon":"code","description":"Inference API, models, SDKs and integrations","tabs":[{"tab":"Documentation","groups":[{"group":"Get Started","pages":[{"title":"Introduction","href":""},{"title":"How it works","href":"/docs/how-zerogpu-works"},{"title":"Quickstart","href":"/docs/quickstart"}]},{"group":"Models","pages":[{"title":"Model Catalog","href":"/docs/model-catalog"},{"title":"Open Weight","href":"/docs/open-weight"},{"group":"By Task","expanded":false,"pages":[{"title":"Text Generation","href":"/docs/text-generation"},{"title":"Audio Models","href":"/docs/audio"},{"title":"Text Classification","href":"/docs/text-classification"},{"title":"Moderation","href":"/docs/moderation"},{"title":"Embeddings","href":"/docs/embeddings"},{"title":"Ad Tech","description":"Edge IAB classifiers that map content to taxonomy, audience, and intent signals for programmatic advertising.","href":"/docs/ad-tech"}]}]},{"group":"API Reference","pages":[{"title":"Responses","openapi":"api-reference/openapi/zerogpu.openapi.json POST /responses","href":"/api-reference/responses"},{"title":"Chat completions","description":"OpenAI-style chat inference for models that use this route.","sidebarTitle":"Chat completions","openapi":"api-reference/openapi/zerogpu.openapi.json POST /chat/completions","href":"/api-reference/chat-completions"},{"title":"Moderations","sidebarTitle":"Moderations","openapi":"api-reference/openapi/zerogpu.openapi.json POST /moderations","href":"/api-reference/moderations"},{"title":"System One","sidebarTitle":"System One","openapi":"api-reference/openapi/zerogpu.openapi.json POST /systemone","href":"/api-reference/systemone"},{"title":"Embeddings","sidebarTitle":"Embeddings","openapi":"api-reference/openapi/zerogpu.openapi.json POST /embeddings","href":"/api-reference/embeddings"},{"group":"By model","pages":[{"title":"gpt-oss-120b","sidebarTitle":"gpt-oss-120b","openapi":"api-reference/openapi/playgrounds/gpt-oss-120b.openapi.json POST /responses","href":"/api-reference/models/gpt-oss-120b"},{"title":"gpt-oss-20b","sidebarTitle":"gpt-oss-20b","openapi":"api-reference/openapi/playgrounds/gpt-oss-20b.openapi.json POST /chat/completions","href":"/api-reference/models/gpt-oss-20b"},{"title":"qwen3-30b-a3b-fp8","sidebarTitle":"qwen3-30b-a3b-fp8","openapi":"api-reference/openapi/playgrounds/qwen3-30b-a3b-fp8.openapi.json POST /chat/completions","href":"/api-reference/models/qwen3-30b-a3b-fp8"},{"title":"qwen3.6-35b-a3b","sidebarTitle":"qwen3.6-35b-a3b","openapi":"api-reference/openapi/playgrounds/qwen3_6-35b-a3b.openapi.json POST /responses","href":"/api-reference/models/qwen3-6-35b-a3b"},{"title":"unlimited-ocr","sidebarTitle":"unlimited-ocr","openapi":"api-reference/openapi/playgrounds/unlimited-ocr.openapi.json POST /responses","href":"/api-reference/models/unlimited-ocr"},{"title":"deepseek-v4.1-flash","sidebarTitle":"deepseek-v4.1-flash","openapi":"api-reference/openapi/playgrounds/deepseek-v4_1-flash.openapi.json POST /responses","href":"/api-reference/models/deepseek-v4-1-flash"},{"title":"glm-5.3-flash","sidebarTitle":"glm-5.3-flash","openapi":"api-reference/openapi/playgrounds/glm-5_3-flash.openapi.json POST /responses","href":"/api-reference/models/glm-5-3-flash"},{"title":"gpt-5.4-nano","sidebarTitle":"gpt-5.4-nano","openapi":"api-reference/openapi/playgrounds/gpt-5_4-nano.openapi.json POST /responses","href":"/api-reference/models/gpt-5-4-nano"},{"title":"gpt-5.6-luna","sidebarTitle":"gpt-5.6-luna","openapi":"api-reference/openapi/playgrounds/gpt-5_6-luna.openapi.json POST /responses","href":"/api-reference/models/gpt-5-6-luna"},{"title":"gpt-6-luna","sidebarTitle":"gpt-6-luna","openapi":"api-reference/openapi/playgrounds/gpt-6-luna.openapi.json POST /responses","href":"/api-reference/models/gpt-6-luna"},{"title":"gpt-4.1-mini","sidebarTitle":"gpt-4.1-mini","openapi":"api-reference/openapi/playgrounds/gpt-4_1-mini.openapi.json POST /responses","href":"/api-reference/models/gpt-4-1-mini"},{"title":"deberta-v3-small","sidebarTitle":"deberta-v3-small","openapi":"api-reference/openapi/playgrounds/deberta-v3-small.openapi.json POST /responses","href":"/api-reference/models/deberta-v3-small"},{"title":"gliner2.5-base-v1","sidebarTitle":"gliner2.5-base-v1","openapi":"api-reference/openapi/playgrounds/gliner2_5-base-v1.openapi.json POST /responses","href":"/api-reference/models/gliner2-5-base-v1"},{"title":"gliner2.5-multi-v1","sidebarTitle":"gliner2.5-multi-v1","openapi":"api-reference/openapi/playgrounds/gliner2_5-multi-v1.openapi.json POST /responses","href":"/api-reference/models/gliner2-5-multi-v1"},{"title":"gliner2.5-decide-v1","sidebarTitle":"gliner2.5-decide-v1","openapi":"api-reference/openapi/playgrounds/gliner2_5-decide-v1.openapi.json POST /responses","href":"/api-reference/models/gliner2-5-decide-v1"},{"title":"d1.1","sidebarTitle":"d1.1","openapi":"api-reference/openapi/playgrounds/d1_1.openapi.json POST /systemone","href":"/api-reference/models/d1-1"},{"title":"LFM2.5-1.2B-Instruct","sidebarTitle":"LFM2.5-1.2B-Instruct","openapi":"api-reference/openapi/playgrounds/LFM2_5-1_2B-Instruct.openapi.json POST /responses","href":"/api-reference/models/lfm2-5-1-2b-instruct"},{"title":"LFM2.5-1.2B-Thinking","sidebarTitle":"LFM2.5-1.2B-Thinking","openapi":"api-reference/openapi/playgrounds/LFM2_5-1_2B-Thinking.openapi.json POST /responses","href":"/api-reference/models/lfm2-5-1-2b-thinking"},{"title":"llama-3.1-8b-instruct-fast","sidebarTitle":"llama-3.1-8b-instruct-fast","openapi":"api-reference/openapi/playgrounds/llama-3_1-8b-instruct-fast.openapi.json POST /chat/completions","href":"/api-reference/models/llama-3-1-8b-instruct-fast"},{"title":"llama-3.2-3b-instruct-fast","sidebarTitle":"llama-3.2-3b-instruct-fast","openapi":"api-reference/openapi/playgrounds/llama-3_2-3b-instruct-fast.openapi.json POST /chat/completions","href":"/api-reference/models/llama-3-2-3b-instruct-fast"},{"title":"llama-guard-4-12b","sidebarTitle":"llama-guard-4-12b","openapi":"api-reference/openapi/playgrounds/llama-guard-4-12b.openapi.json POST /moderations","href":"/api-reference/models/llama-guard-4-12b"},{"title":"zlm-v1-iab-classify-edge","sidebarTitle":"zlm-v1-iab-classify-edge","openapi":"api-reference/openapi/playgrounds/zlm-v1-iab-classify-edge.openapi.json POST /responses","href":"/api-reference/models/zlm-v1-iab-classify-edge"},{"title":"zlm-v2-iab-classify-edge-enriched","sidebarTitle":"zlm-v2-iab-classify-edge-enriched","openapi":"api-reference/openapi/playgrounds/zlm-v2-iab-classify-edge-enriched.openapi.json POST /responses","href":"/api-reference/models/zlm-v2-iab-classify-edge-enriched"},{"title":"zlm-v1-iab-domain-classifier","sidebarTitle":"zlm-v1-iab-domain-classifier","openapi":"api-reference/openapi/playgrounds/zlm-v1-iab-domain-classifier.openapi.json POST /responses","href":"/api-reference/models/zlm-v1-iab-domain-classifier"},{"title":"zlm-v1-signal-extract","sidebarTitle":"zlm-v1-signal-extract","openapi":"api-reference/openapi/playgrounds/zlm-v1-signal-extract.openapi.json POST /responses","href":"/api-reference/models/zlm-v1-signal-extract"},{"title":"zlm-v1-moderation-edge","sidebarTitle":"zlm-v1-moderation-edge","openapi":"api-reference/openapi/playgrounds/zlm-v1-moderation-edge.openapi.json POST /moderations","href":"/api-reference/models/zlm-v1-moderation-edge"},{"title":"zlm-v1-tool-decisions","sidebarTitle":"zlm-v1-tool-decisions","openapi":"api-reference/openapi/playgrounds/zlm-v1-tool-decisions.openapi.json POST /responses","href":"/api-reference/models/zlm-v1-tool-decisions"},{"title":"all-minilm-l6-v2","sidebarTitle":"all-minilm-l6-v2","openapi":"api-reference/openapi/playgrounds/all-minilm-l6-v2.openapi.json POST /embeddings","href":"/api-reference/models/all-minilm-l6-v2"},{"title":"bge-small-en-v1.5","sidebarTitle":"bge-small-en-v1.5","openapi":"api-reference/openapi/playgrounds/bge-small-en-v1_5.openapi.json POST /embeddings","href":"/api-reference/models/bge-small-en-v1-5"},{"title":"whisper-tiny","sidebarTitle":"whisper-tiny","openapi":"api-reference/openapi/playgrounds/whisper-tiny.openapi.json POST /audio/transcriptions","href":"/api-reference/models/whisper-tiny"},{"title":"chatterbox-nano","sidebarTitle":"chatterbox-nano","openapi":"api-reference/openapi/playgrounds/chatterbox-nano.openapi.json POST /audio/speech","href":"/api-reference/models/chatterbox-nano"},{"title":"chatterbox","sidebarTitle":"chatterbox","openapi":"api-reference/openapi/playgrounds/chatterbox.openapi.json POST /audio/speech","href":"/api-reference/models/chatterbox"}]},{"group":"Audio Models","pages":[{"title":"Transcriptions","sidebarTitle":"Transcriptions","openapi":"api-reference/openapi/zerogpu.openapi.json POST /audio/transcriptions","href":"/api-reference/audio-transcriptions"},{"title":"Speech","sidebarTitle":"Speech","openapi":"api-reference/openapi/zerogpu.openapi.json POST /audio/speech","href":"/api-reference/audio-speech"}]},{"group":"ZeroClick","pages":[{"title":"Responses (ZeroClick)","sidebarTitle":"Responses","openapi":"api-reference/openapi/zeroclick.openapi.json POST /zeroclick/v1/responses","href":"/api-reference/zeroclick-responses"},{"title":"Chat completions (ZeroClick)","sidebarTitle":"Chat completions","openapi":"api-reference/openapi/zeroclick.openapi.json POST /zeroclick/v1/chat/completions","href":"/api-reference/zeroclick-chat-completions"},{"title":"Moderations (ZeroClick)","sidebarTitle":"Moderations","openapi":"api-reference/openapi/zeroclick.openapi.json POST /zeroclick/v1/moderations","href":"/api-reference/zeroclick-moderations"},{"title":"Embeddings (ZeroClick)","sidebarTitle":"Embeddings","openapi":"api-reference/openapi/zeroclick.openapi.json POST /zeroclick/v1/embeddings","href":"/api-reference/zeroclick-embeddings"},{"title":"Transcriptions (ZeroClick)","sidebarTitle":"Transcriptions","openapi":"api-reference/openapi/zeroclick.openapi.json POST /zeroclick/v1/audio/transcriptions","href":"/api-reference/zeroclick-audio-transcriptions"},{"title":"Translations (ZeroClick)","sidebarTitle":"Translations","openapi":"api-reference/openapi/zeroclick.openapi.json POST /zeroclick/v1/audio/translations","href":"/api-reference/zeroclick-audio-translations"},{"title":"Speech (ZeroClick)","sidebarTitle":"Speech","openapi":"api-reference/openapi/zeroclick.openapi.json POST /zeroclick/v1/audio/speech","href":"/api-reference/zeroclick-audio-speech"}]},{"group":"Batch API","pages":[{"title":"Upload file","openapi":"api-reference/openapi/batch.openapi.json POST /v1/files","href":"/api-reference/upload-file"},{"title":"List files","openapi":"api-reference/openapi/batch.openapi.json GET /v1/files","href":"/api-reference/list-files"},{"title":"Retrieve file","openapi":"api-reference/openapi/batch.openapi.json GET /v1/files/{file_id}","href":"/api-reference/retrieve-file"},{"title":"Download file","openapi":"api-reference/openapi/batch.openapi.json GET /v1/files/{file_id}/content","href":"/api-reference/download-file"},{"title":"Delete file","openapi":"api-reference/openapi/batch.openapi.json DELETE /v1/files/{file_id}","href":"/api-reference/delete-file"},{"title":"Create batch","openapi":"api-reference/openapi/batch.openapi.json POST /v1/batches","href":"/api-reference/create-batch"},{"title":"Retrieve batch","openapi":"api-reference/openapi/batch.openapi.json GET /v1/batches/{batch_id}","href":"/api-reference/retrieve-batch"},{"title":"List batches","openapi":"api-reference/openapi/batch.openapi.json GET /v1/batches","href":"/api-reference/list-batches"},{"title":"Cancel batch","openapi":"api-reference/openapi/batch.openapi.json POST /v1/batches/{batch_id}/cancel","href":"/api-reference/cancel-batch"}]}]},{"group":"Guides","pages":[{"group":"Batch \u0026 Files API","pages":[{"title":"Overview","href":"/docs/batch/index"},{"title":"Quickstart","href":"/docs/batch/getting-started"},{"title":"Objects \u0026 lifecycle","href":"/docs/batch/objects"},{"title":"JSONL Format","href":"/docs/batch/jsonl-format"},{"title":"Supported Endpoints","href":"/docs/batch/supported-endpoints"},{"title":"Errors","href":"/docs/batch/errors"}]},{"title":"Production patterns","href":"/docs/production-patterns"}]}]},{"tab":"Integrations","pages":[{"title":"Integrations","href":"/integrations"}]},{"tab":"Cookbook","pages":[{"title":"Cookbook","href":"/cookbook"}]}]},{"product":"Edge Providers","icon":"microchip","description":"Earn from idle device compute","pages":[{"title":"Edge Providers","href":"/edge"}]}]},"basePath":"","title":"Responses - ZeroGPU","deploymentId":"dpl_FZMKUpaaKiVETbfqhoUe4sPFDTmY","buildId":"dpl_FZMKUpaaKiVETbfqhoUe4sPFDTmY","dynamics":["c2aa737661","2b790eda92","b0f84f53ff","a9bb46feb3"],"chunks":["OpenApiReferenceProvider-B6WFFOBL.js","utils-BN5um1KA.js","cloneDeep-C3md22mN.js","_Uint8Array-DLlL8L26.js","isObject-FP1Yky1u.js","utils-BSmbkXJR.js","addUniqueKeysToSchema-2tqcVnUE.js","snippetPresets-CtWfvr2J.js","style-to-object-BY3JEAdk.js","v4-DIgz8zy6.js","conditional-requirements-CFM0id0Q.js","ApiExamples-DkKHBy30.js","isEqual-O3q7y6pq.js","usePlaygroundInputsStore-Brc5H9UJ.js","shallow-C4L4xvbs.js","getApiPlaygroundDisplay-2bxyq_aI.js","CodeSnippet-BJu8ddd5.js","CodeSnippets-dazWmoqB.js","Page-CnLhKuUV.js","getPastedJson-Chy3Qa1S.js","icon-CyO7h3jh.js","MethodPill-Dle0_91v.js","DuplicateIcon-CVvWAf4a.js","createIcon-Di07A27B.js","DynamicMarkdown-C4w9kavL.js","SectionHeading-XiBebVYC.js","axios-vUo_bRtp.js","Markdown-DTeL0SpS.js","dist-OCScizqf.js","lib-DuNMoZ05.js","lib-B8HbPgcC.js","katex-YMM-FMeD.js","html-void-elements-mCSPHezU.js","marked.esm-CZWythHk.js","AssistantPageLink-KcneGfMY.js"]}