Skip to content

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/v1

Authentication ​

All client API endpoints require a Bearer token in the Authorization header:

bash
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:

bash
# 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 ​

DomainBase PathMethods
Chat Completions/chat/completions (models, and agents as agent:<key>)POST
Models list/models, /models/:id (models and active agents)GET
Messages (Anthropic)/messagesPOST
Embeddings/embeddingsPOST
Moderations/moderationsPOST
Audio/audio/{speech,transcriptions,translations}POST
OCR (sync)/ocrPOST
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/tokensPOST
Spend Report/spend/reportGET
Budgets/budgets, /budgets/:id, /budgets/statusGET, POST, PATCH, DELETE
Automations/automations, /automations/:key/{run,pause,resume}GET, POST
Crawler/crawler/crawlers, /crawler/jobs/*, /crawler/runGET, POST, PATCH, DELETE
Red Team/redteam/{probes,campaigns,runs}, /redteam/campaigns/:key/scanGET, POST
Agents/agents, /agents/:agentKey, /agents/:agentKey/publishGET, 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.jsonGET, POST
Agent Sessions/agents/sessions, /agents/sessions/:idGET, POST, PATCH, DELETE
Agent Session Events/agents/sessions/:id/events, /agents/sessions/:id/events/stream (SSE)GET
Agent Actions (approvals)/agents/sessions/:id/actions/:actionIdPOST
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/cancelPOST
Webhooks/webhooks, /webhooks/:id[/test,/rotate-secret,/deliveries], /webhooks/eventsGET, POST, PATCH, DELETE
Browsers/browser/browsersGET, POST, PATCH, DELETE
Browser Sessions/browser/sessionsGET, POST
Browser Session Events/browser/sessions/:sessionId/eventsGET
Browser Actions/browser/sessions/:sessionKey/actionsPOST
Browser Snapshot / Extract / Artifacts/browser/sessions/:sessionKey/{snapshot,extract,screenshot,pdf}GET, POST
MCP Execute/mcp/:serverKey/executeGET, POST
MCP SSE/mcp/:serverKey/sseGET
MCP Message/mcp/:serverKey/messagePOST
Vector Providers/vector/providersGET, POST
Vector Indexes/vector/providers/:key/indexesGET, POST, PATCH, DELETE
Tracing (Custom)/tracing/sessionsPOST
Tracing (OTLP)/tracesPOST
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/promptsGET, POST
Knowledge Engine/rag/modulesGET, POST, DELETE
Memory/memory/storesGET, POST, PATCH, DELETE
Config Groups/config/groupsGET, POST
Config Group Items/config/groups/:groupKey/itemsGET, POST
Config Item/config/items/:keyGET, PATCH, DELETE
Config Resolve/config/resolvePOST
Config Audit/config/items/:key/auditGET
Rerankers (list/get)/rerankers, /rerank/:keyGET
Rerank (run)/rerank/:keyPOST
Members/members (list), /members/invite, /members/:id (remove), /members/:id/permissions, /members/:id/{disable,enable}, /members/permissions/servicesGET, 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/licenseGET, POST, DELETE
Analytics/analytics/usage, /analytics/overviewGET
Audit log/audit/logsGET
Inference monitoring/monitoring/inferenceGET
Providers/providers, /providers/:idGET, POST, PATCH, DELETE
Provider drivers/providers/drivers, /providers/drivers/:driverId/formGET

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.

DomainBase PathMethods
Realtime/realtime (WebSocket), /realtime/models, /realtime/models/:idGET (WS), GET, POST, PATCH, DELETE
Sandbox (lifecycle)/sandbox/sandboxes, /sandbox/sandboxes/:id/{exec,code,start,stop,snapshot,fork,files,preview,...}, /sandbox/snapshotsGET, POST, PATCH, DELETE
Sandbox (toolbox)/sandbox/sandboxes/:id/{fs/*,git/*,sessions/*}POST, GET, DELETE
MCP Hubs/mcp/hubs, /mcp/hubs/:hubKey, /mcp/hubs/:hubKey/serversGET
Realtime calls (telephony)/realtime/calls, /realtime/calls/:sessionId, /realtime/calls/:sessionId/hangupPOST, 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.

RouteWhat it does
GET /members, POST /members/invite, DELETE /members/:id, PATCH /members/:id/permissions, POST /members/:id/{disable,enable}, GET /members/permissions/servicesManage 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 /licenseRead 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/usageUsage 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/overviewThe dashboard rollup for the project: stats, recent_sessions and daily, optionally limited with from and to.
GET /audit/logsThe 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/inferenceLatest 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/:idManage 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/formThe 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/hangupEnterprise. Place an outbound call through a Twilio telephony connection, read its status (?refresh=true asks Twilio), and end it.
POST /guardrails/hooks/evaluate, GET /guardrailsEvaluate one guardrail hook for your own enforcement point, and list the guardrails a token can address. See Guardrails API.
GET /agents/runs/queueQueue 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.

DomainBase PathAuthMethods
PII Policies & Scan/api/pii/*Session (license-free)GET, POST, PATCH, DELETE
Reranker Admin/api/reranker/*SessionGET, POST, PATCH, DELETE
Browser Admin/api/browser/*SessionGET, 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/historyJWT sessionGET, POST, PUT, PATCH, DELETE
Incidents/api/alerts/incidentsJWT sessionGET, PATCH, POST
Agent Health/api/tracing/agents/health, /api/tracing/agents/:agentName/healthJWT sessionGET
Health/api/health/live, /api/health/readyPublicGET

Request Format ​

  • Content-Type: application/json (except file uploads)
  • Max body size: configurable via NEXT_BODY_SIZE_LIMIT (default 10MB)
  • Request IDs: Include request_id in the body for correlation

Response Format ​

All responses follow a consistent JSON structure:

Success:

json
{
  "data": { ... },
  "request_id": "req_abc123"
}

Error:

json
{
  "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.

CodeMeaning
200Success
201Created
400Bad request (missing/invalid parameters)
401Invalid or missing API token
403The 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
404Resource not found
409Conflict (duplicate resource)
422Unprocessable (validation failure)
429Rate limit exceeded
500Internal server error
503Service 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:

PlanRequest Limit
FREE1,000/month
STARTER10,000/month
PROFESSIONAL100,000/month
ENTERPRISEUnlimited
ON_PREMISEUnlimited

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.

Studio · Pulse · Console · Agent SDK and more — the Cognipeer documentation hub