Yomi APIYomi APIDocs Open console

中文

Yomi API / Documentation / API overview and authentication

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 /v1 as 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_url to https://api.yomiapi.com/v1 to 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/v1

Native Anthropic SDK format, without /v1 in the address (endpoint: /v1/messages):

https://api.yomiapi.com

Native Gemini generateContent format:

https://api.yomiapi.com/v1beta/models/{model}:generateContent

Authentication

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
An API key grants access to spend your account balance. Store it in an environment variable or secret-management service, never in frontend code, client installation packages or public repositories. If a key leaks, immediately delete it in API Keys and create a replacement.

Endpoint overview

EndpointDescription
POST /v1/chat/completionsChat completions with streaming; the most commonly used endpoint
POST /v1/completionsLegacy text completions, retained for compatibility
POST /v1/messagesNative Anthropic Claude format
POST /v1/responsesOpenAI Responses format; also available: /v1/responses/compact
POST /v1/images/generationsImage generation
POST /v1/images/editsImage editing
POST /v1/video/generationsVideo 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/embeddingsEmbeddings
POST /v1/audio/transcriptionsAudio transcription
POST /v1/audio/translationsAudio translation
POST /v1/audio/speechSpeech synthesis
POST /v1/moderationsText moderation
POST /v1/rerankReranking
GET /v1/modelsList models; /v1/models/{model} retrieves one model
GET /v1/realtimeWebSocket 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 codeMeaningRecommended action
400Invalid request parametersCheck the request body format and parameter values
401Invalid or missing API keyCheck that Authorization header and key status
403Access denied or insufficient quotaCheck the key's group and available-model settings; verify your account balance and subscription status
404Model or path not foundCheck the model ID and request path
413Request body too largeCheck uploaded file sizes (images, videos, etc.), compress them and retry
429Rate limit exceededReduce the request rate and retry with exponential backoff
500Internal server errorTry again later
502Upstream service errorTry again later or temporarily use another model
503Service temporarily unavailableTry 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_tokens appropriately to avoid unnecessarily long output.
  • User experience: Enable streaming for long text generated for end users.