API Reference

API Reference

Base URL: https://api.nexotao.com. Authentication via API key — see Authentication.

Endpoints

MethodPathFunction
GET/modelsPublic pricing catalog for the site (no key)
GET/v1/modelsOpenAI-format model list (requires key) — used by n8n etc.
GET/v1/models/{id}Single model detail, OpenAI format (requires key)
POST/v1/chat/completionsChat, OpenAI format (DeepSeek and Claude)
POST/v1/responsesOpenAI Responses format — supports streaming; used by Codex CLI
POST/v1/messagesChat, Anthropic format (Claude models)

Response headers

HeaderMeaning
X-Request-IdThe request id for tracking. Present on every response, including streaming
X-Cost-RpThe actual cost of the request in Rupiah. Non-streaming responses only
X-Error-CodeThe 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

StatusMeaningAction
400Invalid requestCheck the body/parameters
401Invalid or revoked API keyCreate / use an active key
402Insufficient balanceTop up your Rupiah balance
413Request body too largeCompact the history or start a new session
429Too many requestsRetry with backoff
502Upstream unavailableRetry 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
}
FieldTypeMeaning
errorstringHuman-readable message. The wording can change — don’t branch on it
codestringStable dotted identifier, e.g. auth.api_key_invalid. Branch on this
typestringThe segment after the last dot of code (e.g. api_key_invalid). Legacy client compatibility
request_idstringThe request id, identical to the X-Request-Id header. Include it when reporting an issue
retryablebooltrue when retrying the same request is sensible (e.g. rate limits, upstream errors)
hintstringOptional. 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/models

Each item contains: model, display_name, tier, provider, supports_vision, modality, and the *_micro price fields (micro-rupiah; 1 Rp = 1,000,000 micro).