Skip to content

API Reference Overview ​

Cognipeer Console 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 Console 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/evaluatePOST
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

Enterprise Client APIs ​

These client (token-authenticated) endpoints are part of the Enterprise edition and are only available on licensed deployments; they return 403 otherwise. 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
AI App Gateway/appgw/:gatewayKey[/u/:userId] (proxied coding-agent traffic — Anthropic Messages, OpenAI Chat/Responses shapes)POST

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