API Reference
Endpoints, parameters, and response shapes.
The REST API is versioned in the path and served from api.nexus-ai.dev. All request and response bodies are JSON; all timestamps are RFC 3339 UTC.
POST /v2/runs
| Parameter | Type | Default | Description |
|---|---|---|---|
| model | string | — | Model id, e.g. nexus-1-pro |
| input | string | Message[] | — | Prompt or full conversation |
| temperature | number | 0.7 | 0 = deterministic, 1 = creative |
| max_tokens | integer | 1024 | Hard ceiling on the completion |
| tools | Tool[] | [] | Functions the agent may call |
| stream | boolean | false | Emit SSE deltas instead of a single body |
Run object
JSON
{
"id": "run_8f2c1ad9",
"object": "run",
"model": "nexus-1-pro",
"status": "completed",
"output_text": "Weekly active users grew 12.4% ...",
"usage": { "input_tokens": 84, "output_tokens": 512, "latency_ms": 940 },
"created_at": "2024-11-04T17:02:11Z"
}Errors
| Status | Code | Meaning |
|---|---|---|
| 400 | invalid_request | Malformed body or unknown parameter |
| 401 | invalid_api_key | Missing, revoked, or mistyped key |
| 404 | model_not_found | The model id does not exist on your plan |
| 429 | rate_limited | RPM or TPM ceiling reached |
| 503 | capacity | Region saturated, retry with backoff |