# AgentForge API > Programmatically create and configure AI agents. Full REST API with guided next_steps on every mutation. ## Auth All endpoints require a Bearer token: `Authorization: Bearer af_xxx` Generate API keys from the AgentForge dashboard under Settings > API Keys. ## Docs - [OpenAPI Spec](https://agents.algomax.fr/api/v1/openapi.json) - [Interactive Docs](https://agents.algomax.fr/api/docs) - [Full API Reference (Markdown)](https://agents.algomax.fr/llms-full.txt) ## Endpoints ### Agents - POST /api/v1/agents — Create agent (returns next_steps) - GET /api/v1/agents — List agents - GET /api/v1/agents/{id} — Get agent - PATCH /api/v1/agents/{id} — Update agent - DELETE /api/v1/agents/{id} — Delete agent - POST /api/v1/agents/{id}/clone — Clone agent ### Agent Configuration - GET/PUT /api/v1/agents/{id}/prompt — System prompt & structured prompt config - GET/PUT /api/v1/agents/{id}/model — Model selection (e.g. openai/gpt-5.3-chat-latest) - GET/PUT /api/v1/agents/{id}/tools — Tool configs (API calls, web scraper, calculator, etc.) - GET/PUT /api/v1/agents/{id}/channels — Channel deployment (Discord, Telegram, WhatsApp, Slack) - GET/PUT /api/v1/agents/{id}/guardrails — Safety rules (PII, blocked topics, length limits) - GET/PUT /api/v1/agents/{id}/memory — Memory strategy (sliding_window or summary) - GET/PUT /api/v1/agents/{id}/escalation — Escalation config (webhook, keywords, assignees) ### Knowledge Bases (RAG) - GET /api/v1/agents/{id}/knowledge-bases — List knowledge bases - POST /api/v1/agents/{id}/knowledge-bases — Create knowledge base - GET /api/v1/agents/{id}/knowledge-bases/{kbId}/documents — List documents - POST /api/v1/agents/{id}/knowledge-bases/{kbId}/documents — Upload document (text or base64) ### Evals - GET /api/v1/agents/{id}/evals — List eval suites - POST /api/v1/agents/{id}/evals — Create eval suite - POST /api/v1/agents/{id}/evals/{suiteId}/run — Run eval suite ### Logs & Stats - GET /api/v1/agents/{id}/logs — Request logs (paginated) - GET /api/v1/agents/{id}/stats — Aggregated stats (cost, tokens, latency) ### Chat - POST /api/v1/chat — Send message (sync response) - POST /api/v1/chat-stream — Send message (SSE streaming)