Quickstart
Create a key, choose a model and make your first request. You can use an OpenAI SDK or call the API over HTTP.
On this page
1. Get access
Create an account, add funds in Billing, then create a key in API keys. Copy the full key when it appears; it is shown once. Use a separate key for each application.
export XINF_API_KEY="xk_live_REPLACE_WITH_YOUR_KEY"
2. Send a request
Choose a text model from the catalog. This example uses Chat Completions; models marked Responses require /v1/responses. Keep the key and endpoint on the same site.
curl --fail-with-body "https://xavainf.com/v1/chat/completions" \
-H "Authorization: Bearer $XINF_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"anthropic/claude-sonnet-5","messages":[{"role":"user","content":"Say hello."}],"max_tokens":128}'A successful response contains choices[0].message.content and token counts in usage. A 401 means the key was rejected; 402 means the balance or spending limit needs attention. See errors and retries for other responses.
3. Use an SDK
Install the OpenAI client with pip install openai for Python or npm install openai for Node.js. Set the base URL explicitly and read the key from the environment.
import os
from openai import OpenAI
client = OpenAI(
base_url="https://xavainf.com/v1",
api_key=os.environ["XINF_API_KEY"],
)
r = client.chat.completions.create(
model="openai/gpt-5.4",
messages=[{"role": "user", "content": "Hello!"}],
)
print(r.choices[0].message.content)import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://xavainf.com/v1",
apiKey: process.env.XINF_API_KEY,
});
const result = await client.chat.completions.create({
model: "anthropic/claude-sonnet-5",
messages: [{ role: "user", content: "Say hello." }],
max_tokens: 128,
});
console.log(result.choices[0]?.message.content);Continue building
| I want to… | Read next |
|---|---|
| Run my coding agent on this API | Codex & Claude Code |
| Stream text or call another request format | API reference |
| Add model and media tools to an agent | Plugins or MCP |
| Check costs and request history | Billing & usage |
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 are deleted 24 hours after creation; download them before they expire.