API reference
The API follows the OpenAI Chat Completions format. Base URL: https://api.azet.io/v1
Authentication
Send your key as a bearer token: Authorization: Bearer azk_…. Keys start with azk_. We store only a hash of your key, so we cannot show it again — keep it safe. Lost or leaked key: email hello@azet.io and we move your balance to a new key.
Endpoints
GET /v1/models
Lists available models with context length and price per 1M tokens (pricing.input_usd_per_1m, pricing.output_usd_per_1m).
POST /v1/chat/completions
Body as in OpenAI: model, messages, and the usual options (max_tokens, temperature, top_p, stop, tools where the model supports them). Set "stream": true for server-sent events; the final chunk carries usage.
curl https://api.azet.io/v1/chat/completions -H "Authorization: Bearer $AZET_API_KEY" -H "Content-Type: application/json" \
-d '{"model": "zai-org/GLM-5.3-Flash", "stream": true, "messages": [{"role": "user", "content": "Write a haiku"}]}'
GET /v1/balance
Returns your remaining credit: {"balance_usd": 12.345678}.
Billing
Each request costs prompt_tokens × input price + completion_tokens × output price, using the usage the model returns. Credit is kept to six decimal places (micro-USD). When credit reaches zero, requests return 402 until you add credit.
Errors
| Status | Type | Meaning |
|---|---|---|
| 400 | invalid_request_error | Body is not valid JSON |
| 401 | authentication_error | Missing or unknown API key |
| 402 | insufficient_quota | No credit left |
| 404 | invalid_request_error | Unknown model — see GET /v1/models |
| 429 | api_error | Model is busy — retry with backoff |
| 502 | api_error | The model provider returned an error |
AI-generated content
Responses carry the header x-ai-generated: true. If you publish model output, label it as AI-generated where the law of your users requires it (see Terms §4).