AI for 1C: Claude, GPT and DeepSeek for 1C developers and straight from your configuration — without a VPN
An AI model helps with 1C in two ways. For developers it writes and explains code in the 1C language: modules, queries, data processors. And from the configuration itself you can call it over HTTPСоединение — to parse an email, draft a product description or answer a customer. Through RuAPI both work with one key: Claude, GPT, DeepSeek and Qwen are available from Russia without a VPN, paid in USDT, only for the tokens you use.
&НаСервере
Функция СпроситьНейросеть(ТекстВопроса, Модель = "deepseek-flash") Экспорт
// ключ храните в безопасном хранилище, не в коде
КлючAPI = "sk-...";
Сообщение = Новый Структура("role, content", "user", ТекстВопроса);
Сообщения = Новый Массив;
Сообщения.Добавить(Сообщение);
Тело = Новый Структура("model, messages", Модель, Сообщения);
ЗаписьJSON = Новый ЗаписьJSON;
ЗаписьJSON.УстановитьСтроку();
ЗаписатьJSON(ЗаписьJSON, Тело);
СтрокаТела = ЗаписьJSON.Закрыть();
Соединение = Новый HTTPСоединение("www.ruapi.ai", 443, , , , 300,
Новый ЗащищенноеСоединениеOpenSSL);
Заголовки = Новый Соответствие;
Заголовки.Вставить("Content-Type", "application/json; charset=utf-8");
Заголовки.Вставить("Authorization", "Bearer " + КлючAPI);
Запрос = Новый HTTPЗапрос("/v1/chat/completions", Заголовки);
// без BOM: иначе перед JSON окажутся лишние 3 байта
Запрос.УстановитьТелоИзСтроки(СтрокаТела, КодировкаТекста.UTF8,
ИспользованиеByteOrderMark.НеИспользовать);
Ответ = Соединение.ОтправитьДляОбработки(Запрос);
ТекстОтвета = Ответ.ПолучитьТелоКакСтроку(КодировкаТекста.UTF8);
Если Ответ.КодСостояния <> 200 Тогда
ВызватьИсключение "HTTP " + Ответ.КодСостояния + ": " + ТекстОтвета;
КонецЕсли;
ЧтениеJSON = Новый ЧтениеJSON;
ЧтениеJSON.УстановитьСтроку(ТекстОтвета);
Данные = ПрочитатьJSON(ЧтениеJSON, Истина);
Возврат Данные["choices"][0]["message"]["content"];
КонецФункцииA function for a form module (in a server common module remove the &НаСервере line): it sends a question to the model and returns the reply text. Needs platform 8.3.6 or newer (ЧтениеJSON / ЗаписьJSON). Don’t keep the key in code — use secure storage or a constant with restricted access.
What gets in the way of using AI in 1C
Strong models are not available in Russia directly.
Anthropic and OpenAI do not offer their APIs in Russia: it is missing from their supported-country lists (anthropic.com/supported-countries, developers.openai.com, checked 10 Nov 2026). Using them needs a foreign card and a VPN, and a VPN is usually not allowed on a 1C server. With RuAPI requests go straight to www.ruapi.ai, and the key is issued right after sign-up.
Models know the 1C language worse than Python or JavaScript.
There is little public code in the 1C language, so weaker models mix up methods and invent ones that do not exist. For 1C code use strong models — claude-sonnet-5-5, claude-opus-5-5, gpt-6.1-sol — and give them context: the module text, the metadata structure, an example of a similar procedure. Always check generated code in the Designer.
Calling an HTTP service from 1C has its pitfalls.
Typical mistakes: a UTF-8 body with a BOM (the server cannot parse the JSON), an old platform without the needed root certificate, a timeout too short for a long reply, a request from the client instead of the server. The ready-made function is in the example at the top of the page; the checklist is below.
How to connect: 3 steps
One key serves both calls from 1C and the coding assistant in your editor.
Sign up for RuAPI and top up
Sign up at www.ruapi.ai with email, Google, Yandex or Telegram. The minimum top-up is 5 USDT on TRC20, BEP20, TON or Polygon; USDC is accepted too. How to buy USDT for rubles via SBP is shown at docs.ruapi.ai/en/buy-usdt. Foreign bank cards also work.
A new account usually gets $0.05 right away for deepseek-flash, claude-haiku-5-5 and gpt-6-luna — enough to test a call from 1C.
Create a key and add the function to your configuration
Console → “API keys” → “Create key”. Make a separate key for the integration and give it a spending limit and a list of allowed models. Put the function from the example at the top of the page into a form module — it already has the &НаСервере directive — or into a common module with the “Server” and “Server call” flags, removing the &НаСервере line (common modules do not use directives). The key never reaches the client, and the call works in both the thin client and the web client.


Check the usual mistakes
- The request body is UTF-8 without a BOM: УстановитьТелоИзСтроки(…, КодировкаТекста.UTF8, ИспользованиеByteOrderMark.НеИспользовать).
- If the platform cannot verify the www.ruapi.ai certificate (issued by Let’s Encrypt), update cacert.pem in the platform’s bin folder by adding the ISRG Root X1 root certificate.
- HTTPСоединение timeout: 120–300 seconds — a model takes tens of seconds to write a long reply.
- The request leaves the 1C server as the OS user the service runs under, so proxy and firewall are set up for that user. To use the system proxy, pass Новый ИнтернетПрокси(Истина) as the fifth parameter of HTTPСоединение.
- In 1C:Fresh and other clouds, additional data processors run in safe mode and need permission for the internet resource www.ruapi.ai, port 443.
RuAPI addresses and keys: docs.ruapi.ai/en/quickstart · API error codes: docs.ruapi.ai/en/errors
Connection settings
HTTPСоединение
Server: www.ruapi.ai
Port: 443, ЗащищенноеСоединениеOpenSSL
Path: /v1/chat/completions
Headers
Authorization: Bearer sk-…
Content-Type: application/json; charset=utf-8
Coding assistant
Base URL: https://www.ruapi.ai/v1
Claude Code: https://www.ruapi.ai
Models: claude-sonnet-5-5, gpt-6.1-sol
Prices of models for 1C
In US dollars per 1M tokens, as on the pricing page. No subscription: only the tokens your requests use are deducted.
| model | input $/M | output $/M |
|---|---|---|
| claude-opus-5-5 | $4.80 cache read $0.24 | $24.00 |
| claude-sonnet-5-5 | $2.40 cache read $0.12 | $12.00 |
| gpt-6.1-sol | $2.40 cache read $0.12 >272K: $4.80 | $12.00 >272K: $18.00 |
| deepseek-v4-pro | $1.58 cache read $0.0600 | $4.75 |
| qwen3.8-max | $2.16 cache read $0.43 | $6.46 |
| deepseek-flash | $0.17 cache read $0.0120 | $1.44 |
| qwen3.8-flash | $0.14 cache read $0.0288 | $0.49 |
Input is the price of input tokens (your question and data), output of the model’s reply. By our estimate, a request with 2K tokens in and 1K tokens out costs about $0.002 on deepseek-flash and about $0.017 on claude-sonnet-5-5. Use cheap models for bulk document processing and strong ones for code. Your account’s prices may be lower.
The grey “>272K” row is the vendor’s long-prompt rate: if the prompt is over the threshold, the whole request is billed at it.
