Gata Inference
Inference API
One OpenAI-compatible endpoint for 40+ frontier models, with intelligent routing and automatic failover. If you've used the OpenAI API, you already know this one.
Authentication
All requests go to the base URL https://inference.apigata.net/v1 and authenticate with an API key as a bearer token. Create a key in the console under API keys.
Authorization: Bearer sk-your-gata-keyKeep keys server-side
Chat completions
The core endpoint. Send a list of messages, get a completion back.
/v1/chat/completionsRequest body
| Field | Type | Description |
|---|---|---|
| model* | string | Model id, e.g. claude-opus-4-8, gpt-5, gemini-2.5-pro. See Models. |
| messages* | array | Conversation so far. Each item has a role (system | user | assistant | tool) and content. |
| stream | boolean | Stream tokens as server-sent events. Defaults to false. |
| temperature | number | Sampling temperature, 0–2. Lower is more deterministic. |
| max_tokens | integer | Maximum tokens to generate in the completion. |
| top_p | number | Nucleus sampling. Use this or temperature, not both. |
| tools | array | Function/tool definitions the model may call. |
| tool_choice | string | object | Force or restrict tool calling: auto, none, or a specific tool. |
| response_format | object | { "type": "json_object" } to force valid JSON output. |
Example
curl https://inference.apigata.net/v1/chat/completions \
-H "Authorization: Bearer $GATA_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "claude-sonnet-4-6",
"messages": [
{ "role": "system", "content": "You are concise." },
{ "role": "user", "content": "Explain routing in one sentence." }
],
"temperature": 0.7
}'Response
{
"id": "chatcmpl-...",
"object": "chat.completion",
"model": "claude-sonnet-4-6",
"choices": [
{
"index": 0,
"message": { "role": "assistant", "content": "Routing sends each request to the best available model and fails over automatically." },
"finish_reason": "stop"
}
],
"usage": { "prompt_tokens": 24, "completion_tokens": 18, "total_tokens": 42 }
}Streaming
Set stream: true to receive the completion as server-sent events. Each event is a chat.completion.chunk with a token delta; the stream ends with data: [DONE].
stream = client.chat.completions.create(
model="gpt-5",
messages=[{"role": "user", "content": "Stream me a haiku."}],
stream=True,
)
for chunk in stream:
delta = chunk.choices[0].delta.content or ""
print(delta, end="", flush=True)Models
List the models available to your key. Pass any returned id as the model field.
/v1/modelscurl https://inference.apigata.net/v1/models -H "Authorization: Bearer $GATA_KEY"Gata routes across Anthropic, OpenAI, Google, DeepSeek, xAI, Mistral, and more — 40+ models behind one key. Browse the full catalogue and per-token pricing on the Models page.
Quota & pricing
Embeddings
Generate vector embeddings for search and retrieval.
/v1/embeddingscurl https://inference.apigata.net/v1/embeddings \
-H "Authorization: Bearer $GATA_KEY" \
-H "Content-Type: application/json" \
-d '{ "model": "text-embedding-3-large", "input": "Gata routes every model." }'Errors & limits
Errors return a non-2xx status and a JSON body. Handle these codes:
| Field | Type | Description |
|---|---|---|
| 400 | bad_request | Malformed request — check the model id and message shape. |
| 401 | unauthorized | Missing or invalid API key. |
| 402 | insufficient_quota | Account balance exhausted. Top up in the console. |
| 404 | not_found | Unknown model, or the model isn't enabled for your key. |
| 429 | rate_limited | Too many requests — back off and retry with exponential delay. |
| 5xx | server_error | Upstream/provider issue. Gata fails over automatically; safe to retry. |
{
"error": {
"message": "Insufficient quota. Top up your balance to continue.",
"type": "insufficient_quota",
"code": 402
}
}Per-key limits (quota, model whitelist, IP allowlist, expiry) are configured in the console under API keys. Set conservative quotas on keys you ship.