API Reference
Base URL: https://api.nexotao.com. Authentication via API key — see
Authentication.
Endpoints
| Method | Path | Function |
|---|---|---|
GET | /models | Public pricing catalog for the site (no key) |
GET | /v1/models | OpenAI-format model list (requires key) — used by n8n etc. |
GET | /v1/models/{id} | Single model detail, OpenAI format (requires key) |
POST | /v1/chat/completions | Chat, OpenAI format (DeepSeek and Claude) |
POST | /v1/responses | OpenAI Responses format — supports streaming; used by Codex CLI |
POST | /v1/messages | Chat, Anthropic format (Claude models) |
Response headers
| Header | Meaning |
|---|---|
X-Request-Id | The request id for tracking. Present on every response, including streaming |
X-Cost-Rp | The actual cost of the request in Rupiah. Non-streaming responses only |
X-Error-Code | The code value from the error body. Error responses only |
On streaming (SSE) responses X-Cost-Rp is not sent — the cost isn’t known
when headers are flushed. Read the final figure from GET /usage/{request_id};
see Billing & Pricing.
Error codes
| Status | Meaning | Action |
|---|---|---|
400 | Invalid request | Check the body/parameters |
401 | Invalid or revoked API key | Create / use an active key |
402 | Insufficient balance | Top up your Rupiah balance |
413 | Request body too large | Compact the history or start a new session |
429 | Too many requests | Retry with backoff |
502 | Upstream unavailable | Retry with backoff |
Error body shape
Every error returns JSON in the same shape:
{
"error": "invalid api key",
"code": "auth.api_key_invalid",
"type": "api_key_invalid",
"request_id": "8997bda3-65c4-45c3-ab38-c909f905fc4d",
"retryable": false
}| Field | Type | Meaning |
|---|---|---|
error | string | Human-readable message. The wording can change — don’t branch on it |
code | string | Stable dotted identifier, e.g. auth.api_key_invalid. Branch on this |
type | string | The segment after the last dot of code (e.g. api_key_invalid). Legacy client compatibility |
request_id | string | The request id, identical to the X-Request-Id header. Include it when reporting an issue |
retryable | bool | true when retrying the same request is sensible (e.g. rate limits, upstream errors) |
hint | string | Optional. Present on some errors only, with actionable guidance |
Branch your code on code (or the X-Error-Code header), never on error. The
full code catalogue is on Error Codes.
GET /models
Returns the list of active models along with sell prices (no internal cost data). Used by the live pricing tables on the Billing and Models & Pricing pages.
curl https://api.nexotao.com/modelsEach item contains: model, display_name, tier, provider, supports_vision,
modality, and the *_micro price fields (micro-rupiah; 1 Rp = 1,000,000 micro).