API
REST API
Programmatic access to Sazabi via HTTP endpoints.
The Sazabi REST API provides full programmatic access to your observability data, threads, and configuration. Use it to build custom integrations, automate workflows, and extend Sazabi's capabilities.
Overview
The API uses standard HTTP conventions:
- JSON for request and response bodies
- API keys for authentication
- Cursor-based pagination for list endpoints
- Consistent error responses across all endpoints
Base URLs
| Service | URL | Purpose |
|---|---|---|
| API | https://api.sazabi.com | Core API (threads, config) |
| Intake | https://intake.sazabi.com | Log ingestion |
| OTLP Intake | https://otlp.intake.sazabi.com | OpenTelemetry ingestion |
Quick example
# List your threads
curl https://api.sazabi.com/threads \
-H "x-sazabi-secret-key: sk_live_your_secret_key"
# Send a message to the AI assistant
curl -X POST https://api.sazabi.com/threads/thr_abc123/messages \
-H "x-sazabi-secret-key: sk_live_your_secret_key" \
-H "Content-Type: application/json" \
-d '{"content": "What errors happened in the last hour?"}'
# Send logs
curl -X POST https://intake.sazabi.com/v1/logs \
-H "x-sazabi-key: pk_live_your_public_key" \
-H "Content-Type: application/json" \
-d '{"message": "User signed in", "level": "info"}'Documentation
Authentication
Learn about API keys and how to authenticate requests.
Endpoints
Complete reference for all available API endpoints.
Error Codes
Reference for error responses and how to handle them.
Workflows
Common patterns for API integration.
Response format
All API responses follow a consistent envelope format:
{
"data": { ... },
"error": null
}Error responses include a code and message:
{
"data": null,
"error": {
"code": "UNAUTHORIZED",
"message": "Invalid API key"
}
}Rate limits
The API enforces rate limits to ensure fair usage:
- Default limit: 1000 requests per minute
- Burst allowance: Short bursts above the limit are permitted
Rate limit headers are included in every response:
| Header | Description |
|---|---|
X-RateLimit-Limit | Maximum requests allowed per window |
X-RateLimit-Remaining | Requests remaining in current window |
X-RateLimit-Reset | Unix timestamp when the window resets |