API reference
Endpoints, authentication, streaming, tool calling, reasoning, caching, and regions.
The API exposes three surfaces from the same host, authenticated with the same per-user API keys: Chat Completions, the Responses API, and the Messages API.
| API | Base URL | Endpoint |
|---|---|---|
| Chat Completions | https://zro.moonmath.ai/v1 | POST /chat/completions |
| Responses | https://zro.moonmath.ai/v1 | POST /responses |
| Messages | https://zro.moonmath.ai | POST /v1/messages |
Authentication
Create an API key from the API keys page and send it as a bearer token:
Keys are scoped to an invoice-able account, carry optional spend limits and expiry, and select which regions may process their requests. They can be created, revoked, and inspected at any time from the API keys page. See Key controls and Regions.
Endpoints
| Method | Path | Description |
|---|---|---|
GET | /v1/models | List the models available to the key. |
POST | /v1/chat/completions | Chat Completions API. |
POST | /v1/responses | Responses API. |
POST | /v1/messages | Messages API. |
Chat completions
Streaming
Set stream: true to receive server-sent events. All models stream, and usage
is included in the final chunk.
Responses API
The Responses API is available at POST /v1/responses for clients built for it
(for example Codex). It takes input instead of messages:
Messages API
Claude Code and other Messages clients point at the endpoint root (not
/v1).
Tool calling
The standard tools / tool_choice interface and the full tool-call loop are
supported. This is what lets coding agents run shell commands, edit files, and
call MCP tools.
Reasoning
Reasoning models accept an effort control, shaped per API:
| API | Field |
|---|---|
| Chat Completions | reasoning_effort, reasoning, or thinking |
| Responses | reasoning |
| Messages | thinking, or output_config.effort |
On Chat Completions, when more than one is sent, precedence is
reasoning_effort > reasoning > thinking.
The reasoning object accepts {"effort": "<level>"} or the boolean toggle
{"enabled": true|false}. The supported levels differ per model. See the
reasoning chips on the Models page. Unrecognized reasoning
fields are ignored rather than rejected.
Errors
Errors follow the standard error shape ({ "error": { "message", "type", ... } }).
| Status | Meaning |
|---|---|
400 | Malformed request or unsupported parameter value. |
401 | Missing, invalid, revoked, or expired API key. |
403 | Key is not permitted to use the requested model. |
402 | Spend quota or plan budget exhausted. |
404 | Unknown model ID. |
429 | Rate limit exceeded. Retry with backoff. |
5xx | Upstream/model error. Retry with backoff; if it persists, contact support. |
Compatibility notes
- Standard request fields (
temperature,top_p,max_tokens,frequency_penalty,presence_penalty,stop,seed) are accepted. - Unsupported provider parameters are dropped instead of erroring. Clients built for other providers keep working.
- Both the bare model ID and its
zro/alias are accepted on every endpoint.