Ctrl AI

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

Authentication

All API requests require authentication via either:

  • API KeyAuthorization: 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 StatusCodeMeaning
400VALIDATION_ERRORInvalid request body or parameters
401UNAUTHORIZEDMissing or invalid authentication
403FORBIDDENInsufficient role permissions
404NOT_FOUNDResource does not exist
409CONFLICTResource already exists
429RATE_LIMITEDToo many requests
500INTERNAL_ERRORServer error

Rate Limits

TierLimitEndpoints
Read60 req/minGET endpoints
Write30 req/minPOST, PATCH, DELETE endpoints
Strict5 req/minAuth endpoints

Rate limit headers are included in every response:

  • X-RateLimit-Limit
  • X-RateLimit-Remaining
  • Retry-After (on 429 responses)

Pagination

List endpoints support pagination via query parameters:

ParameterTypeDefaultDescription
limitnumber20Items per page (max 200)
offsetnumber0Number of items to skip

Endpoints

ResourceEndpointsDescription
InferencePOST /inferenceRun AI queries with trust-tagged responses
UnitsCRUD + verifyManage reasoning units
WorkflowsCRUD + composeManage workflow compositions
DomainsCRUD + membersManage knowledge domains
OrganizationsCRUD + members + keysManage orgs, members, API keys
AuditGETQuery audit and inference logs

On this page