Quickstart
Change two lines: the base URL and the key. Any OpenAI-compatible SDK, framework or plain HTTP works with every model in the catalog.
- Sign in and add funds (card, or USDC on Solana).
- Create an API key in your dashboard. It is shown once.
- Point your SDK at the base URL below and pick any model id from the catalog.
environment
OPENAI_BASE_URL=https://xavainf.com/v1 OPENAI_API_KEY=xk_live_...
Life of a request
- KEYYour app sends the request with its API key. We check the key (we keep only a keyed hash of it) and its limit: 600 requests a minute.
- HOLDAn estimate is set aside from your balance: the prompt's bytes ÷ 4, plus 20%, as input tokens, and max_tokens (4,096 if you leave it out) as output, at list price.
- ENOUGH?Too little available: 402 insufficient_balance, and nothing runs.
- MODELThe model runs. A failed attempt is retried once before the first byte (media never is).
- STREAMThe answer streams back as it is made. A started stream is never switched mid-way.
- METEREDThe tokens actually used are priced at the provider's list price, the same for everyone.
- SETTLEDThe hold is released and the price charged once, expiring credits first. 0.5% of it buys back your token (up to 5% at Elite).
python
from openai import OpenAI
client = OpenAI(
base_url="https://xavainf.com/v1",
api_key="xk_live_...", # your Xava Inference key
)
r = client.chat.completions.create(
model="openai/gpt-5.4",
messages=[{"role": "user", "content": "Hello!"}],
)
print(r.choices[0].message.content)typescript
import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://xavainf.com/v1",
apiKey: process.env.XINF_API_KEY,
});
const stream = await client.chat.completions.create({
model: "anthropic/claude-sonnet-5",
messages: [{ role: "user", content: "Hello!" }],
stream: true,
});
for await (const chunk of stream) process.stdout.write(chunk.choices[0]?.delta?.content ?? "");curl
curl https://xavainf.com/v1/chat/completions \
-H "Authorization: Bearer $XINF_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"openai/gpt-5.4","messages":[{"role":"user","content":"Hello!"}]}'Privacy. We never store your prompts or the model's replies, only billing details (model, amount, time). On models marked ZDR supported, the model provider keeps nothing either; on other models, the provider's own policy applies. Privacy policy.
Generated files. Images, video and audio are served from this origin and deleted 24 hours after creation (expires_at on every response; an expired URL answers 410). Download what you want to keep. Details.