API Reference
ChatSonic API
Integrate ChatSonic's AI capabilities directly into your applications with our simple REST API.
REST API
Simple HTTP requests with JSON responses
API Keys
Secure authentication with bearer tokens
Streaming
Real-time responses with Server-Sent Events
Authentication
All API requests require authentication using a Bearer token in the Authorization header. You can generate API keys from your account dashboard.
Authorization: Bearer YOUR_API_KEYBase URL
https://api.chatsonic.ai/v1Endpoints
POST
/api/v1/chat/completionsCreate a chat completion
curl -X POST https://api.chatsonic.ai/v1/chat/completions \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-4",
"messages": [
{"role": "user", "content": "Hello!"}
]
}'GET
/api/v1/modelsList available models
curl https://api.chatsonic.ai/v1/models \
-H "Authorization: Bearer YOUR_API_KEY"GET
/api/v1/usageGet your usage statistics
curl https://api.chatsonic.ai/v1/usage \
-H "Authorization: Bearer YOUR_API_KEY"Available Models
| Model ID | Name | Provider | Context Window |
|---|---|---|---|
| gpt-4 | GPT-4 | OpenAI | 8,192 tokens |
| gpt-4-turbo | GPT-4 Turbo | OpenAI | 128,000 tokens |
| claude-3-opus | Claude 3 Opus | Anthropic | 200,000 tokens |
| claude-3-sonnet | Claude 3 Sonnet | Anthropic | 200,000 tokens |
| gemini-pro | Gemini Pro | 32,000 tokens | |
| llama-3-70b | Llama 3 70B | Meta | 8,192 tokens |
Rate Limits
Free Tier
100 requests/day
Pro Tier
1,000 requests/day
Unlimited Tier
Unlimited requests
SDKs & Libraries
Python
Coming soon
Node.js
Coming soon
Go
Coming soon
Ruby
Coming soon