API Reference
API Overview
Endpoints, authentication, errors, and protocol entry points
Base URL
https://api.sunai.lolFor OpenAI-compatible requests, include /v1: https://api.sunai.lol/v1
See Endpoints for the complete address list.
Authentication
Authorization: Bearer sk-your-tokenThe token group determines which models are available.
Protocols
| Protocol | Documentation |
|---|---|
| OpenAI compatible | OpenAI |
| Async image generation | Async Image |
| Anthropic compatible | Anthropic |
| Gemini compatible | Gemini |
Common errors
| Status | Meaning | What to do |
|---|---|---|
| 401 | Authentication failed | Check the API key and token status |
| 404 or model not found | Wrong group or model name | Compare the token group with the model catalog |
| 429 | Rate limit reached | Reduce concurrency or use another group |
| 5xx or timeout | Provider or network problem | Check the status page and try api2.sunai.lol |
For detailed troubleshooting, see the FAQ.