Create an agent
Create an agent once, then reuse its saved behavior across multiple runs. The example below stores instructions and aweb_search tool so later runs can call external tools when needed.
201 Created with an agent object with a stable id such as agt_....
See the Create an agent API reference for the full schema.
List and retrieve agents
Use the collection endpoint to list saved agents for the current caller. Use the item endpoint when you already know the agent ID.Execute a saved agent
Run the agent by sending only the per-run input and optional metadata. The service combines this with the saved agent configuration and forwards the request into the Responses API throughmkllm-gateway.
Runs start asynchronously: the create call returns a queued run record. Use run retrieval to poll status, or stream progress via the run events endpoint.
- the persisted run ID
- the run status
gateway_response_idfrom the upstream Responses callgateway_response, which contains the stored assistant output and any tool activity
web_search, the persisted gateway_response will include the corresponding tool call entries.
See the Execute a saved agent API reference for the full run request and response schema.
Inspect run history
Use the runs collection to list prior executions for one agent. Use the run detail endpoint to retrieve one stored result again later.Update or delete an agent
UsePOST /api/v1/agents/{agent_id} to update stored configuration.
Use DELETE /api/v1/agents/{agent_id} to delete the agent when it should no longer accept new runs.
200 OK with a deletion result object:
409 until they are gone. Schedules do not block deletion, but they are only reachable through the agent, and deleting it does not delete them, so delete them first. See Connect agents to chat apps and schedules.
Versions and rollback
Every create, update, and rollback appends a version, an immutable copy of the agent’s configuration:name, description, model, instructions, tools, tool_choice, parallel_tool_calls, max_tool_calls, text, reasoning, and metadata. Creation writes version 1, and the agent object’s version is the number of the current one. Each run records agent_version, the version it executed against. A continuation such as an MCP approval keeps using that version, so the agent can change underneath it without changing the run.
Rolling back to version N copies N’s configuration into the agent as a new version. Version N itself is untouched, and the new version carries restored_from_version: N, so history never loses an entry.
The mka1 CLI reference does not list version commands, so this section has no CLI tab.
The list is paginated with
limit and order (desc by default, so the newest version comes first). Asking for a version number that does not exist returns 404. Rollback needs write:agents and returns the agent object, whose version is the new number. Like update and delete, rollback requires the same X-On-Behalf-Of the agent was created with: a caller sending the header gets 404 on an agent created without it.
See the List agent versions, Retrieve an agent version, and Roll back an agent to a version API references.
Review the Responses API guide if you want to compare saved-agent execution with one-off response requests.
To run an agent from a chat app or on a timer, see Connect agents to chat apps and schedules.