Agent API
Call the agent from your own scripts, CI jobs and tools over HTTP, and get the answer when the turn finishes or streamed as it happens.
Everything a run does is an ordinary conversation turn: the same tools, permissions, Projects and usage accounting as a message you type in the web app. Every path goes through the address you open Chetty on, under /api.
The developer path
Read these in order; each one builds on the one before.
- Create and manage a personal API token: the credential every script, client and tool below uses.
- Send your first agent API request: the header, one run and its answer.
- Stream an agent reply, Continue a conversation through the API and Choose a model through the API: the rest of running the agent.
- Cap what an API token can run and Agent API errors: limits and every refusal.
- API reference: every other endpoint your account can call on this instance, including plugin endpoints, with their inputs and ready-made examples.
- Use Chetty as an MCP server for an MCP client, and Run the CLI from scripts for the terminal app; both reach the same endpoints.
- For plugin authors, Connecting plugins shows how one plugin uses another plugin's connection.
Personal API tokens
Every script, client and tool here signs in with a personal API token that acts as you. Create and manage a personal API token is the one guide for creating, using, limiting and revoking one.
Create a token
Follow Create a token.
Usage and limits
See Review usage and limits, and Cap what an API token can run for the four caps.
Delete a token
See Revoke a token.
What a token cannot do
Authentication
See Before you start for the header every request carries.
Run the agent
Send your first agent API request runs one turn and reads its answer; the API reference lists every field the request accepts.
Wait for the answer
See When the call waits too long.
Stream the turn
Conversations
See Continue a conversation through the API.
Models
See Choose a model through the API.
List the models you can use
See List the models you can use.
Pick a model for one run
Switch a conversation's model
See Switch a conversation's model.
Errors
See Agent API errors for every status code and body.
Limit refusals
See Limit refusals.