Quickstart
Create a key in your account, make sure your API balance is above zero, then send a request.
curl https://aggregat.xyz/api/v1/chat/completions \ -H "Authorization: Bearer sk-aggr-…" \ -H "Content-Type: application/json" \ -d '{ "model": "anthropic/claude-sonnet-4.5", "messages": [{"role": "user", "content": "Hello"}] }'Base URL
Every endpoint below is relative to this URL. It is a drop-in replacement for the OpenAI and OpenRouter base URLs.
https://aggregat.xyz/api/v1Authentication
Send your key as a bearer token. Keys start with sk-aggr- and are shown once at creation; we store only a hash.
Authorization: Bearer sk-aggr-…Endpoints
OpenAI-compatible request and response bodies. The Anthropic Messages route accepts the Anthropic shape unchanged.
Streaming
Set stream: true. Server-sent events pass through untouched, chunk for chunk. Usage and cost arrive on the final chunk, and your balance is charged once the stream ends.
const stream = await client.chat.completions.create({ model: "anthropic/claude-sonnet-4.5", messages: [{ role: "user", content: "Write a haiku about latency." }], stream: true,}); for await (const chunk of stream) { process.stdout.write(chunk.choices[0]?.delta?.content ?? "");}Response headers
Every response carries its own receipt.
Errors
Errors use standard HTTP status codes and an error object with a code and a human-readable message. Failed upstream calls are never charged.
Model naming
Model ids follow the provider/model convention used by OpenRouter, so existing ids work as they are. Call GET /models for the live list with pricing.
Per-key limits
Give each key a USD spending cap when you create it. Once a key has spent its limit, it returns 403 key_limit_reached while your other keys keep working. All keys draw on one account balance, so a key can never spend more than the balance either.
Zero data retention
Prompts and completions stream through memory and are never written to disk, logs or analytics. We keep what billing needs: key, model, token counts, cost and latency. Requests go upstream with the provider's own data-retention controls applied.