curl --request POST \ --url https://api.zerogpu.ai/v1/chat/completions \ --header 'Content-Type: application/json' \ --header 'x-api-key: <api-key>' \ --data '{ "model": "llama-3.1-8b-instruct-fast", "messages": [ { "role": "user", "content": "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." } ]}'
import requests
url = "https://api.zerogpu.ai/v1/chat/completions"
payload = {
"model": "llama-3.1-8b-instruct-fast",
"messages": [
{
"role": "user",
"content": "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."
}
]
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)
const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: 'llama-3.1-8b-instruct-fast',
messages: [
{
role: 'user',
content: '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.'
}
]
})
};
fetch('https://api.zerogpu.ai/v1/chat/completions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
false
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.zerogpu.ai/v1/chat/completions"
payload := strings.NewReader("{\n \"model\": \"llama-3.1-8b-instruct-fast\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"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.\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}
require 'uri'
require 'net/http'
url = URI("https://api.zerogpu.ai/v1/chat/completions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"llama-3.1-8b-instruct-fast\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"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.\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body
{ "id": "chatcmpl_abc123", "object": "chat.completion", "created": 1710000000, "model": "llama-3.1-8b-instruct-fast", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "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." }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 112, "completion_tokens": 44, "total_tokens": 156 }}
{
"error": {
"code": "insufficient_quota",
"message": "You have insufficient quota to complete this request."
}
}
API Reference
Chat completions
OpenAI-style chat inference for models that use this route.
POST
/
chat
/
completions
Chat-completions style inference
curl --request POST \ --url https://api.zerogpu.ai/v1/chat/completions \ --header 'Content-Type: application/json' \ --header 'x-api-key: <api-key>' \ --data '{ "model": "llama-3.1-8b-instruct-fast", "messages": [ { "role": "user", "content": "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." } ]}'
import requests
url = "https://api.zerogpu.ai/v1/chat/completions"
payload = {
"model": "llama-3.1-8b-instruct-fast",
"messages": [
{
"role": "user",
"content": "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."
}
]
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)
const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: 'llama-3.1-8b-instruct-fast',
messages: [
{
role: 'user',
content: '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.'
}
]
})
};
fetch('https://api.zerogpu.ai/v1/chat/completions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
false
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.zerogpu.ai/v1/chat/completions"
payload := strings.NewReader("{\n \"model\": \"llama-3.1-8b-instruct-fast\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"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.\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}
require 'uri'
require 'net/http'
url = URI("https://api.zerogpu.ai/v1/chat/completions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"llama-3.1-8b-instruct-fast\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"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.\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body
{ "id": "chatcmpl_abc123", "object": "chat.completion", "created": 1710000000, "model": "llama-3.1-8b-instruct-fast", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "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." }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 112, "completion_tokens": 44, "total_tokens": 156 }}
{
"error": {
"code": "insufficient_quota",
"message": "You have insufficient quota to complete this request."
}
}
Some models are invoked with a chat-completions style body (messages array) instead of the Responsesinput field. The dashboard and model catalog indicate which route applies. Each model page has its own playground with the right examples for that model.Install the official SDK from npm or PyPI (pip install zerogpu-api). Source: zerogpu/SDK.Response JSON shape depends on the model; handle errors the same way as API error codes.
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,
llama-guard-4-12b,
LFM2.5-1.2B-Instruct,
LFM2.5-1.2B-Thinking,
gpt-oss-120b,
gpt-oss-20b,
qwen3-30b-a3b-fp8,
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"
messages
object[]
required
Ordered list of messages making up the conversation so far.
Minimum array length: 1
Hide child attributes
messages.role
enum<string>
required
Role of the message author.
Available options:
system,
user,
assistant
messages.content
string<textarea>
required
The message text.
Required string length: 1 - 131072
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
An OpenAI-compatible chat completion.
id
string
Unique identifier for the completion.
Example:
"chatcmpl_abc123"
object
string
Object type. Always chat.completion.
Example:
"chat.completion"
created
integer
Unix timestamp (seconds) when the completion was created.
Example:
1710000000
model
string
The model used for inference.
Example:
"llama-3.1-8b-instruct-fast"
choices
object[]
List of completion choices.
Hide child attributes
choices.index
integer
Position of this choice in the list.
Example:
0
choices.message
object
Hide child attributes
choices.message.role
enum<string>
required
Role of the message author.
Available options:
system,
user,
assistant
choices.message.content
string<textarea>
required
The message text.
Required string length: 1 - 131072
choices.finish_reason
string
Why the model stopped generating, for example stop or length.
Example:
"stop"
usage
object
Token usage statistics for the request.
Hide child attributes
usage.prompt_tokens
integer
Number of tokens in the prompt.
Example:
112
usage.completion_tokens
integer
Number of tokens in the generated completion.
Example:
44
usage.total_tokens
integer
Total tokens consumed (prompt plus completion).
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.4227","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/chat-completions","slug":"/api-reference/chat-completions","pageMetadata":{"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"},"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: \"OpenAI-style chat inference for models that use this route.\"\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`,strong:`strong`,..._provideComponents(),...props.components};return _jsxs(_Fragment,{children:[_jsxs(_components.p,{children:[`Some models are invoked with a `,_jsx(_components.strong,{children:`chat-completions`}),` style body (`,_jsx(_components.code,{children:`messages`}),` array) instead of the `,_jsx(_components.a,{href:`/api-reference/responses`,children:`Responses`}),` `,_jsx(_components.code,{children:`input`}),` field. The dashboard and `,_jsx(_components.a,{href:`/docs/model-catalog`,children:`model catalog`}),` indicate which route applies. Each model page has its own playground with the right examples for that model.`]}),`\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`}),`.`]}),`\n`,_jsxs(_components.p,{children:[`Response JSON shape depends on the model; handle errors the same way as `,_jsx(_components.a,{href:`/docs/production-patterns#handle-status-codes-explicitly`,children:`API error codes`}),`.`]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"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"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[],"codeExamples":{}},"jsLinks":["/_mintlify/custom/zerogpu/8c7bc8a63362c928/agent-mode.js"],"openApiReferenceData":{"operation":{"operationId":"createChatCompletion","summary":"Chat-completions style inference","description":"OpenAI-style chat inference for models that use this route.","tags":["Chat"],"x-mint":{"metadata":{"title":"Chat completions","sidebarTitle":"Chat completions","description":"Chat-style inference for models that use the messages route."}},"requestBody":"0413f6d8-ca7f-45e6-9889-f95a28c0abeb","responses":{"200":"3229d050-3928-47f0-a3c2-86b03a9188d5","400":"84d322e4-1bde-4b2d-a7fa-ec6254730cb7","401":"7291a564-4347-471c-afcd-2e10a9c273af","403":"1ff513e2-4b5c-4521-a5a4-9edfdfdccc22","420":"a44094f8-5417-4a19-ba54-22829c82a36d","500":"908c88b9-be06-4119-8aad-625c7c0e9088"},"parameters":["ea77ed5b-3d99-497c-839f-3a8dca58320a"],"method":"post","type":"path","servers":["f1a1c8b0-c77a-421b-8ef6-fa95c59aa34a"],"security":["69aecfda-ce8e-41b1-a770-10e7a7876b7b","237d0429-ad70-448d-94dc-ca4de60cabad"],"path":"/chat/completions","baseUrlOptions":["https://api.zerogpu.ai/v1"],"title":"Chat-completions style inference","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.messages.items.0.role":"user","body.messages.items.0.content":"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."}],"disableProxy":true},"dependencies":{"parameters":{"ea77ed5b-3d99-497c-839f-3a8dca58320a":{"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","messages"],"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","llama-guard-4-12b","LFM2.5-1.2B-Instruct","LFM2.5-1.2B-Thinking","gpt-oss-120b","gpt-oss-20b","qwen3-30b-a3b-fp8","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>"},"messages":{"type":"array","minItems":1,"description":"Ordered list of messages making up the conversation so far.","items":{"type":"object","required":["role","content"],"properties":{"role":{"type":"string","description":"Role of the message author.","enum":["system","user","assistant"],"isRequired":true,"uniqueKey":"messages.items.[INDEX].role","typeLabel":"enum\u003cstring>"},"content":{"type":"string","minLength":1,"format":"textarea","maxLength":131072,"description":"The message text.","isRequired":true,"uniqueKey":"messages.items.[INDEX].content","typeLabel":"string\u003ctextarea>"}},"uniqueKey":"messages.items.[INDEX]","typeLabel":"object"},"isRequired":true,"uniqueKey":"messages","typeLabel":"object[]"},"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"},"example":{"model":"llama-3.1-8b-instruct-fast","messages":[{"role":"user","content":"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."}]},"examples":{"Example":{"title":"Example","value":{"model":"llama-3.1-8b-instruct-fast","messages":[{"role":"user","content":"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."}]}}},"exampleType":"examples"}},"exampleType":"examples"},"responses":{"3229d050-3928-47f0-a3c2-86b03a9188d5":{"description":"Success","content":{"application/json":{"schema":{"type":"object","description":"An OpenAI-compatible chat completion.","properties":{"id":{"type":"string","description":"Unique identifier for the completion.","example":"chatcmpl_abc123","uniqueKey":"id","typeLabel":"string"},"object":{"type":"string","description":"Object type. Always `chat.completion`.","example":"chat.completion","uniqueKey":"object","typeLabel":"string"},"created":{"type":"integer","description":"Unix timestamp (seconds) when the completion 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"},"choices":{"type":"array","description":"List of completion choices.","items":{"type":"object","description":"A single completion choice.","properties":{"index":{"type":"integer","description":"Position of this choice in the list.","example":0,"uniqueKey":"choices.items.[INDEX].index","typeLabel":"integer"},"message":{"type":"object","required":["role","content"],"properties":{"role":{"type":"string","description":"Role of the message author.","enum":["system","user","assistant"],"isRequired":true,"uniqueKey":"choices.items.[INDEX].message.role","typeLabel":"enum\u003cstring>"},"content":{"type":"string","minLength":1,"format":"textarea","maxLength":131072,"description":"The message text.","isRequired":true,"uniqueKey":"choices.items.[INDEX].message.content","typeLabel":"string\u003ctextarea>"}},"uniqueKey":"choices.items.[INDEX].message","typeLabel":"object"},"finish_reason":{"type":"string","description":"Why the model stopped generating, for example `stop` or `length`.","example":"stop","uniqueKey":"choices.items.[INDEX].finish_reason","typeLabel":"string"}},"uniqueKey":"choices.items.[INDEX]","typeLabel":"object"},"uniqueKey":"choices","typeLabel":"object[]"},"usage":{"type":"object","description":"Token usage statistics for the request.","properties":{"prompt_tokens":{"type":"integer","description":"Number of tokens in the prompt.","example":112,"uniqueKey":"usage.prompt_tokens","typeLabel":"integer"},"completion_tokens":{"type":"integer","description":"Number of tokens in the generated completion.","example":44,"uniqueKey":"usage.completion_tokens","typeLabel":"integer"},"total_tokens":{"type":"integer","description":"Total tokens consumed (prompt plus completion).","example":156,"uniqueKey":"usage.total_tokens","typeLabel":"integer"}},"uniqueKey":"usage","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"example":{"id":"chatcmpl_abc123","object":"chat.completion","created":1710000000,"model":"llama-3.1-8b-instruct-fast","choices":[{"index":0,"message":{"role":"assistant","content":"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."},"finish_reason":"stop"}],"usage":{"prompt_tokens":112,"completion_tokens":44,"total_tokens":156}},"examples":{"Example":{"title":"Example","value":{"id":"chatcmpl_abc123","object":"chat.completion","created":1710000000,"model":"llama-3.1-8b-instruct-fast","choices":[{"index":0,"message":{"role":"assistant","content":"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."},"finish_reason":"stop"}],"usage":{"prompt_tokens":112,"completion_tokens":44,"total_tokens":156}}}},"exampleType":"examples"}},"exampleType":"examples"},"84d322e4-1bde-4b2d-a7fa-ec6254730cb7":{"description":"Bad request (invalid body)","content":{"_mintlify/placeholder":{"schema":{"type":"object","description":""}}}},"7291a564-4347-471c-afcd-2e10a9c273af":{"description":"Unauthorized (missing API key)","content":{"_mintlify/placeholder":{"schema":{"type":"object","description":""}}}},"1ff513e2-4b5c-4521-a5a4-9edfdfdccc22":{"description":"Forbidden (invalid API key or permissions)","content":{"_mintlify/placeholder":{"schema":{"type":"object","description":""}}}},"a44094f8-5417-4a19-ba54-22829c82a36d":{"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"},"908c88b9-be06-4119-8aad-625c7c0e9088":{"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":"Chat completions - ZeroGPU","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-06-08T01:28:49.117Z","originalFileLocation":"api-reference/chat-completions.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=\"OpenAI-style chat inference for models that use this route.\">\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=\"Chat completions - ZeroGPU\">\u003cmeta data-mint-head property=\"og:description\" content=\"OpenAI-style chat inference for models that use this route.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"ZeroGPU\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.zerogpu.ai/api-reference/chat-completions\">\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=Chat+completions\u0026amp;description=OpenAI-style+chat+inference+for+models+that+use+this+route.\u0026amp;theme=12f23bc6adc376c9475ac27a\u0026amp;signature=f9561a7f591ee0852d7615be18716d905f0b59f741f76196a1971b916ee141fd\">\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=\"Chat completions - ZeroGPU\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"OpenAI-style chat inference for models that use this route.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://zerogpu.mintlify.site/_mintlify/api/og/v2?division=API+Reference\u0026amp;title=Chat+completions\u0026amp;description=OpenAI-style+chat+inference+for+models+that+use+this+route.\u0026amp;theme=12f23bc6adc376c9475ac27a\u0026amp;signature=f9561a7f591ee0852d7615be18716d905f0b59f741f76196a1971b916ee141fd\">\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/chat-completions\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/api-reference/chat-completions.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/chat-completions#webpage\",\"url\":\"https://docs.zerogpu.ai/api-reference/chat-completions\",\"name\":\"Chat completions\",\"description\":\"OpenAI-style chat inference for models that use this route.\",\"dateModified\":\"2026-06-08T01:28:49.117Z\",\"isPartOf\":{\"@id\":\"https://docs.zerogpu.ai#website\"},\"breadcrumb\":{\"@id\":\"https://docs.zerogpu.ai/api-reference/chat-completions#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.zerogpu.ai/api-reference/chat-completions#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"API Reference\",\"item\":\"https://docs.zerogpu.ai/api-reference/responses\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Chat completions\",\"item\":\"https://docs.zerogpu.ai/api-reference/chat-completions\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://docs.zerogpu.ai/api-reference/chat-completions#apireference\",\"headline\":\"Chat completions\",\"name\":\"Chat completions\",\"description\":\"OpenAI-style chat inference for models that use this route.\",\"url\":\"https://docs.zerogpu.ai/api-reference/chat-completions\",\"mainEntityOfPage\":{\"@id\":\"https://docs.zerogpu.ai/api-reference/chat-completions#webpage\"},\"dateModified\":\"2026-06-08T01:28:49.117Z\",\"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/chat-completions.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","href":"/docs/ad-tech"}]}]},{"group":"API Reference","pages":[{"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"},{"title":"Chat completions","sidebarTitle":"Chat completions","openapi":"api-reference/openapi/zerogpu.openapi.json POST /chat/completions","href":"/api-reference/chat-completions"},{"title":"Moderations","description":"Classify text against OpenAI's safety categories.","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":"Chat completions - ZeroGPU","deploymentId":"dpl_vSEmv961Ncyvz1psVwgUnTXQMSYk","buildId":"dpl_vSEmv961Ncyvz1psVwgUnTXQMSYk","dynamics":["c2aa737661","2b790eda92","b0f84f53ff","a9bb46feb3"],"chunks":["OpenApiReferenceProvider-CrDfRf61.js","snippetPresets-Dv-cOUrx.js","utils-BUTreAgv.js","style-to-object-BY3JEAdk.js","utils-wsznt9RM.js","v4-DIgz8zy6.js","addUniqueKeysToSchema-DEsMlaPy.js","conditional-requirements-CFM0id0Q.js","cloneDeep-DontW4xJ.js","_Uint8Array-pP7X6_RM.js","isObject-FP1Yky1u.js","ApiExamples-CU_aGGP0.js","usePlaygroundInputsStore-7dNmUIbS.js","shallow-fTtruD8x.js","isEqual-BRfNFpSD.js","CodeSnippets-52884wUJ.js","CodeSnippet-eoRjC4Le.js","getApiPlaygroundDisplay-CZyAPlR2.js","Page-Cr9IwkK7.js","DynamicMarkdown-NFqqduU7.js","SectionHeading-DQ-mJoAt.js","icon-DXTBUt6s.js","MethodPill-2v-b3js5.js","getPastedJson-v_8Y1_4v.js","DuplicateIcon-DXIkhZIo.js","createIcon-DRpYuPZs.js","axios-CsQoIw0U.js","Markdown-CwtoSfEf.js","AssistantPageLink-CTqa3eoi.js","dist-DIfYWxfm.js","lib-DMeTj1gb.js","lib-B8HbPgcC.js","katex-Dbtb6Wk7.js","html-void-elements-mCSPHezU.js","marked.esm-CZWythHk.js"]}