Newcomer guide
Your first request, without the folklore.
You do not need to learn a new API to use the gateway. Create one account, pick a model by its billing group, and send an OpenAI-shaped request. This page is the shortest path from zero to a real response.
The short version
Savant Gateway is one OpenAI-compatible endpoint over several model families. You bring an account key; the gateway resolves the public model id to its provider, applies the billing group, and settles the call. You do not manage upstream provider accounts or credentials. Available families can include OpenAI GPT and Anthropic Claude: choose a current model id from the live catalog and use the same request format.
- One account and one balance across the catalog.
- One key shape:
Bearerorx-api-key. - OpenAI-compatible Chat Completions for models across families; native provider APIs are not exposed.
1. Create an account and a key
Sign up, accept the current policies, then open your account page. Create a key there. The full secret is shown once; only its hash is stored after that. Keys are account-scoped, so a key from one account cannot read or revoke another account's key.
2. Pick a model by billing group
Open the live catalog at /models, or call GET /v1/models. Every row carries a group and sell prices for input and output tokens. Read the group before you budget.
Paid
Debits prepaid credit at the listed sell price after the request settles. A hold is reserved before dispatch.
Subscription
Covered by a purchased plan snapshot. Plans are not on sale during this launch; an existing comped plan still works.
A paid row with no sell price is unavailable, not free. A model that vanished upstream is delisted from the public catalog instead of being deleted, so its history stays intact.
3. Send the request
For a local checkout, GATEWAY_URL is http://localhost:3000. For a hosted deployment, use its public origin without a trailing slash. Set SAVANT_API_KEY to the key you created. Read the model list first; the examples deliberately use a placeholder id.
export GATEWAY_URL="http://localhost:3000"
export SAVANT_API_KEY="sk-..."curl "$GATEWAY_URL/v1/models" \
-H "Authorization: Bearer $SAVANT_API_KEY"curl "$GATEWAY_URL/v1/chat/completions" \
-H "Authorization: Bearer $SAVANT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "YOUR_MODEL_ID",
"messages": [{ "role": "user", "content": "Hello from my first call." }],
"max_tokens": 256
}'from openai import OpenAI
import os
client = OpenAI(
base_url=f"{os.environ['GATEWAY_URL']}/v1",
api_key=os.environ["SAVANT_API_KEY"],
)
response = client.chat.completions.create(
model="YOUR_MODEL_ID",
messages=[{"role": "user", "content": "Hello"}],
max_tokens=256,
)
print(response.choices[0].message.content)import OpenAI from "openai";
const client = new OpenAI({
baseURL: `${process.env.GATEWAY_URL}/v1`,
apiKey: process.env.SAVANT_API_KEY,
});
async function main() {
const stream = await client.chat.completions.create({
model: "YOUR_MODEL_ID",
messages: [{ role: "user", content: "Hello" }],
max_tokens: 256,
stream: true,
});
for await (const chunk of stream) {
process.stdout.write(chunk.choices[0]?.delta?.content ?? "");
}
}
main();The SDK examples require the OpenAI client ( pip install openai or npm install openai). Both set the base URL to the gateway origin plus /v1. The JavaScript example streams chunks; omit stream: true to await one JSON response. Server-sent events end with data: [DONE].
4. Understand what the first call costs
A paid call reserves an estimated hold before dispatch. Settlement releases the hold and debits the actual charge. Available credit is the balance minus holds, so it can be lower than the balance while calls are in flight.
A hold is admission control, not a ceiling. If the provider reports more usage than the estimate, the debit can push the balance below zero; the next paid call is refused with 402 until the account is funded. The account page shows the balance, usage rows and ledger rather than a single inferred number.
5. If the first call fails
| Status | Usually means | What to try |
|---|---|---|
| 401 | Missing or invalid API key. | Send Bearer or x-api-key with an active account key. |
| 402 | Credit or allowance cannot cover the request. | Check your credit balance and plan allowance on the account page. |
| 403 | The model needs a subscription that includes it. | Choose a usage-based model or a model your plan includes. |
| 404 | The model id is not in the public catalog. | Call /v1/models and use an id from that response. |
| 429 | A rate limit is active. | Check the Retry-After header before retrying. |
| 502 | The upstream provider failed or returned an invalid response. | Retry, or choose another model. There is no automatic failover. |
| 503 | The model or gateway is unavailable. | Read the error type, then retry or choose another row. |
The API reference lists the full error envelope, and the FAQ covers the questions that usually come before the first request.