Skip to main content

Base URL

Authentication

All API requests require an API key passed in the X-Cognisafe-Key header:
See Authentication for full details.

OpenAPI spec

The full OpenAPI 3.1 spec is available at:
You can import this into Postman, Insomnia, or any OpenAPI-compatible tool:
Interactive docs (Swagger UI) are available at /docs on any self-hosted instance.

Endpoint groups

/internal/log

Used by the SDK and proxy to ship request/response payloads. Not intended for direct use by application code.

/api/requests

Query logged LLM requests for a project.

/api/safety-scores

Query safety scoring results.

/api/billing

Subscription and usage data.

/webhook/stripe

Stripe webhook endpoint. Cognisafe verifies the Stripe-Signature header using STRIPE_WEBHOOK_SECRET. Do not call this endpoint directly.

Rate limits

API rate limiting is applied at the project level based on subscription tier: When the limit is exceeded, POST /internal/log returns HTTP 429 Too Many Requests. Other endpoints are not rate-limited by tier.

Response format

All responses are JSON. Errors follow this shape:
Successful list responses: