Quickstart
Two changes to existing OpenAI code, and you’re running.
1. Get a key
- Create an account — you get $1 of credit, no card required.
- Go to
Dashboard → API keysand create one. The full key is shown once; we store only a hash of it and genuinely cannot recover it later. - Export it:
export INFERSIA_API_KEY=isk-v1-…
2. Point your client at us
Python
chat.pypython
from openai import OpenAI
import os
client = OpenAI(
base_url="https://api.infersia.com/v1",
api_key=os.environ["INFERSIA_API_KEY"],
)
response = client.chat.completions.create(
model="qwen/qwen3-8b",
messages=[{"role": "user", "content": "Explain KV caching in two sentences."}],
)
print(response.choices[0].message.content)
print(f"Cost: ${response.usage.cost:.8f}")TypeScript
chat.tstypescript
import OpenAI from 'openai';
const client = new OpenAI({
baseURL: 'https://api.infersia.com/v1',
apiKey: process.env.INFERSIA_API_KEY,
});
const stream = await client.chat.completions.create({
model: 'qwen/qwen3-8b',
messages: [{ role: 'user', content: 'Explain KV caching.' }],
stream: true,
});
for await (const chunk of stream) {
process.stdout.write(chunk.choices[0]?.delta?.content ?? '');
}curl
curlbash
curl https://api.infersia.com/v1/chat/completions \
-H "Authorization: Bearer $INFERSIA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "qwen/qwen3-8b",
"messages": [{"role": "user", "content": "Hello"}],
"stream": true
}'3. Check what you got
Every response carries headers describing exactly what served it. This is the part that’s hard to get from most providers:
response headershttp
x-request-id: isr_01KYGHW7S1GTR2AVE40C
x-infersia-provider: infersia
x-infersia-quantization: awq-int4
x-infersia-cost-usd: 0.000001950
x-ratelimit-remaining-requests: 199
x-ratelimit-remaining-tokens: 399987You can assert on x-infersia-quantization in your own test suite. If we ever change the precision behind a model you depend on, your tests catch it — you don’t have to take a page on our website at its word.
Requests are billed from the inference engine’s own token counts, not from a tokeniser we run separately. Your invoice and the
usage object in your response are the same number.Next
Read about model routing to pin a provider or use the free tier, errors and limits to handle 429s and 402s correctly, or the integration guides if you’re wiring up a coding tool rather than writing code directly.