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.

http
Authorization: Bearer sk-your-gata-key

Keep keys server-side

Treat API keys like passwords. Never ship them in client-side code or commit them to source control. Scope per-key quotas and model whitelists in the console.

Chat completions

The core endpoint. Send a list of messages, get a completion back.

POST/v1/chat/completions

Request body

FieldTypeDescription
model*stringModel id, e.g. claude-opus-4-8, gpt-5, gemini-2.5-pro. See Models.
messages*arrayConversation so far. Each item has a role (system | user | assistant | tool) and content.
streambooleanStream tokens as server-sent events. Defaults to false.
temperaturenumberSampling temperature, 0–2. Lower is more deterministic.
max_tokensintegerMaximum tokens to generate in the completion.
top_pnumberNucleus sampling. Use this or temperature, not both.
toolsarrayFunction/tool definitions the model may call.
tool_choicestring | objectForce or restrict tool calling: auto, none, or a specific tool.
response_formatobject{ "type": "json_object" } to force valid JSON output.

Example

bash
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

json
{
  "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].

python
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.

GET/v1/models
bash
curl 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

Billing is pay-per-token in your account balance (quota unit: 500,000 = $1). Top up by card, redemption code, or crypto transfer in the console. Stake $GATA for a free daily quota on select models.

Embeddings

Generate vector embeddings for search and retrieval.

POST/v1/embeddings
bash
curl 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:

FieldTypeDescription
400bad_requestMalformed request — check the model id and message shape.
401unauthorizedMissing or invalid API key.
402insufficient_quotaAccount balance exhausted. Top up in the console.
404not_foundUnknown model, or the model isn't enabled for your key.
429rate_limitedToo many requests — back off and retry with exponential delay.
5xxserver_errorUpstream/provider issue. Gata fails over automatically; safe to retry.
json
{
  "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.

Gata Inference — Docs — Gata