AI SmartTalk Public API v1
Complete API documentation for AI SmartTalk platform.
Authentication
OAuth 2.0 for Chat (recommended for mobile apps)
Flow:
GET /api/oauth/aist/authorize- Start authorization (with PKCE for mobile)- User logs in and selects chatModel
POST /api/oauth/aist/token- Exchange code for access token- Use access token directly with chat endpoints:
Authorization: Bearer <ACCESS_TOKEN>
That's it. The OAuth access token works directly with /api/chat, /api/chat/voice, etc.
Alternative: Anonymous (no auth required)
If the chatModel allows anonymous users, no token is needed.
Legacy: JWT with x-use-chatbot-auth
For integrations that exchange tokens via /api/auth/oauth:
Authorization: Bearer <JWT_TOKEN>
x-use-chatbot-auth: true
For API v1 endpoints (admin context):
Authorization: Bearer <API_TOKEN>- API token or OAuth access tokenx-chat-model-id: <CHAT_MODEL_ID>- Required for most endpoints
Base Paths
Important: Different endpoint groups use different base paths:
- Chat & Voice endpoints:
/api/chat/*and/api/chat/voice* - Voice v1 endpoints:
/api/v1/voice/* - All other v1 endpoints:
/api/v1/*
Each endpoint specifies its correct server/base path.
Streaming Support
Chat and Voice endpoints support Server-Sent Events (SSE) for real-time streaming:
- Add
?stream=truequery parameter orstream: truein request body - Receive events:
stream_start,token,tool_start,tool_end,agent_response,stream_end - Voice endpoints also emit:
transcription,tts_start,tts_complete
See the Streaming API Implementation Guide for detailed examples with React hooks.
CORS
All endpoints support CORS for browser-based clients when properly authenticated.
Rate Limiting
Please implement reasonable rate limiting on your side. Excessive requests may be throttled.
Authentication
- HTTP: Bearer Auth
- API Key: ChatModelId
API Token (Bearer token or x-api-key header)
Security Scheme Type: | http |
|---|---|
HTTP Authorization Scheme: | bearer |
Chat Model ID
Security Scheme Type: | apiKey |
|---|---|
Header parameter name: | x-chat-model-id |