Skip to main content

AI API Overview

The Informer AI API provides comprehensive endpoints for managing AI-powered conversations, models, budget control, and seat assignments. All routes are prefixed with /api.

Features

  • Chats - Create and manage AI conversations with streaming responses
  • Messages - Access and manipulate chat message history
  • Memories - Store and search conversation context using vector embeddings
  • Models - Configure AI models from multiple providers
  • Providers - Manage AI service provider credentials
  • Seats & Plans - Control user access and budget allocation
  • Budget & Usage - Track costs and consumption across tiers
  • Admin Tools - Tenant-wide configuration and monitoring

Authentication

All AI API endpoints require authentication via session cookies or API tokens. Most endpoints verify AI entitlements and seat assignments before allowing access.

Common Authorization Patterns

  • User endpoints - Require active AI seat (verified by ai.verify pre-block)
  • Admin endpoints - Require permission.tenant.superuser
  • Team settings - Require permission.team.manageAi(teamId)
  • Model/Provider management - Require permission.ai.manage

Rate Limiting

Chat endpoints enforce budget-based rate limiting:

  • Weekly budget - Resets every 7 days from seat assignment
  • Session budget - 6-hour rolling window
  • Tiered models - Costs vary by model tier (everyday, advanced, strategic)
  • Boost budget - Additional one-time budget purchased by admins

Streaming Responses

Several endpoints return Server-Sent Events (SSE) streams:

  • POST /api/chats/\{id\} - Chat message stream
  • POST /api/models/\{id\}/_chat - Direct model chat stream
  • POST /api/models/\{id\}/_completion - Text completion stream
  • POST /api/chats/\{id\}/messages/\{messageId\}/_explain - Message explanation stream

SSE responses use Content-Type: text/event-stream and support abort signals for cancellation.

Error Responses

Standard HTTP status codes:

  • 200 - Success
  • 400 - Bad request (validation error)
  • 403 - Forbidden (insufficient permissions or budget)
  • 404 - Resource not found
  • 500 - Internal server error

Error responses include:

{
"statusCode": 403,
"error": "Forbidden",
"message": "Insufficient budget remaining"
}

Common Query Parameters

Many list endpoints support:

  • limit - Number of results per page (default varies by endpoint)
  • offset - Pagination offset
  • planId - Filter by AI plan
  • assigned - Filter by assignment status

Next Steps

Explore the specific endpoint categories: