Introduction
ER:LC Russia AI API supports the Chat Completions, model listing and retrieval, and speech methods documented in this section. For chat, usechat.completions.create in an OpenAI SDK with base_url / baseURL set to https://api.erlcrussia.com/v1. ER:LC Russia extensions are documented on each method page; support for other OpenAI APIs is not implied.
OpenAI SDK
Chat requests use the Chat Completions format; streaming responses use
chat.completion.chunk. See the method reference for supported fields.Reasoning
Support step-by-step analysis and deep reasoning for models with thought translation in
reasoning_content.Conversation context
session_id is an ER:LC Russia extension for continuing a conversation.Images and files
Attaching game screenshots, logs and documents in the standard
image_url and file format.Authentication
To make requests, pass your access token in theAuthorization header:
erlcrussia-api-ai-key and erlcrussia-api-key headers are accepted too. Send the key only in request headers.
Errors
Errors use the OpenAI format, so SDKs show the real message.code is an OpenAI string code (invalid_api_key, model_not_found, insufficient_quota, rate_limit_exceeded) or null. The numeric ER:LC Russia code from the error codes table is in erlc_code.
OpenAI compatibility
/v1/chat/completions,/v1/models,/v1/audio/speechand/v1/audio/transcriptionswork with the OpenAI SDK./v1/realtimefollows the OpenAI Realtime protocol: text and voice in, voice out, with manual turns. See voice mode.temperature,top_p,max_tokens,max_completion_tokens,stop,nandresponse_formatare accepted but not applied.usageis part of the regular response. In a stream it arrives only withstream_options: {"include_usage": true}, as a separate chunk with emptychoicesbeforedata: [DONE].usagealso hascost_credits, the AI credits charged.- Errors use the OpenAI types
invalid_request_error,requests,insufficient_quotaandserver_error. When AI credits run out you get 429 with typeinsufficient_quota, as in OpenAI. - Every response has its own
idof the formchatcmpl-…, as in OpenAI. The conversation id travels separately insession_id. - A request without
messagesor with an empty array gets 400 withparam: "messages"and codemissing_required_parameterorempty_array. - Every response carries
x-request-id,openai-processing-ms,x-ratelimit-limit-requests,x-ratelimit-remaining-requestsandx-ratelimit-reset-requests. - If generation fails mid-stream, an OpenAI-format
{"error": {...}}event arrives, followed bydata: [DONE].
Available Models
For Hubert, the proprietary surzhik is turned off by default: he responds in the language of the user’s last message. Pass
"surzhyk": true in the body of the request to /v1/chat/completions to enable branding.
Message Roles
Themessages array supports standard dialog roles:
system- additional instructions or context for your project (for example, the role of a Discord bot or service tasks), superimposed on top of the basic rules of the model;user- message from the user;assistantis the model’s previous response to save the context of the conversation.
Reflection Options
Control of the chain of reasoning depends on the chosen model:- For Emmy (
emmy-1): no-thinking mode not supported - the model always analyzes the problem before answering. The analysis depth is configured by theeffort(string) parameter or theX-Reasoning-Effortheader: low- a brief check of facts and rules;medium(default) - balanced detailed analysis;high- comprehensive step-by-step analysis;extra/max- the maximum level of analytics with double-checking of hypotheses.- For Nya (
niya-1): Reflections are turned off by default for maximum speed. Enabled by thethinking: trueparameter (orvariant: "on"/X-Reasoning: onheader). - For Hubert (
hubert-1): chain of thought is not used.
Integration Examples
- Python
- TypeScript
- JavaScript
- cURL
- OpenCode
- Kilo Code
Streaming Mode
When transmitting"stream": true, the server returns the event stream text/event-stream. Each event contains the standard chat.completion.chunk structure: