API referenceСправочник API
Everything a client needs to call the gateway: base URLs, endpoints, authentication, streaming and error codes. The values below are what the gateway actually answers.Всё, что нужно клиенту для вызова шлюза: base URL, эндпоинты, аутентификация, стриминг и коды ошибок. Значения ниже — то, что шлюз реально отвечает.
One key speaks both protocols. Point an OpenAI-compatible client at /v1 and an Anthropic client at the root.Один ключ говорит на двух протоколах. OpenAI-совместимый клиент смотрит на /v1, Anthropic-клиент — на корень.
OpenAI-compatible base URLBase URL для OpenAI-совместимых
https://llmcode.io/v1POST /chat/completions, /responses, /embeddings; GET /models.POST /chat/completions, /responses, /embeddings; GET /models.
Anthropic Messages base URLBase URL для Anthropic Messages
https://llmcode.ioPOST /v1/messages. No /v1 in the base URL expected by the SDK.POST /v1/messages. В base URL для SDK — без /v1.
OpenAI authenticationАутентификация OpenAI
Authorization: Bearer $LLMCODE_API_KEYThe token starts with sk-llmcode-.Токен начинается с sk-llmcode-.
Anthropic authenticationАутентификация Anthropic
x-api-key: $LLMCODE_API_KEYSend anthropic-version: 2023-06-01 as with the native API.Передайте anthropic-version: 2023-06-01, как в нативном API.
The public surface of the gateway. Everything else returns 404.Публичная поверхность шлюза. Всё остальное возвращает 404.
| PathПуть | What it doesНазначение | |
|---|---|---|
| POST | /v1/chat/completions | OpenAI-compatible chat. Streaming is supported.OpenAI-совместимый чат. Стриминг поддерживается. |
| POST | /v1/messages | Anthropic Messages. Send x-api-key and the anthropic-version header. Streaming is supported.Anthropic Messages. Передайте x-api-key и заголовок anthropic-version. Стриминг поддерживается. |
| POST | /v1/responses | OpenAI-compatible responses. Streaming is not available in this version: stream: true returns 400.OpenAI-совместимые responses. Стриминг в этой версии недоступен: запрос со stream: true получает 400. |
| POST | /v1/embeddings | Text embeddings. POST a list of strings as input.Эмбеддинги текста. В теле передаётся список строк в параметре input. |
| GET | /v1/models | List the published profiles available to the token.Список опубликованных профилей, доступных токену. |
| GET | /v1/models/:id | A single published profile. Unknown or unpublished ids return 404.Один опубликованный профиль. Неизвестный или неопубликованный id возвращает 404. |
Which endpoints stream, and the one that does not in this version.Какие эндпоинты стримят и какой в этой версии не стримит.
Chat completionsChat completions
Streaming is supported: send stream: true and read server-sent events. The request id stays constant across chunks.Стриминг поддерживается: передайте stream: true и читайте server-sent events. request id не меняется между чанками.
Anthropic MessagesAnthropic Messages
Messages streaming is supported with the same client flow as the native API.Стриминг messages поддерживается тем же потоком, что и нативный API.
ResponsesResponses
Responses with stream: true returns 400 in this version. Use chat completions for streaming.Responses со stream: true возвращает 400 в этой версии. Для стриминга используйте chat completions.
| HTTP | CodeКод | MeaningЗначение |
|---|---|---|
| 400 | invalid_request_body | The request body, model or messages field is not valid.Тело запроса, модель или поле сообщений неверны. |
| 401 | invalid_api_key | The token is missing, invalid, revoked or expired.Токен отсутствует, неверен, отозван или истёк. |
| 402 | insufficient_quota | The account balance or the token limit is too low.Недостаточно баланса аккаунта или лимита токена. |
| 403 | model_not_allowed | The token is not allowed to use this profile.Токену не разрешён этот профиль. |
| 403 | ip_not_allowed | The request IP is not in the token IP list.IP запроса не входит в список IP токена. |
| 404 | model_not_found | The profile is not published or has no active price.Профиль не опубликован или у него нет действующей цены. |
| 429 | rate_limit_exceeded | The request rate limit is exceeded.Превышен лимит частоты запросов. |
| 500 | internal_error | Unexpected gateway error. A retry with the same request id is safe.Непредвиденная ошибка шлюза. Повтор с тем же request id безопасен. |
| 503 | upstream_unavailable | The upstream is unavailable; the hold is released.Апстрим недоступен; удержание снимается. |
Paste-ready configs for the clients you already use, with the token kept in an environment variable.Готовые конфиги для знакомых вам клиентов; токен остаётся в переменной окружения.
Model names in the API are LLMcode profiles with their own routing. They do not mean direct access to the same-named models of OpenAI LLC or Anthropic PBC. Trademarks belong to their owners. The service is independent and is not affiliated with OpenAI or Anthropic.Названия моделей в API — профили LLMcode с собственной маршрутизацией. Они не означают прямой доступ к одноимённым моделям OpenAI LLC или Anthropic PBC. Товарные знаки принадлежат их правообладателям. Сервис независим и не аффилирован с OpenAI/Anthropic.