Skip to main content
POST
/
v1
/
agents
Create an Agent
curl --request POST \
  --url https://api.browserbase.com/v1/agents \
  --header 'Content-Type: application/json' \
  --header 'X-BB-API-Key: <api-key>' \
  --data '
{
  "name": "<string>",
  "systemPrompt": "<string>",
  "resultSchema": {}
}
'
{
  "agentId": "<string>",
  "name": "<string>",
  "createdAt": "2023-11-07T05:31:56Z",
  "updatedAt": "2023-11-07T05:31:56Z",
  "systemPrompt": "<string>",
  "resultSchema": {}
}

Authorizations

X-BB-API-Key
string
header
required

Body

application/json
name
string
required

Human-readable name for the agent. Used to identify the agent in the dashboard and API responses.

Required string length: 1 - 255
systemPrompt
string

System prompt that steers the agent's behavior on every run that uses this agent.

Minimum string length: 1
resultSchema
object

An optional JSON Schema object. If provided, runs that reference this agent will aim to return a result that conforms to this schema when they complete. Can be overridden per run by passing resultSchema on the run request.

Response

201 - application/json

The agent has been created.

A reusable agent. Referenced by agentId to apply a system prompt to every run that uses the agent.

agentId
string
required

Unique identifier for the agent. Use this value as agentId when creating an agent run.

name
string
required

Human-readable name for the agent. Used to identify the agent in the dashboard and API responses.

createdAt
string<date-time>
required
updatedAt
string<date-time>
required
systemPrompt
string

System prompt applied to every run that uses this agent.

resultSchema
object

JSON Schema that runs referencing this agent will aim to conform their result to. Can be overridden per run by passing resultSchema on the run request.