Overview
The Chat API is the core endpoint for conversational AI, content generation, and text completion. It provides access to powerful language models with streaming responses for real-time interactions.This reference includes all request/response schemas, parameters, and interactive examples you can test directly.
Base URL
Authentication
All API requests require authentication using your API key:Learn more about API key generation and management.
Endpoints
Quick Example
Here’s a simple example to get you started:Common Patterns
System Messages
Use system messages to set the AI’s behavior and context:Multi-turn Conversations
Include conversation history for context:Content Generation
Structure prompts for specific content types:Error Handling
All errors return a consistent format:400 Bad Request
400 Bad Request
Invalid request format or missing required fields.Example:
401 Unauthorized
401 Unauthorized
403 Forbidden
403 Forbidden
Token limit exceeded or insufficient permissions.Example:
429 Too Many Requests
429 Too Many Requests
Rate limit exceeded.Example:
500 Internal Server Error
500 Internal Server Error
Server-side error occurred.Example:
Rate Limits
Token-based Limits
Usage measured in tokens (input + output)
Request Rate
No hard limits, but monitored for abuse
Workspace Quotas
Monthly token limits per workspace
Concurrent Requests
Multiple simultaneous requests supported
Best Practices
Request Optimization
Efficient Prompting
Efficient Prompting
- Be specific and clear in your instructions
- Use system messages to set context once
- Keep conversation history relevant and concise
Conversation Management
Conversation Management
- Trim old messages to stay within token limits
- Keep only relevant context for the current task
- Use consistent message formatting
Error Handling
Error Handling
- Always check response status codes
- Implement retry logic for transient errors
- Provide user-friendly error messages
SDK Libraries
JavaScript/TypeScript
Official and community libraries for Node.js and browsers
Python
Async and sync clients with full type support
Go
Community-maintained Go client library
Official SDKs are coming soon! For now, use the examples in our code examples section.
Testing Tools
API Testing
Use tools like Postman, Insomnia, or curl for testing:Load Testing
For production readiness testing:Support
Documentation
Comprehensive guides and examples
Community
Join discussions with other developers
Support
Contact support through your workspace
Status Page
Monitor API status and uptime

