API Overview
REST API reference for Ctrl AI — base URL, authentication, rate limits, errors, and pagination.
The Ctrl AI REST API provides programmatic access to the full platform: run inference queries, manage units and workflows, query audit logs, and administer organizations.
Base URL
# Cloud
https://app.ctrlai.com/api/v1
# Self-hosted
https://your-domain.com/api/v1Authentication
All API requests require authentication via either:
- API Key —
Authorization: Bearer ctrlai_pk_... - Session Cookie — automatically set when signed in via the web UI
See Authentication for details on creating and managing API keys.
Request Format
- Content-Type:
application/json - All request bodies are JSON
- Query parameters for GET requests (filtering, pagination)
Response Envelope
All responses follow a consistent format:
// Success
{
"data": { ... },
"meta": {
"total": 42,
"limit": 20,
"offset": 0
}
}
// Error
{
"error": {
"code": "VALIDATION_ERROR",
"message": "Invalid input",
"details": {
"field": "query",
"issue": "Required"
}
}
}Error Codes
| HTTP Status | Code | Meaning |
|---|---|---|
| 400 | VALIDATION_ERROR | Invalid request body or parameters |
| 401 | UNAUTHORIZED | Missing or invalid authentication |
| 403 | FORBIDDEN | Insufficient role permissions |
| 404 | NOT_FOUND | Resource does not exist |
| 409 | CONFLICT | Resource already exists |
| 429 | RATE_LIMITED | Too many requests |
| 500 | INTERNAL_ERROR | Server error |
Rate Limits
| Tier | Limit | Endpoints |
|---|---|---|
| Read | 60 req/min | GET endpoints |
| Write | 30 req/min | POST, PATCH, DELETE endpoints |
| Strict | 5 req/min | Auth endpoints |
Rate limit headers are included in every response:
X-RateLimit-LimitX-RateLimit-RemainingRetry-After(on 429 responses)
Pagination
List endpoints support pagination via query parameters:
| Parameter | Type | Default | Description |
|---|---|---|---|
limit | number | 20 | Items per page (max 200) |
offset | number | 0 | Number of items to skip |
Endpoints
| Resource | Endpoints | Description |
|---|---|---|
| Inference | POST /inference | Run AI queries with trust-tagged responses |
| Units | CRUD + verify | Manage reasoning units |
| Workflows | CRUD + compose | Manage workflow compositions |
| Domains | CRUD + members | Manage knowledge domains |
| Organizations | CRUD + members + keys | Manage orgs, members, API keys |
| Audit | GET | Query audit and inference logs |