API v2 · updated today

Documentation

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

ParameterTypeDefaultDescription
modelstringModel id, e.g. nexus-1-pro
inputstring | Message[]Prompt or full conversation
temperaturenumber0.70 = deterministic, 1 = creative
max_tokensinteger1024Hard ceiling on the completion
toolsTool[][]Functions the agent may call
streambooleanfalseEmit 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

StatusCodeMeaning
400invalid_requestMalformed body or unknown parameter
401invalid_api_keyMissing, revoked, or mistyped key
404model_not_foundThe model id does not exist on your plan
429rate_limitedRPM or TPM ceiling reached
503capacityRegion saturated, retry with backoff
Demo · dados fictíciosVoltar ao portfólio