Skip to main content
Version: 2.0

Create agent

POST 

/v2/agents

Creates an agent. An agent is defined by three things: the instructions it follows, the steps it executes when it receives an input, and the tools it can call. Instructions are attached to each step and determine the agent's behavior on that step.

Only a single step is currently supported. Set first_step to that step; additional step types will be added later.

To invoke an agent, create a session and send events to it. Each event produces a response from the agent.

LLM configuration

Each agent is bound to one LLM, configured under llm:

  • llm_name: the LLM resource to use (see GET /v2/llms).
  • model parameters such as temperature and max tokens.
  • retry configuration applied to LLM calls.

Retry configuration

The agent retries failed LLM calls using exponential backoff:

  • max_retries: maximum number of retries after the initial call.
  • initial_backoff_ms: delay in milliseconds before the first retry.
  • backoff_factor: multiplier applied to the delay after each retry.
  • max_backoff_ms: upper bound on the delay between retries.

Request

Responses

The response includes the complete agent configuration with system-generated fields including the unique agent key, creation timestamp, and update timestamp.