Agent overview
The Agent is a coding assistant exposed via an OpenAI-compatible API. It supports tools (e.g. read file, write file, list directory, run terminal, search and replace). The API returns tool calls; your client (e.g. IDE or CLI) executes them and sends the results back. Execution is client-side—the platform does not run code on your machine.Capabilities
- Chat — Multi-turn conversation with a supported model.
- Tools — The model can request tool use. Supported tools typically include:
read_file— Read file contents (path parameter).write_file— Write contents to a file.list_directory— List directory contents.run_terminal— Run a shell command.search_replace— Search and replace in a file.
tool_calls with the function name and arguments (e.g. JSON string).
How it works
- You send a request with
messagesand optionally atoolsarray (OpenAI-style tool definitions). - The model may respond with text and/or
tool_calls. - Your client executes each tool call (e.g. read a file, run a command).
- You append the tool results as new messages and call the API again.
- Repeat until the model returns a final answer without tool calls.
Base URL
Use the production API base:Authentication
Same as the rest of the API: include your API key in the request:Model support
Only models that are enabled for inference and listed for the Agent can be used. CallGET .../api/agent/v1/models to see which models are available. Use one of those model IDs in the model field of chat requests.
Limitations
- Client-side execution — You must implement tool execution in your client. The API does not run commands or read your files.
- Model list — Only models returned by the Agent models endpoint are supported; others may return 400 or 404.
- Rate limits and billing — Same rate limits and balance rules as inference; 402 when balance is insufficient.