Documentation Index
Fetch the complete documentation index at: https://docs.ansa.so/llms.txt
Use this file to discover all available pages before exploring further.
Base URL
For self-hosted instances, use your configured API URL.
Authentication
Most endpoints require authentication via Bearer token. Get your API key from the dashboard:
- Go to Settings > API
- Click Generate API Key
- Copy and store securely
Include in requests:
Authorization: Bearer your-api-key
All responses return JSON:
{
"data": { ... },
"error": null
}
Error responses:
{
"data": null,
"error": {
"code": "UNAUTHORIZED",
"message": "Invalid API key"
}
}
Rate Limits
Rate limits depend on your plan:
| Plan | Requests/minute |
|---|
| Free | 20 |
| Starter | 60 |
| Growth | 200 |
| Pro | 1000 |
Rate limit headers are included in responses:
X-RateLimit-Limit: 60
X-RateLimit-Remaining: 59
X-RateLimit-Reset: 1699900000
Streaming
The chat endpoint uses Server-Sent Events (SSE) for real-time streaming:
curl -X POST https://api.ansa.so/chat \
-H "Content-Type: application/json" \
-d '{"agentId": "xxx", "messages": [{"role": "user", "content": "Hello"}]}'
Response events:
event: message_start
data: {"type":"message_start"}
event: content_block_delta
data: {"type":"content_block_delta","delta":{"text":"Hello"}}
event: content_block_delta
data: {"type":"content_block_delta","delta":{"text":"! How can I help?"}}
event: message_stop
data: {"type":"message_stop"}