Agents · Create
Create an agent via API
Endpoint
POST
https://claix.dev/agentsCreates a Claix Retrieve agent on the API key account, with assigned routes and a response mode. It starts active and ready at /retrieve/{slug}.
This call is free.
1. Authentication
x-api-key: <YOUR_API_KEY>
or
Authorization: Bearer <YOUR_API_KEY>
2. Request format
Method: POST · Content-Type: application/json. Every field is required.
| Field | Type | Required | Description |
|---|---|---|---|
| name | string | Yes | Visible agent name (max 80). |
| slug | string | Yes | URL id for /retrieve/{slug}. 3–20 chars: a-z and 0-9. |
| description | string | Yes | What the agent is for (max 500). |
| prompt | string | Yes | Business instructions (max 12,000). |
| routes | uuid[] | Yes | route_id list from your account. At least one. |
| response_mode | string | Yes | "bruto" (SQL rows) or "razonada" (typed answer). |
3. How to build the call
- Create at least one route (POST /routes) and copy its route_id.
- Pick a
slugunique in your account. - POST to
https://claix.dev/agentswith every field. - Save
agent_idand useretrieve_urlto ask questions.
4. Examples
Right panel: cURL, JavaScript, Node.js, Python, PHP, and n8n.
5. Successful response
201 Created
{
"success": true,
"agent": {
"agent_id": "9d8e7f6a-5b4c-3d2e-1f0a-9b8c7d6e5f4a",
"name": "Asistente de agenda",
"slug": "agenda",
"description": "Responde preguntas sobre citas y pacientes de la clínica.",
"status": "active",
"prompt": "Eres el asistente de la clínica. Solo usas las rutas asignadas. No inventes datos.",
"routes": ["7c2f9a1e-4b8d-4e6a-9f21-0a1b2c3d4e5f"],
"response_mode": "razonada",
"retrieve_url": "https://claix.dev/retrieve/agenda",
"created_at": "2026-10-19T18:00:00.000Z"
}
}6. Errors
| HTTP | When |
|---|---|
| 401 | Invalid API key or inactive account. |
| 400 | Missing field, invalid/duplicate slug, or a route is not yours. |
| 405 | Method other than POST. |
| 500 | Internal error. |
{
"error": "Descripción legible del problema.",
"detalle": "Información técnica adicional (solo presente en algunos casos).",
"log_id": "7c2e1a90-4b3d-4f8a-9e21-6d5c8b0a1f34"
}