Welcome to the Kortix API
The Kortix API provides a RESTful interface for building AI-powered applications. Access agent execution, thread management, file uploads, and more through a unified API.Base URLs
Kortix provides different base URLs depending on your environment:/v1 prefix. For example:
API Architecture
The Kortix API is built with:- FastAPI Framework: High-performance async Python API
- PostgreSQL Database: Powered by Supabase with real-time capabilities
- Redis Caching: For authentication, rate limiting, and performance optimization
- CloudWatch Metrics: System monitoring and logging (production)
Key Features
- Multi-tenancy: Account-based resource isolation
- Real-time Streaming: Server-Sent Events (SSE) for agent runs
- File Uploads: Support for multiple file types with validation
- Webhook Integration: Trigger-based automation
- Sandbox Execution: Isolated code execution environments
Rate Limits
The API implements several rate limiting mechanisms to ensure fair usage:Concurrent Request Limits
Maximum concurrent IP addresses allowed per instance
api.py:69
API Key Usage Throttling
API keylast_used_at timestamps are throttled to reduce database load:
Minimum seconds between last_used_at updates (default: 15 minutes)
core/services/api_keys.py:447-448
Billing-Based Limits
Rate limits vary by subscription tier:- Free Tier: Limited concurrent runs
- Paid Tiers: Higher concurrency and priority execution
- Enterprise: Custom limits
Request Format
All requests must include proper authentication headers:Content Types
The API accepts and returns JSON by default:multipart/form-data:
Response Format
All responses follow a consistent structure:HTTP status indicator (e.g., “ok”, “error”)
Response payload containing requested data
ISO 8601 timestamp of the response
Success Response Example
Health Check
Monitor API health and status:Health Response
api.py:444-465
Graceful Shutdown
During deployment, the health check returns503 when shutting down:
api.py:450-459
System Metrics
Access real-time system metrics:Total active agent runs across all instances
Number of active Redis stream keys
Streams without database records (should be 0)
api.py:480-496
CORS Configuration
The API supports cross-origin requests from:https://www.kortix.comhttps://kortix.comhttps://dev.kortix.comhttps://staging.kortix.comhttps://*.kortix.com(all subdomains)https://*-kortixai.vercel.app(Vercel preview deployments)http://localhost:3000(local development)
api.py:331-358
Allowed Methods
Allowed Headers
Next Steps
Authentication
Learn how to authenticate with API keys and JWT tokens
Error Handling
Understand error responses and status codes