# openaiapi > OpenAI-compatible API to GPT, Claude, Gemini, DeepSeek, GLM, Kimi and other language models, prepaid and billed in Russian rubles per token. One API key and one base URL for every model; switch models with the `model` string. Any OpenAI SDK or tool that lets you set a base URL works unchanged. Key facts for agents: - Base URL: `https://api.openaiapi.ru/v1` - Auth: `Authorization: Bearer `. Keys look like `sk-` followed by 64 hex characters. Get one at https://openaiapi.ru/c/register (sign-in by an emailed code). - Model IDs are `vendor/model`; the bare name works too (`gpt-6-sol` is `openai/gpt-6-sol`). E.g. `openai/gpt-6-sol`, `anthropic/claude-sonnet-5`, `google/gemini-3.8-flash`, `deepseek/deepseek-v4.1-flash`. Never guess an ID: read the live catalog. - Text only. Streaming (`"stream": true`), tool/function calling and `response_format` (`json_object`, `json_schema`) work. Images, audio and file inputs are rejected with `400`. Request body up to 8 MiB. - Limits per key by default: 600 requests per minute, 64 concurrent requests. Each gateway server counts them on its own, so they stop runaway loops rather than meter traffic; the real ceiling may be higher. A key can have its own spending cap. - Errors use the OpenAI error format. Every generation response carries an `x-request-id` header: quote it to support. A request that fails before the answer starts is not charged. - `400` `invalid_request` (`param` names the field), `context_length_exceeded`, `content_policy_violation`: fix the request, do not retry as is. - `401` `invalid_api_key`: no key, wrong key or revoked. - `404` `model_not_found`: wrong model ID or a model of another `kind`. - `413` `request_too_large`: body over 8 MiB. - `429` `rate_limit_exceeded`: slow down and retry. `429` `insufficient_quota`: balance or key cap exhausted, top up or raise the cap; do not retry. - `502` `upstream_unavailable` or `upstream_error`, `503` `service_unavailable`, `504` `upstream_timeout` (no first byte in 300 s): retry later. - Reliability: a model has several providers. If one fails before the first byte (timeout, 429, 5xx), the request moves to another automatically. The price stays the same: one price per model, whichever provider answers. - Privacy: request and response texts are not stored, only metadata for billing (time, model, key, tokens, cost). ## API - [OpenAPI 3.1 spec (JSON)](https://openaiapi.ru/openapi.json): the four endpoints below with the request fields the gateway accepts, what it refuses and every error code. - [Model catalog (JSON, no auth)](https://openaiapi.ru/api/catalog): every model with its display name, `kind` (`chat` or `embedding`), context length, `price` in RUB per 1M tokens (`in`, `cached`, `out`; `out` is 0 for embeddings) and `providers`, how many providers serve it. The price is what you are charged. Cached for 60 s, CORS open. - `GET https://api.openaiapi.ru/v1/models` (with a key): the same catalog in OpenAI list format. - `POST https://api.openaiapi.ru/v1/chat/completions`: Chat Completions, as in the OpenAI API. - `POST https://api.openaiapi.ru/v1/responses`: Responses API without server-side state: `previous_response_id`, `conversation` and `background` are refused, send the full input every time. - `POST https://api.openaiapi.ru/v1/embeddings`: embeddings, for models of `kind` `embedding` (Qwen3 Embedding 8B and 4B, OpenAI text-embedding-3 large and small, Gemini Embedding 2). ## Quickstart curl: ```sh curl https://api.openaiapi.ru/v1/chat/completions \ -H "Authorization: Bearer $OPENAI_API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"openai/gpt-6-sol","messages":[{"role":"user","content":"Hello"}]}' ``` Python (`pip install openai`): ```python from openai import OpenAI client = OpenAI(base_url="https://api.openaiapi.ru/v1", api_key="sk-...") r = client.chat.completions.create( model="openai/gpt-6-sol", messages=[{"role": "user", "content": "Hello"}], ) print(r.choices[0].message.content) ``` Node.js (`npm i openai`): ```js import OpenAI from "openai"; const client = new OpenAI({ baseURL: "https://api.openaiapi.ru/v1", apiKey: "sk-..." }); const r = await client.chat.completions.create({ model: "openai/gpt-6-sol", messages: [{ role: "user", content: "Hello" }], }); ``` Environment for SDKs and tools that read the standard variables (Codex CLI, most OpenAI SDKs): ```sh export OPENAI_BASE_URL="https://api.openaiapi.ru/v1" export OPENAI_API_KEY="sk-..." ``` n8n: Credentials → OpenAI API, set API Key and Base URL `https://api.openaiapi.ru/v1`. Migrating from OpenAI: change `base_url` and the key. Model names work as is (`gpt-6-sol` is `openai/gpt-6-sol`). The rest of the code stays. ## Billing - Prices are in rubles per 1 million tokens, input and output separately, cached input cheaper. One price per model, whichever provider answers. The catalog above is the source of truth; prices can change, the catalog always shows the current ones. - Prepaid balance, top-up from 1 000 ₽ in the cabinet by card (Mir, Visa, Mastercard), SBP or T-Pay through T-Bank. When the balance runs out, requests return `429 insufficient_quota`. - The unspent paid balance is refundable on request; bonus credit is not. ## Account - [Cabinet](https://openaiapi.ru/c/): keys with spending caps and reissue, projects, balance forecast, per-request log with model, key, tokens and cost and CSV export, low-balance emails. - Support: support@openaiapi.ru. ## Legal (Russian) - [Public offer](https://openaiapi.ru/legal/offer) - [Refunds and cancellation](https://openaiapi.ru/legal/refund) - [Service delivery and geography](https://openaiapi.ru/legal/delivery) - [Privacy policy](https://openaiapi.ru/legal/privacy) - [Personal data consent](https://openaiapi.ru/legal/pd) - [Payment security](https://openaiapi.ru/legal/security) - [Contacts and company details](https://openaiapi.ru/legal/contacts) ## Optional - [Codex CLI setup (Russian)](https://openaiapi.ru/codex) - [OpenAI models (Russian)](https://openaiapi.ru/openai-api) and [Claude models (Russian)](https://openaiapi.ru/claude-api): prices and IDs. - [API docs (Russian)](https://openaiapi.ru/docs): quickstart, authentication, models, Chat Completions, Responses, Embeddings with supported and refused parameters, streaming, function calling, every error code, limits, Cursor and Codex setup, samples in curl, Python, Node.js. - [Landing page (Russian)](https://openaiapi.ru/): models and prices, how the cabinet looks, FAQ.