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.

Header:
Authorization
Example:
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:

Content-Type:application/json

All requests must use JSON format

Method:POST

Most endpoints use POST method

Encoding:UTF-8

All text content should be UTF-8 encoded

Error Handling

The API uses standard HTTP status codes to indicate success or failure:

200OK

Request successful

400Bad Request

Invalid request parameters or format

401Unauthorized

Invalid or missing API key

500Internal Server Error

Server error during request processing

Error Response Format

Error responses follow this format:

detail:string - Description of the error
headers:object - Additional headers (for authentication errors)

Error Examples

Authentication Error

Status: 401
{
  "detail": "Invalid API key",
  "headers": {
    "WWW-Authenticate": "Bearer"
  }
}

Bad Request Error

Status: 400
{
  "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.