API Overview

Everything you need to know about integrating with the AI Search API.

Base URL

All API requests should be made to:

https://search-api.atriai.chat

This endpoint requires Bearer token authentication.

Authentication

The AI Search API uses Bearer tokens for authentication. Include your Bearer token in the Authorization header.

Header:
Authorization
Example:
Authorization: Bearer your-bearer-token-here
  • Bearer tokens are project-specific and must be active to function
  • Each project has separate Bearer tokens for different services
  • Keep your Bearer tokens secure and never share them publicly
  • Different subscription plans have different usage limits
  • Tokens are validated against the Supabase database and update last_used_at on each request

Request Format

The API accepts JSON requests with the following characteristics:

Content-Type:application/json

All requests must use JSON format

Method:POST

Currently, all 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 Bearer token

403Forbidden

Usage limits exceeded for your subscription plan

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": "Bearer token is required",
  "headers": {
    "WWW-Authenticate": "Bearer"
  }
}

Usage Limit Error

Status: 403
{
  "detail": "Searches limit exceeded. Upgrade your plan to continue searching."
}

Bad Request Error

Status: 400
{
  "detail": "search_type must be 'keyword' or 'hybrid'"
}

Rate Limits

API usage is limited based on your subscription plan:

  • Rate limits are applied per Bearer token
  • 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.