Documentation Index
Fetch the complete documentation index at: https://agent37.com/docs/llms.txt
Use this file to discover all available pages before exploring further.
POST /v1/responses is the core call. It runs your input through an agent and returns the result. The call is agentic by default: the agent can browse, run code, use a terminal, read and write files, call connected tools, and reason across many steps before answering.
Send an instance_id to start a conversation, or a session_id to continue one. The session keeps the full history, so you send only the new input.
Request body
The message or task. Reference uploaded files by path; see Continue a conversation for how history carries across turns.
Which agent to talk to. With no
session_id, this starts a new conversation and the reply returns its session_id. Required when you are not continuing a session.Continue an existing conversation. The instance is implied, so you don’t send
instance_id too.For a multi-agent template, which agent this new conversation uses (e.g.
claude-code). Defaults to the template’s primary and is fixed once the session starts. Single-agent templates ignore it.true returns a Server-Sent Events stream; false (the default) returns the finished response as one JSON body. See Streaming events.The LLM the agent runs on. List what the agent can run with
GET /v1/models. Defaults to the session’s model.The model’s provider, e.g.
anthropic.How hard the model thinks:
none, minimal, low, medium, high, or xhigh.chat (the default) runs one turn and replies. goal lets the agent work on its own, turn after turn, until the task is done or a safety cap is hit. Cancel it any time. Goal is supported by Hermes, Claude Code, and Codex.Up to 16 key/value pairs. Echoed back on the response, never interpreted.
Response
The response id, prefixed
resp_. Use it to fetch, reconnect, or cancel the turn.The instance that ran the turn.
The conversation this turn belongs to. Reuse it on the next call to continue the thread.
in_progress, then a terminal completed, failed, or cancelled.The agent’s final answer.
Token counts and cost for the turn, e.g.
{ input_tokens, output_tokens, cost_usd }.Example
- Request
- Response
Continue a conversation
The first message names aninstance_id and starts a session. The reply returns a session_id; pass it on the next message to continue the same thread. The session holds the full history, so you never resend a transcript: you send only the new input.
One active turn per session. A session runs one response at a time. Sending new input while one is in flight returns
409 session_busy. Use another session, or cancel the running turn first.Manage conversations
A session is one conversation on an instance. The instance holds the full history, and one instance can hold many sessions, one per thread. Use these to list a user’s threads, read a thread’s history, or delete one.| Action | Endpoint |
|---|---|
| List on an instance | GET /v1/instances/{id}/sessions |
| Retrieve, with history | GET /v1/sessions/{id} |
| Delete | DELETE /v1/sessions/{id} |
| Models available to the agent | GET /v1/models |
GET /v1/instances/{id}/sessions lists every session on an instance. GET /v1/sessions/{id} returns one session with its full history.
The session id, prefixed
sess_.The instance this conversation runs on.
Which agent the session runs, fixed once the first message starts it.
Every turn in the conversation, in order. You never resend it.
Models available to the agent
GET /v1/models lists the models an instance’s agent can run on. Pass any of them as model (with its provider) when you send a message; omit it to use the session’s current model.
Follow up on a response
Every response has an id you can use after the call returns.| Action | Endpoint |
|---|---|
| Fetch it again | GET /v1/responses/{id} |
| Reconnect a dropped stream | GET /v1/responses/{id}/stream |
| Stop a running turn | POST /v1/responses/{id}/cancel |
GET /v1/responses/{id}/stream replays a snapshot of everything so far, then resumes live, so a dropped connection never loses the answer.
Status values
A response moves fromin_progress to exactly one terminal status.
| Status | Meaning |
|---|---|
in_progress | The turn is running. |
completed | The turn finished and output_text holds the answer. |
failed | The turn ended on an error. |
cancelled | You stopped the turn with cancel. |
Next steps
Streaming events
The full event list and a client parser for
stream: true.Instances
Create, size, and manage the computer a conversation runs on.
Core concepts
Instances, sessions, and responses, and why the agent is not the model.
Build a chat app
Put send, continue, and list together into a working chat.