SAVANT//GATEWAY

Integration reference

Your models. One connection.

Savant Gateway exposes an OpenAI-compatible Chat Completions API for available models across families, including Claude when listed. Read the model object to choose a row, then send its id to the chat endpoint. All paths below are relative to your deployment origin; $GATEWAY_URL stands for that origin in the examples.

OpenAI-compatibleBearer keyJSON + SSE

Vocabulary

Provider, family, and price group are different things

The model object carries all three. They are not interchangeable, and a consumer should never derive one from another.

Provider

Savant Gateway

The service serving the request. The API exposes it as owned_by: "savant-gateway".

Family

GPT · Claude · DeepSeek · …

The upstream model line. Family never describes price or access.

Price group

paid · subscription

The billing class. This is the group field and the authoritative access signal.

GroupBillingRouting
paidDebits prepaid account credit at the listed sell price after settlement.Requires a sell price and available credit.
subscriptionEach input and output token counts once toward the plan allowance. When the allowance runs out, the plan blocks calls or charges prepaid credit.Requires an active subscription whose snapshot includes this model; otherwise 403 subscription_required.

Authentication

One account key, two accepted headers

Create a key on your account page. Keys are account-scoped, hashed at rest, and revoked immediately. Send either a bearer token or x-api-key on every /v1 request.

Bearer authentication
curl "$GATEWAY_URL/v1/models" \
  -H "Authorization: Bearer sk-..."

x-api-key: sk-... is accepted as an alternative. A missing key returns 401 with type authentication_error.

GET /v1/models

List the catalog

Returns every active, in-catalog model visible to consumers. Prices are our sell prices in USD per 1M tokens; upstream cost is never included.

Request
curl "$GATEWAY_URL/v1/models" \
  -H "Authorization: Bearer sk-..."
Response · example
{
  "object": "list",
  "data": [
    {
      "id": "gpt-6.1-sol",
      "object": "model",
      "owned_by": "savant-gateway",
      "name": "Gpt 6.1 Sol",
      "family": "GPT",
      "group": "paid",
      "group_slug": "paid",
      "group_label": "Paid",
      "group_billing_mode": "paid",
      "requires_subscription": false,
      "context_window": "1M",
      "input_price_per_1m": 0.4,
      "output_price_per_1m": 0.6,
      "currency": "usd",
      "supports_tools": true,
      "supports_vision": true,
      "health": "live"
    }
  ]
}

Example values are illustrative. Call the endpoint for live names, prices, and availability.

GET /v1/models/{id}

Retrieve one published model

Returns the same model object the list publishes, or a 404 with code model_not_found. The id is the one the list published: a model name, or a name behind free/ or subscription/. Send it literally; a slash in an id only ever separates a billing tier. The same key is required.

Request
curl "$GATEWAY_URL/v1/models/gpt-6.1-sol" \
  -H "Authorization: Bearer sk-..."
404 · example
{
  "error": {
    "message": "Model 'gpt-6.1-sol' not found",
    "type": "invalid_request_error",
    "param": null,
    "code": "model_not_found"
  }
}

Model object

Every field, and what it does not mean

Use id for requests, family for presentation and filtering, and group for billing and access decisions.

FieldTypeMeaningExample
idstringPublic model id. Send this value as model in a completion.gpt-6.1-sol
object"model"Object type. Always model.model
owned_bystringProvider identity. Always savant-gateway; not a family or price group.savant-gateway
namestringHuman-readable display name.Gpt 6.1 Sol
familystringModel line, such as GPT, Claude, DeepSeek, Gemini, GLM, Kimi, or Grok.GPT
grouppaid | subscriptionBilling mode of the assigned group. Read this field before routing or budgeting.paid
group_slugstringStable slug of the assigned group, including operator-created groups.resale
group_labelstringOperator-facing label for the assigned group.Resale
group_billing_modepaid | subscriptionBilling mode, duplicated additively for group-aware clients.paid
requires_subscriptionbooleanTrue when the row's billing mode is subscription. A call needs an active plan that includes this model.false
context_windowstringProvider context notation. Treat it as informational.1M
input_price_per_1mnumberOur sell price in USD per 1M input tokens. Zero on an unpriced row.0.4
output_price_per_1mnumberOur sell price in USD per 1M output tokens. Upstream cost is never exposed.0.6
currency"usd"Currency for both sell prices.usd
supports_toolsbooleanWhether the model accepts tool definitions.true
supports_visionbooleanWhether the model accepts image content.true
healthstring | nullProvider-reported health label. Informational; routing still checks group and price.live

