API reference
All endpoints below are relative to https://arzarouter.arzastore.com/api — that is, https://arzarouter.arzastore.com/api/v1/….
Authentication
401 with an OpenAI-shaped error body.Authorization: Bearer sk-infer-...
Content-Type: application/jsonAccount and inference
| Method | Path | Purpose |
|---|---|---|
| POST | /v1/chat/completions | OpenAI-compatible completion; supports stream and tools/tool_calls |
| POST | /v1/responses | OpenAI Responses API — input in, output array out; translated onto the same upstream call |
| POST | /v1/messages | Anthropic-compatible messages API |
| GET | /v1/models | Model IDs this key may call |
| GET | /v1/me | Account profile and balance |
| GET | /v1/balance | Balance, mirrored from the router meter |
| GET | /v1/usage | Recent usage records |
| GET | /v1/usage/by-model | Usage grouped by model |
| POST | /v1/keys | Create an API key (returned once) |
| GET | /v1/keys | List keys by prefix |
| DELETE | /v1/keys/:id | Revoke a key |
| POST | /v1/providers | Attach an upstream account |
| GET | /v1/providers | List attached upstreams |
| DELETE | /v1/providers/:id | Remove an upstream |
| POST | /v1/deposits | Register a deposit |
| GET | /v1/deposits/address | Your unique Solana deposit address |
| GET | /v1/deposits | Deposit history |
| GET | /v1/budgets | Your spend caps ($/Mtok), with the listed price of each target |
| PUT | /v1/budgets | Create or update a cap (model, api_key_id, max_input_price, max_output_price) |
| DELETE | /v1/budgets/:id | Remove a cap |
MCP server
One sk-infer- key also authenticates an MCP server, so an agent can read and change account state without bespoke HTTP glue. Two transports: SSE (/mcp/sse then POST /mcp/messages?sessionId=…) and streamable HTTP (POST /mcp).
claude mcp add --transport sse arzarouter \
https://arzarouter.arzastore.com/mcp/sse \
--header "Authorization: Bearer sk-infer-..."
# then ask: "list my arzarouter models" / "what is my balance?"| Tool | Purpose |
|---|---|
list_models | Model ids with published $/Mtok pricing |
get_balance | Credit units, USDC equivalent, deposit rate |
list_api_keys | Keys by prefix (never the secret) |
create_api_key | Mint a key — secret returned once |
list_budgets | Spend caps by account, key or model |
set_budget | Create or update a cap |
usage_by_model | Token usage grouped by model |
list_deposits | Deposit history with status and signature |
get_deposit_address | Unique Solana USDC deposit address |
chat_completion | Run one completion, billed and metered |
Management API
The same resources are reachable under /api/<name>, matching the paths other ArzaRouter deployments document. One key authenticates both surfaces.
| Method | Path | Purpose |
|---|---|---|
| GET | /api/keys | List keys by prefix |
| POST | /api/keys | Create a key (returned once) |
| GET | /api/me | Profile and balance |
| GET | /api/usage/logs | Recent usage records |
| GET | /api/catalog | Models with pricing, as this key sees them |
| GET | /api/market | Pool health counts and per-model availability |
| GET | /api/budgets | Your spend caps |
| PUT | /api/budgets | Create or update a cap |
| GET | /api/publisher/providers | Upstream accounts attached to your user |
| POST | /api/publisher/providers | Attach an encrypted upstream key |
| GET | /api/publisher/pool | Your attached capacity (earnings null — payouts not enabled) |
| GET | /api/deposit-address | Your unique Solana deposit address |
| GET | /api/topups | Deposit history |
| POST | /api/topups | Register a deposit |
Public feeds
No key required. Every number is read from this deployment's own ledger; a metric we do not measure is returned as null with a note, never as a zero.
| Method | Path | Purpose |
|---|---|---|
| GET | /api/market-ticker | SSE stream of per-model asks and last settled rate |
| GET | /api/pricing/cache | 24h per-model prompt-cache window (cached tokens null) |
| GET | /api/pricing/usage | 24h per-model requests and tokens |
| GET | /api/status/models | Per-model availability and latency (TTFT null) |
Public (no key)
| Method | Path | Purpose |
|---|---|---|
| GET | /v1/prices | Published per-Mtok prices for every sellable model (no auth) |
| GET | /v1/combos | Combo failover groups — call any of them as combo/<slug> (no auth) |
| GET | /v1/pricing | Published rate card (no auth) |
| GET | /v1/stats | Aggregate platform usage (no auth) |
| GET | /health | Liveness plus upstream reachability (no auth) |
Serving model
ArzaRouter answers from its own upstream pool — it does not proxy another gateway. The catalog it can serve is what GET /v1/models returns, and each model carries the published price it is metered at. Requests are metered on ArzaRouter's own ledger: tokens in/out are weighted per model and deducted from your balance after each call.
A request that names a model outside the catalog is refused with 400 MODEL_UNKNOWN. Pool capacity is rotated automatically: a rate-limited or unhealthy credential is cooled down and the next one serves the call, so 429 from one upstream account is not surfaced to you unless every attempt fails.
Admin (pool operations)
These need the admin header x-inferhub-admin and are not part of the consumer API.
| Method | Path | Purpose |
|---|---|---|
| GET | /admin/pool | Pool rows + health summary + catalog |
| POST | /admin/pool/import | Import credentials — {"dir":"/path"} or {"tokens":"…"} |
| POST | /admin/pool/probe | Health-probe one row ({"id":N}) or a batch |
| PUT | /admin/pool/models | Upsert a catalog entry (model, upstream id, cost weights, active) |
Errors
400 malformed request or unknown model · 401 missing or invalid key · 402 insufficient balance, BID_EXCEEDED (priced above your cap), or PRICE_UNKNOWN (a cap is set for a model with no published price) · 404 unknown route · 502 upstream unreachable. Bodies are JSON with an error object carrying message and type.Getting-started walkthrough: /docs.