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 and none of our tools. Rate limiting and budget enforcement still apply. Your own function tools work here: send `tools` (and optionally `tool_choice`), run the `message.tool_calls` you get back, and send each result as a `role: "tool"` message. Any agent framework that speaks Chat Completions works this way. - **Orchestrator mode** (`agent: "asteria"`): full Asteria agent with RAG, web search, code execution, and sub-agents. Its tools are ours, so a non-empty `tools`, a forcing `tool_choice`, and tool messages are refused. - **Custom agent mode** (`agent: "<slug>"`): invoke a shared custom agent by slug. The agent's system prompt and tools are applied. **Which model**: send `model: "default"` to use the organization's default chat model and its fallback chain, which is the robust choice, because a pinned model id can be removed by an org admin later and start returning `400`. Omitting the field entirely does the same thing, but most OpenAI-compatible clients cannot omit it, so `"default"` is the reachable form (GH #1329). **This endpoint is stateless.** Nothing is retained between calls, exactly as with OpenAI Chat Completions: send the conversation back in `messages`. State lives in `POST /v1/responses`. A `store` parameter is accepted for compatibility and does nothing. It creates no thread, and it does not retain the completion either, since there is no `GET /v1/chat/completions/{id}` to read one back from. Setting it is harmless, but keep your own copy of the response. The one exception is `thread_id`, an Asteria extension: pass one returned by an earlier call and the request runs inside that conversation, which is what the conversation-scoped tools need. Without it the orchestrator simply does not offer them, rather than offering tools that would refuse: - `scratchpad_*` and `measure_*`, which are keyed on a conversation. - `sandbox_start` / `sandbox_check` / `sandbox_stop`. A background job is delivered into a conversation after the turn ends. `sandbox_run` answers inside the turn and is always available. - `add_to_user_bio` and `search_past_conversations`. An API key is an organisation, not a person, so these are never available here. Everything else works either way, including the sandbox workspace: files that `fetch_url` or `crawl_site` bring in are visible to `sandbox_run` within the same request. Without a `thread_id` that workspace is discarded when the response completes, so nothing carries to the next call. **Non-standard parameters need `extra_body`.** `agent`, `thread_id`, `collection_uuid`, `enable_fallback` and `include_org_context` are ours, and an OpenAI SDK builds typed request params, so passing one as a keyword is a client-side `TypeError` that never reaches us. In `openai-python`: ```python client.chat.completions.create( model="default", messages=[{"role": "user", "content": "Hello"}], extra_body={"agent": "asteria", "thread_id": thread_id}, ) ```
ApiKeyAuthorization<token>Your API key (sk-ast-...)
application/json- body
Request body for /v1/chat/completions.
model?|LLM model ID (e.g. 'claude-opus-4-6'), or "default" for the organization's default chat model and its fallback chain. Omitting the field does the same thing, but most OpenAI-compatible clients cannot omit it. Pinning a real model id is brittle: an org admin can later remove it, breaking your calls.
agent?|Agent slug or 'asteria'. Omit for gateway mode. Non-standard: send via extra_body={'agent': 'asteria'}.
enable_fallback?Enable FallbackOpt-in fallback chain if primary model fails. Non-standard: send via extra_body={'enable_fallback': true}.
falseinclude_org_context?Include Org ContextAgent mode only: give the agent your organization's system instructions and context, as in the web app. Set false to send neither. Ignored in gateway mode. Non-standard: send via extra_body={'include_org_context': false}.
truemessages*array<>List of messages in the conversation
1 <= items <= 200stream?StreamEnable server-sent events streaming
falsemax_tokens?|Maximum tokens to generate
temperature?|Sampling temperature (0 = deterministic, 2 = creative)
top_p?|Nucleus sampling threshold
frequency_penalty?|Accepted for compatibility, not used
presence_penalty?|Accepted for compatibility, not used
stop?|array<string>|Stop sequence or sequences. Applied across all provider families; a single string is normalized to one sequence.
store?|Accepted for compatibility, not used
reasoning_effort?|How much the model reasons before answering. Omit it to use the level your organization set for the model. Overrides temperature on Anthropic models.
tools?array<>|Functions the model may call, in gateway mode. The model's calls come back in message.tool_calls for your code to run; send each result back as a role: tool message. Refused in agent mode, where the agent's tools are ours.
tool_choice?||auto, none, required, or one named function. Gateway mode only.
collection_uuid?|Document collection UUID for RAG queries. Non-standard: send via extra_body={'collection_uuid': ...}.
thread_id?|Resume an existing conversation created by this API. Chat Completions is otherwise stateless: omit this and no conversation is created, which is the drop-in behaviour. Tools that need a conversation (scratchpad, measures, background sandbox jobs) are unavailable without it. Non-standard: send via extra_body={'thread_id': ...}.
Chat completion response (non-streaming)
application/json- response
Response for non-streaming /v1/chat/completions.
id?Idobject?Object"chat.completion"created?Createdmodel?Model"asteria"choices*array<>usage?Token usage statistics.
thread_id?string|nullcurl -X POST 'https://api.asteria-labs.com/v1/chat/completions' \ -H 'Content-Type: application/json' \ -d '{ "messages": [ { "role": "system" } ]}'{ "id": "string", "object": "chat.completion", "created": 0, "model": "asteria", "choices": [ { "index": 0, "message": { "role": "system", "content": "string", "name": "string", "tool_calls": [ { "id": "string", "type": "function", "function": { "name": "string", "arguments": "" } } ], "tool_call_id": "string" }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 0, "completion_tokens": 0, "total_tokens": 0 }, "thread_id": "string"}Extensions
The non-standard fields Asteria Cloud adds to the OpenAI and Anthropic APIs, and how to send them through the official SDKs.
List Models
List models available to this project. Returns org-enabled models intersected with the project allow-list (if set). Follows Anthropic's model list shape: {data, first_id, last_id, has_more}. Does not include 'asteria' or agent slugs. Use GET /v1/agents for those.