API Reference Overview
Cognipeer exposes two HTTP surfaces:
- Client API under
/api/client/v1/for API-token authenticated integrations. - Dashboard/Internal API under
/api/for JWT-authenticated console features such as incidents and health.
Machine-readable spec
The full Client API is published as an OpenAPI 3.0 document — see OpenAPI Specification to download it or generate a client. Direct link: openapi.yaml.
Base URL
https://your-gateway.example.com/api/client/v1Authentication
All client API endpoints require a Bearer token in the Authorization header:
curl -X POST https://gateway.example.com/api/client/v1/chat/completions \
-H "Authorization: Bearer cpeer_your_token_here" \
-H "Content-Type: application/json" \
-d '{"model": "gpt-4", "messages": [{"role": "user", "content": "Hello"}]}'Tokens are created in the dashboard under Settings → API Tokens.
Acting for a user
An application that signs its own users in can make a call run as one of them. There are two equivalent ways to send the application token together with the signed statement (a JWT) about the person:
# 1. Two headers
curl https://gateway.example.com/api/client/v1/models \
-H "Authorization: Bearer cpeer_your_token_here" \
-H "X-Cognipeer-User-Token: eyJhbGciOiJSUzI1NiIs..."
# 2. One header, for SDKs that only let you set an API key: <api token>~<user token>
curl https://gateway.example.com/api/client/v1/models \
-H "Authorization: Bearer cpeer_your_token_here~eyJhbGciOiJSUzI1NiIs..."Both are verified identically; sending both at once is refused (400, invalid_combined_credential). The token must be set up for it first. See Acting for a user.
Official SDK
If you are integrating from a TypeScript or JavaScript application, use the official Cognipeer Console SDK.
- Platform behavior, deployment, and endpoint semantics stay canonical in the Cognipeer docs.
- Method names, request helpers, and framework integrations stay canonical in the SDK docs.
For the relationship between the two, see Using the SDK in this site and the SDK-side Console API Mapping.
Client API Endpoint Map
| Domain | Base Path | Methods |
|---|---|---|
| Chat Completions | /chat/completions (models, and agents as agent:<key>) | POST |
| Models list | /models, /models/:id (models and active agents) | GET |
| Messages (Anthropic) | /messages | POST |
| Embeddings | /embeddings | POST |
| Moderations | /moderations | POST |
| Audio | /audio/{speech,transcriptions,translations} | POST |
| OCR (sync) | /ocr | POST |
| OCR Jobs (async) | /ocr-jobs, /ocr-jobs/:id/* | GET, POST, PATCH, DELETE |
| Batches | /batches, /batches/:id/{cancel,items,results} | GET, POST |
| Users | /users, /users/:id/tokens | POST |
| Spend Report | /spend/report | GET |
| Budgets | /budgets, /budgets/:id, /budgets/status | GET, POST, PATCH, DELETE |
| Automations | /automations, /automations/:key/{run,pause,resume} | GET, POST |
| Crawler | /crawler/crawlers, /crawler/jobs/*, /crawler/run | GET, POST, PATCH, DELETE |
| Red Team | /redteam/{probes,campaigns,runs}, /redteam/campaigns/:key/scan | GET, POST |
| Agents | /agents, /agents/:agentKey, /agents/:agentKey/publish | GET, POST, PATCH, DELETE |
| Agent Runs | /agents/:agentKey/runs, /agents/runs, /agents/runs/queue, /agents/runs/:runId[/cancel,/events,/events/stream,/actions/:actionId] | GET, POST |
| Responses (models and agents) | /responses, /responses/:id[/cancel], /agents/responses (agents only) | GET, POST |
| Agent Triggers | /agents/:agentKey/triggers, /agents/:agentKey/triggers/:triggerId[/run] | GET, POST, PATCH, DELETE |
| A2A | /a2a/:agentKey, /a2a/:agentKey/.well-known/agent-card.json | GET, POST |
| Agent Sessions | /agents/sessions, /agents/sessions/:id | GET, POST, PATCH, DELETE |
| Agent Session Events | /agents/sessions/:id/events, /agents/sessions/:id/events/stream (SSE) | GET |
| Agent Actions (approvals) | /agents/sessions/:id/actions/:actionId | POST |
| Agent Session Files | /agents/sessions/:id/files, /agents/sessions/:id/files/:fileId[/content] | GET, POST, DELETE |
| Stop a turn | /agents/sessions/:id/cancel (canonical), /agents/conversations/:id/cancel, /responses/:id/cancel | POST |
| Webhooks | /webhooks, /webhooks/:id[/test,/rotate-secret,/deliveries], /webhooks/events | GET, POST, PATCH, DELETE |
| Browsers | /browser/browsers | GET, POST, PATCH, DELETE |
| Browser Sessions | /browser/sessions | GET, POST |
| Browser Session Events | /browser/sessions/:sessionId/events | GET |
| Browser Actions | /browser/sessions/:sessionKey/actions | POST |
| Browser Snapshot / Extract / Artifacts | /browser/sessions/:sessionKey/{snapshot,extract,screenshot,pdf} | GET, POST |
| MCP Execute | /mcp/:serverKey/execute | GET, POST |
| MCP SSE | /mcp/:serverKey/sse | GET |
| MCP Message | /mcp/:serverKey/message | POST |
| Vector Providers | /vector/providers | GET, POST |
| Vector Indexes | /vector/providers/:key/indexes | GET, POST, PATCH, DELETE |
| Tracing (Custom) | /tracing/sessions | POST |
| Tracing (OTLP) | /traces | POST |
| Files | /files/providers, /files/buckets, /files/buckets/:bucketKey/objects, /files/buckets/:bucketKey/objects/:objectKey (and /download) | GET, POST, DELETE |
| Guardrails | /guardrails/evaluate, /guardrails/hooks/evaluate, /guardrails (list, create), /guardrails/:key (update, delete) | GET, POST, PATCH, DELETE |
| Prompts | /prompts | GET, POST |
| Knowledge Engine | /rag/modules | GET, POST, DELETE |
| Memory | /memory/stores | GET, POST, PATCH, DELETE |
| Config Groups | /config/groups | GET, POST |
| Config Group Items | /config/groups/:groupKey/items | GET, POST |
| Config Item | /config/items/:key | GET, PATCH, DELETE |
| Config Resolve | /config/resolve | POST |
| Config Audit | /config/items/:key/audit | GET |
| Rerankers (list/get) | /rerankers, /rerank/:key | GET |
| Rerank (run) | /rerank/:key | POST |
| Members | /members (list), /members/invite, /members/:id (remove), /members/:id/permissions, /members/:id/{disable,enable}, /members/permissions/services | GET, POST, PATCH, DELETE |
| Member groups | /members/groups, /members/groups/:id, /members/groups/:id/members[/:userId], /members/groups/:id/projects[/:projectId] | GET, POST, PATCH, DELETE |
| License | /license | GET, POST, DELETE |
| Analytics | /analytics/usage, /analytics/overview | GET |
| Audit log | /audit/logs | GET |
| Inference monitoring | /monitoring/inference | GET |
| Providers | /providers, /providers/:id | GET, POST, PATCH, DELETE |
| Provider drivers | /providers/drivers, /providers/drivers/:driverId/form | GET |
Enterprise Client APIs
These client (token-authenticated) endpoints are part of the Enterprise edition and are only available on licensed deployments. Without a license, Flows and Realtime answer 402 with requiresEnterprise: true; other routes answer 403. Full request/response details are in the OpenAPI Specification.
| Domain | Base Path | Methods |
|---|---|---|
| Realtime | /realtime (WebSocket), /realtime/models, /realtime/models/:id | GET (WS), GET, POST, PATCH, DELETE |
| Sandbox (lifecycle) | /sandbox/sandboxes, /sandbox/sandboxes/:id/{exec,code,start,stop,snapshot,fork,files,preview,...}, /sandbox/snapshots | GET, POST, PATCH, DELETE |
| Sandbox (toolbox) | /sandbox/sandboxes/:id/{fs/*,git/*,sessions/*} | POST, GET, DELETE |
| MCP Hubs | /mcp/hubs, /mcp/hubs/:hubKey, /mcp/hubs/:hubKey/servers | GET |
| Realtime calls (telephony) | /realtime/calls, /realtime/calls/:sessionId, /realtime/calls/:sessionId/hangup | POST, GET |
| Flows | /flows, /flows/:idOrKey[/runs], /flows/runs, /flows/runs/:runId[/events,/cancel,/resume,/approval] | GET, POST |
| AI App Gateway | /appgw/:gatewayKey[/u/:userId] (proxied coding-agent traffic — Anthropic Messages, OpenAI Chat/Responses shapes) | POST |
More client routes
Client routes that have no page of their own. The route table above names each one; this is what it does. All take a Bearer API token and are gated by an RBAC service of the same name.
| Route | What it does |
|---|---|
GET /members, POST /members/invite, DELETE /members/:id, PATCH /members/:id/permissions, POST /members/:id/{disable,enable}, GET /members/permissions/services | Manage tenant members, their roles and per-service permissions. Owner or admin token owners only; the owner's permissions and your own cannot be changed here. API-token minting is not part of this API. permissions/services lists the services and permission levels. |
GET/POST /members/groups, GET/PATCH/DELETE /members/groups/:id, POST/DELETE /members/groups/:id/members[/:userId], POST/DELETE /members/groups/:id/projects[/:projectId] | Manage user groups: create and rename, add and remove members, grant and revoke project access. Directory (LDAP) groups reject manual membership, rename and delete. |
GET /license, POST /license, DELETE /license | Read the effective license (type, status, source, features, limits, expiry) and the project count; apply an offline license key; reset to the default FREE license. GET needs read on license, POST and DELETE need admin. The license key and its claims are never returned. |
GET /analytics/usage | Usage over time for the token's project. Query: from, to (ISO dates), group_by (model, user, service, agent or metadata.<key>), interval (hour, day, month), model. |
GET /analytics/overview | The dashboard rollup for the project: stats, recent_sessions and daily, optionally limited with from and to. |
GET /audit/logs | The tenant's audit trail, filtered and paged. Query: action, actorUserId, from, to, method, outcome (success or failure), q, service, limit (default 100, at most 1000), skip. Tenant-wide; needs audit read access. |
GET /monitoring/inference | Latest metrics and an overview for each inference server the tenant monitors. Tenant-wide; needs inference-monitoring read access. Stored server API keys are never returned. |
GET /providers, POST /providers, GET/PATCH/DELETE /providers/:id | Manage provider connections. GET takes scope (tenant or project), type, driver and status. Credentials are never returned, only hasCredentials. Needs providers admin access. |
GET /providers/drivers, GET /providers/drivers/:driverId/form | The driver catalog (filter with domain) and the form schema of one driver, to build a create form. |
POST /realtime/calls, GET /realtime/calls/:sessionId, POST /realtime/calls/:sessionId/hangup | Enterprise. Place an outbound call through a Twilio telephony connection, read its status (?refresh=true asks Twilio), and end it. |
POST /guardrails/hooks/evaluate, GET /guardrails | Evaluate one guardrail hook for your own enforcement point, and list the guardrails a token can address. See Guardrails API. |
GET /agents/runs/queue | Queue visibility for background agent runs: counts of running, queued and scheduled runs per class for the tenant and, under project, for the token's project. See Agent Runs. |
Dashboard And Operational Endpoints
These endpoints are documented here because operators often need them during rollout, but they are not part of the /api/client/v1 customer surface.
| Domain | Base Path | Auth | Methods |
|---|---|---|---|
| PII Policies & Scan | /api/pii/* | Session (license-free) | GET, POST, PATCH, DELETE |
| Reranker Admin | /api/reranker/* | Session | GET, POST, PATCH, DELETE |
| Browser Admin | /api/browser/* | Session | GET, POST, PATCH, DELETE |
| Cluster | /api/cluster/* | Session (tenant admin) | GET, PUT, DELETE |
| Alerts | /api/alerts/rules, /api/alerts/entities, /api/alerts/channels/test, /api/alerts/history | JWT session | GET, POST, PUT, PATCH, DELETE |
| Incidents | /api/alerts/incidents | JWT session | GET, PATCH, POST |
| Agent Health | /api/tracing/agents/health, /api/tracing/agents/:agentName/health | JWT session | GET |
| Health | /api/health/live, /api/health/ready | Public | GET |
Request Format
- Content-Type:
application/json(except file uploads) - Max body size: configurable via
NEXT_BODY_SIZE_LIMIT(default 10MB) - Request IDs: Include
request_idin the body for correlation
Response Format
All responses follow a consistent JSON structure:
Success:
{
"data": { ... },
"request_id": "req_abc123"
}Error:
{
"error": "Human-readable error message"
}HTTP Status Codes
A 403 from the permission gate adds code, service, required and decisionId (also in the X-Decision-Id header); OpenAI-compatible routes carry them as error.code and error.decision_id. See Troubleshooting and FAQ.
| Code | Meaning |
|---|---|
| 200 | Success |
| 201 | Created |
| 400 | Bad request (missing/invalid parameters) |
| 401 | Invalid or missing API token |
| 403 | The token's owner, scope or project does not allow it (code: "forbidden", with a decisionId), the route has no authorization declaration (route_not_declared), or the feature is not available in the license |
| 404 | Resource not found |
| 409 | Conflict (duplicate resource) |
| 422 | Unprocessable (validation failure) |
| 429 | Rate limit exceeded |
| 500 | Internal server error |
| 503 | Service unavailable (circuit breaker open or shutting down), or authorization could not be decided (code: "authorization_unavailable", with Retry-After) |
Rate Limiting
Requests are rate-limited per token based on the tenant's plan:
| Plan | Request Limit |
|---|---|
| FREE | 1,000/month |
| STARTER | 10,000/month |
| PROFESSIONAL | 100,000/month |
| ENTERPRISE | Unlimited |
| ON_PREMISE | Unlimited |
Rate limit headers are included in responses when applicable.
Quota System
Beyond rate limits, the control plane enforces resource quotas:
- Token budgets (per-request and monthly)
- Vector count limits
- File storage limits
- Tracing session limits
Quota violations return 429 with a descriptive error message.

