API reference
API overview and authentication
This article explains Yomi API's basics: the service address, authentication, available endpoints and common error codes. See the individual articles for detailed parameters and examples.
Basics
- API address: https://api.yomiapi.com; all OpenAI-compatible paths use
/v1as their prefix - Authentication: HTTP Header
Authorization: Bearer <API_KEY> - Request format:
Content-Type: application/json, encoded as UTF-8 - Compatibility: endpoints are compatible with the OpenAI format. Point the official SDK's
base_urltohttps://api.yomiapi.com/v1to use it directly
Choose the protocol you need. Switch tabs to see its Base URL:
Use this for the OpenAI SDK and all compatible tools:
https://api.yomiapi.com/v1Native Anthropic SDK format, without /v1 in the address (endpoint: /v1/messages):
https://api.yomiapi.comNative Gemini generateContent format:
https://api.yomiapi.com/v1beta/models/{model}:generateContentAuthentication
Create a key in API Keys in the console, then include it in the headers of every request:
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json
Endpoint overview
| Endpoint | Description |
|---|---|
POST /v1/chat/completions | Chat completions with streaming; the most commonly used endpoint |
POST /v1/completions | Legacy text completions, retained for compatibility |
POST /v1/messages | Native Anthropic Claude format |
POST /v1/responses | OpenAI Responses format; also available: /v1/responses/compact |
POST /v1/images/generations | Image generation |
POST /v1/images/edits | Image editing |
POST /v1/video/generations | Video generation (asynchronous tasks); also available in OpenAI-compatible form at POST /v1/videos. See Veo 4 video generation in the Media generation section |
POST /v1/embeddings | Embeddings |
POST /v1/audio/transcriptions | Audio transcription |
POST /v1/audio/translations | Audio translation |
POST /v1/audio/speech | Speech synthesis |
POST /v1/moderations | Text moderation |
POST /v1/rerank | Reranking |
GET /v1/models | List models; /v1/models/{model} retrieves one model |
GET /v1/realtime | WebSocket realtime endpoint |
Native-format endpoints
In addition to the OpenAI-compatible format, the platform provides native provider formats. Claude models can use POST /v1/messages (Anthropic Messages format); Gemini models can use the native path:
POST https://api.yomiapi.com/v1beta/models/{model}:generateContent
Unsupported endpoints
The following OpenAI endpoints are not enabled on the platform: /v1/images/variations (image variations), /v1/files (file management), /v1/fine-tunes (fine-tuning). The platform does not support fine-tuning or Files management.
Quick verification
Use this request to test your key and network connection. A reply confirms successful setup:
curl https://api.yomiapi.com/v1/chat/completions \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "deepseek-v4-flash",
"messages": [
{"role": "user", "content": "Hello, please introduce yourself."}
]
}'
Add "stream": true to the request body to enable streaming. See the Chat Completions article for details.
Common error codes
| Error code | Meaning | Recommended action |
|---|---|---|
| 400 | Invalid request parameters | Check the request body format and parameter values |
| 401 | Invalid or missing API key | Check that Authorization header and key status |
| 403 | Access denied or insufficient quota | Check the key's group and available-model settings; verify your account balance and subscription status |
| 404 | Model or path not found | Check the model ID and request path |
| 413 | Request body too large | Check uploaded file sizes (images, videos, etc.), compress them and retry |
| 429 | Rate limit exceeded | Reduce the request rate and retry with exponential backoff |
| 500 | Internal server error | Try again later |
| 502 | Upstream service error | Try again later or temporarily use another model |
| 503 | Service temporarily unavailable | Try again later or temporarily use another model |
Recommendations
- Key management: Supply keys through environment variables. Use separate keys for each project or environment so you can control and revoke them independently.
- Retries: Use exponential backoff for 429 and 5xx errors. Model rate limits are listed in the Model Catalog's route information.
- Cost control: Set
max_tokensappropriately to avoid unnecessarily long output. - User experience: Enable streaming for long text generated for end users.
