Create Response
Create a model response, in OpenAI's Responses format. **Routing modes**, controlled by the `agent` field, exactly as on `/v1/chat/completions`: - **Gateway mode** (`agent` omitted): a 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`, run the `function_call` output items you get back, and send each result as a `function_call_output` input item, with the conversation resent in `input`. A tool loop is not stored, so `store` and `previous_response_id` are refused on one. - **Orchestrator mode** (`agent: "asteria"`): the full Asteria agent, with RAG, web search, code execution and sub-agents. Its tools are ours, so client tools and function items are refused. - **Custom agent mode** (`agent: "<slug>"`): a shared custom agent by slug. **Which model**: send `model: "default"` to use the organization's default chat model and its fallback chain. Pinning a real model id is brittle, since an org admin can remove it later. **`store` defaults to off, and OpenAI's defaults it on.** That inversion is the one thing to know before chaining. An unstored call retains nothing, so a chain built on it has nothing to continue from. `store: true` keeps the response and its history: fetch it back with `GET /v1/responses/{id}`, erase it with `DELETE /v1/responses/{id}`, and it expires on its own after the retention window (30 days by default, configurable per project and per organization). An organization can also disable storage outright, in which case `store: true` is overridden: the response comes back with `store: false` and an `X-Asteria-Warning` header saying so. **`previous_response_id` continues a stored response.** Its history is replayed for you, so send only what is new in `input`. The new turn joins the same conversation, which is what lets a chain keep one scratchpad and one sandbox workspace across turns, and the whole chain's retention runs from its most recent turn rather than its first. An id that names no stored response is a `404` that says so and names `store: true`, never an empty chain answered with a `200`. Streaming is not available here yet; `/v1/chat/completions` streams today. **Storing changes which tools the run has.** A stored call has a conversation, so the tools that need one are offered: `scratchpad_*`, `measure_*` and the background sandbox verbs. An unstored call has none of them, though `sandbox_run` still answers inside the turn either way. `add_to_user_bio` and `search_past_conversations` are never available on this surface, which has no signed-in user. **Non-standard parameters need `extra_body`.** `agent`, `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.responses.create( model="default", input="Hello", extra_body={"agent": "asteria"}, ) ```
ApiKeyAuthorization<token>Your API key (sk-ast-...)
application/json- body
Request body for POST /v1/responses.
Every class docstring and description= in this request's schema is
published: it reaches the OpenAPI spec and docs-site renders it into a
public page, where check-content.mjs bans the em dash. Comments beside
them are ours and are not published; the two are a line apart and only one
is a CI gate.
model?|LLM model ID, or "default" for the organization's default chat model and its fallback chain. Pinning a real model id is brittle: an org admin can later remove it, breaking your calls.
input*|array<||>A string, or an array of input items: messages, and in gateway mode the function_call and function_call_output items of a tool loop
tools?array<>|Functions the model may call, in gateway mode. Its calls come back as function_call output items for your code to run; send each result back as a function_call_output input item. Only function tools are supported. Refused in agent mode, where the agent's tools are ours.
tool_choice?||auto, none, required, or one named function. Gateway mode only.
instructions?|System-level instructions. Ignored in agent mode, where the agent defines its own system prompt (see X-Asteria-Warning).
stream?StreamEnable server-sent events streaming
falsemax_output_tokens?|nulltemperature?|nulltop_p?|nulltext?|nullstore?|Store the response and its history for later retrieval by id. Defaults to false. Kept for the project's retention window (30 days by default).
previous_response_id?|Continue a previous response, by id. That response must have been created with store: true, which is not the default here.
reasoning?|Reasoning configuration. Only effort is supported.
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}.
truecollection_uuid?|Document collection UUID for RAG queries. Non-standard: send via extra_body={'collection_uuid': ...}.
A response object
response?unknownapplication/jsoncurl -X POST 'https://api.asteria-labs.com/v1/responses' \ -H 'Content-Type: application/json' \ -d '{ "input": "string"}'nullList Agents
List available agents for the caller's organization. Returns the built-in Asteria orchestrator plus any shared custom agents that have a slug. The `id` field in each entry is the slug to pass as `agent` in POST /v1/chat/completions.
Retrieve Response
Retrieve a stored response by id. Only responses created with `store: true` exist to be fetched, and only until they expire (30 days by default, configurable per project). The read is scoped to the organisation that owns the response: there is no signed-in user on `/v1`, so the organisation is the only principal a scope can be built from. **What comes back is the response, not the request.** `output`, `status`, `model` and `usage` are stored facts about the turn and are returned verbatim. The parameters the create call echoed back (`instructions`, `temperature`, `top_p`, `max_output_tokens`, `text`) are the caller's own request and are not stored, so they come back null here. If you need them alongside the output, keep them where you keep the id.