AI Chat API Overview
Everything you need to know about integrating with the AI Chat API.
Base URL
All API requests should be made to:
https://chat-api.atriai.chat
This endpoint requires Bearer token authentication with a valid API key.
Authentication
The AI Chat API uses Bearer token authentication with API keys. Include your API key in the Authorization header.
Authorization
Authorization: Bearer your-api-key-here
- API keys are project-specific and must be active to function
- Each project has separate API keys for Chat and Search services
- Keep your API keys secure and never share them publicly
- Different subscription plans have different usage limits
Request Format
The API accepts JSON requests with the following characteristics:
All requests must use JSON format
Most endpoints use POST method
All text content should be UTF-8 encoded
Error Handling
The API uses standard HTTP status codes to indicate success or failure:
Request successful
Invalid request parameters or format
Invalid or missing API key
Server error during request processing
Error Response Format
Error responses follow this format:
Error Examples
Authentication Error
{ "detail": "Invalid API key", "headers": { "WWW-Authenticate": "Bearer" } }
Bad Request Error
{ "detail": "Either chat_id or consumer_id must be provided" }
Rate Limits
API usage is limited based on your subscription plan:
- Rate limits are applied per API key
- Limits vary by subscription tier
- Usage is tracked automatically
- Contact support if you need higher limits
Security
Do not use this API for client-side calls as you will be exposing your API key.