API reference

API reference · Agents

Read an agent's definition from the dashboard

GET/api/account/agents/{id}/definitionSigned in session

Hosted agent runs (lib/agent-runs.ts): the agent's definition runs a loop on the server, model call and tool calls, each step a job of its own. Every model call is a request by the agent's own key, billed to its wallet under its policy. An agent's own key may read itself; a header is named, never read back. A 404 while hosted runs are off on the deployment.

Parameters

Path and query parameters
FieldTypeWhat it is
id (path)requiredstringThe agent's id; self on an agent's own key.

Answer 200

The definition.

Fields of the 200 answer
FieldTypeWhat it is
objectstringOne of "agent.definition".
agent_idinteger
modelstring
instructionsstring or null
toolsarray of object
temperaturenumber or null
max_output_tokensinteger or null
limitsobjectWhat a run gets when it asks for none, the deployment's caps applied.
limits.max_stepsinteger
limits.max_wall_secondsinteger
limits.max_cost_microsinteger
updatedintegerUnix seconds.

Errors

  • 401OpenAI shaped error.
  • 403OpenAI shaped error.
  • 404OpenAI shaped error.

Every error answers in one shape, with its type, code and the field it names. The whole list is in the docs' Errors section.

Antimatter