> ## Documentation Index
> Fetch the complete documentation index at: https://docs.goantiai.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Agents API

> Create, manage, and revoke agent identities.

## Create an agent

```bash theme={null}
curl -X POST https://api.antiailabs.com/api/v1/agents \
  -H "Authorization: Bearer YOUR_CLERK_JWT" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "payment-processor",
    "description": "Handles Stripe payments",
    "tags": ["production", "stripe"],
    "policy_ids": ["your-policy-id"]
  }'
```

Response `201 Created`:

```json theme={null}
{
  "id": "agent-uuid",
  "name": "payment-processor",
  "status": "active",
  "client_secret": "osk_live_...",
  "created_at": "2026-04-11T10:00:00Z"
}
```

<Warning>
  Save the `client_secret` — it's shown exactly once.
</Warning>

## List / Get / Update / Revoke

```bash theme={null}
GET    /api/v1/agents?tag=production&limit=50
GET    /api/v1/agents/AGENT_ID
PATCH  /api/v1/agents/AGENT_ID
DELETE /api/v1/agents/AGENT_ID
```

## Suspend / Unsuspend

```bash theme={null}
POST /api/v1/agents/AGENT_ID/suspend
POST /api/v1/agents/AGENT_ID/unsuspend
```

## Rotate credentials

```bash theme={null}
curl -X POST https://api.antiailabs.com/api/v1/agents/AGENT_ID/credentials/rotate \
  -H "Authorization: Bearer YOUR_CLERK_JWT" \
  -H "Content-Type: application/json" \
  -d '{"overlap_window_seconds": 900}'
```

The old credential stays valid for `overlap_window_seconds` (default: 15 min) to allow rolling deployments.
