Asteria Docs
Chat & Discovery

Chat Completions

OpenAI-compatible chat completions endpoint. Supports both streaming (SSE) and non-streaming responses. **Routing modes** — controlled by the `model` + `agent` fields: - **Gateway mode** (`agent` omitted): pure LLM proxy, no system prompt, no tools. Rate limiting and budget enforcement still apply. - **Orchestrator mode** (`agent: "asteria"`): full Asteria agent with RAG, web search, code execution, and sub-agents. - **Custom agent mode** (`agent: "<slug>"`): invoke a shared custom agent by slug. The agent's system prompt and tools are applied.

POST
/v1/chat/completions
Authorization<token>

Your API key (sk-ast-...)

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

curl -X POST "https://api.asteria-labs.com/v1/chat/completions" \  -H "Content-Type: application/json" \  -d '{    "messages": [      {        "role": "system",        "content": "string"      }    ]  }'
{
  "id": "string",
  "object": "chat.completion",
  "created": 0,
  "model": "asteria",
  "choices": [
    null
  ],
  "usage": null,
  "thread_id": "string"
}
{
  "error": null
}
{
  "error": null
}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string"
    }
  ]
}