DocsAPI ReferenceAgents API

Agents API

Create, manage, and interact with AI agents.

List Agents

bash
GET /v1/agents

Response:
{
  "agents": [
    {
      "id": "agent_xxxxx",
      "name": "CustomerSupport",
      "status": "active",
      "model": "gpt-4-turbo"
    }
  ]
}

Create Agent

bash
POST /v1/agents

Body:
{
  "name": "MyAgent",
  "model": "gpt-4-turbo",
  "instructions": "You are a helpful assistant.",
  "tools": ["web-search", "calculator"]
}

Run Agent

bash
POST /v1/agents/{agent_id}/run

Body:
{
  "task": "Analyze the Q4 sales report",
  "context": { "reportUrl": "https://..." }
}