POST /v1/chat/completions

Send the model id and messages

Body fields follow the OpenAI chat-completions shape. The gateway substitutes the upstream model id, applies paid-call credit admission, and streams the provider response back.

FieldTypeMeaningExample
modelstringRequired. A public id from GET /v1/models.gpt-6.1-sol
messagesarrayRequired, non-empty. OpenAI-style objects with role and content.[{ role: "user", content: "Hello" }]
streambooleanOptional. When true the response is text/event-stream instead of JSON.false
max_tokensintegerOptional. The gateway defaults to 4,096 and rejects values above 65,536.512
max_completion_tokensintegerOptional. Takes precedence over max_tokens when both are present.512
toolsarrayOptional. Forwarded unchanged when the model supports tools.[…]
temperature, top_p, …protocol-specificForwarded or translated per protocol. The wire-field table below lists exactly which fields each path honours.0.7
Request
curl "$GATEWAY_URL/v1/chat/completions" \
  -H "Authorization: Bearer sk-..." \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-6.1-sol",
    "messages": [{ "role": "user", "content": "Hello" }],
    "max_tokens": 512,
    "stream": false
  }'
Response · example
{
  "id": "chatcmpl_...",
  "object": "chat.completion",
  "model": "gpt-6.1-sol",
  "choices": [
    {
      "index": 0,
      "message": { "role": "assistant", "content": "Hello." },
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 12,
    "completion_tokens": 2,
    "total_tokens": 14
  }
}

Set stream: true for text/event-stream. Frames use the OpenAI-style chunk shape and end with data: [DONE]. Usage is settled after the response or stream closes.

Wire-field support

What reaches the provider, per protocol

A model served over OpenAI chat receives the body essentially unchanged. A model served over Anthropic Messages is translated, and fields with no Anthropic equivalent are ignored rather than emulated.

FieldOpenAI chatAnthropic MessagesDetail
modelRewritten to the upstream idRewritten to the upstream idThe public id is a routing name and is never forwarded.
messagesForwardedTranslated to Anthropic content blocksText and tool calls translate. A remote http(s) image_url is dropped; only data: URLs become base64 image blocks.
system / developerForwarded unchangedJoined into the top-level system promptDeveloper messages are treated as system text on the Anthropic path.
max_tokens / max_completion_tokensForwarded; a default is pinned when absentMapped to max_tokensmax_completion_tokens wins when both are sent. Values above 65,536 are rejected before dispatch.
temperature, top_pForwardedForwardedOnly numeric values are forwarded on the Anthropic path.
stopForwardedMapped to stop_sequencesA single string becomes a one-entry sequence list.
tools, tool_choiceForwardedTranslatedFunction parameters become input_schema; required becomes any; a named function becomes a tool choice.
response_formatForwardedIgnoredAn Anthropic-served model returns prose even when a JSON response_format was requested.
seed, logprobs, top_logprobsForwardedIgnoredNo emulation is attempted; these fields never reach the provider.
n, frequency_penalty, presence_penaltyForwardedIgnoredOne completion is returned on the Anthropic path.
parallel_tool_calls, userForwardedIgnoredProvider-specific; check the upstream model before relying on it.
streamForwarded; include_usage is addedForwarded and translated back to OpenAI chunksBoth paths end with data: [DONE]; usage is settled after the stream closes.

Errors

Errors keep the OpenAI envelope

A failed request returns a non-2xx status and an error object with message, type, param, and code.

StatusTypeMeaning
400invalid_request_errorInvalid JSON, missing model, empty messages, or an over-limit output budget.
401authentication_errorMissing or invalid API key. Send Bearer or x-api-key.
402insufficient_quota | subscription_past_due | subscription_limit_reachedCredit cannot cover the request, the subscription is past due, or its included allowance is exhausted under a block policy.
403subscription_requiredThe model belongs to a subscription group and no active plan snapshot includes it.
404model_not_foundThe model id is not in the public catalog.
503model_unpriced | model_unavailableThe row has no sell price or is disabled upstream.
502upstream_errorThe provider failed or returned an invalid response.
Error · example
{
  "error": {
    "message": "Insufficient credit balance for this request.",
    "type": "insufficient_quota",
    "param": null,
    "code": null
  }
}

Ready to call the catalog?

Create an account for a key and prepaid credit, or browse the live model table before choosing a route.