An AI agent for 1C: which tasks to automate and how
An agent around 1C answers questions from data, drafts documents and looks for anomalies. We cover the scenarios, the HTTP-service architecture and safety measures.
5 min · · агенты · бизнес
A request to "build an AI agent for 1C" usually hides three different wishes: to ask the database a question in plain words, to speed up preparation of routine documents, and to have someone notice errors before the period closes. All three can be solved, but not in the way people want: the model must not reach into the database directly and change things there. Below: which agent tasks around 1C make sense, what the architecture looks like through HTTP services and a model API, what the code shows and how to keep control of the data. How to write 1C code itself with a model is not covered here; see the article on integrating a neural network into 1C.
Which tasks to give the agent
Good tasks share one trait: the result can either be checked by eye or stays a draft.
Answers from data. "What is the stock of item A-1024 in the main warehouse?", "What overdue debt does this counterparty have?", "What receipts came in last week?" The model does not go into the database itself: it chooses which request to make to your service and retells the result.
Document preparation. A draft letter to a counterparty about debt, a note to a reconciliation statement, claim text built from database data. The agent gathers the data and writes the text; a person approves the document.
Checks. Finding duplicate counterparties, suspicious amounts, documents without required fields, discrepancies between accounting systems. The agent produces a "look at these" list and does not fix anything on its own.
Explaining accounting. A model can explain what a posting means or how to read a report. For the query "a neural network for accounting" this is the safest scenario. But decisions on taxes, reporting and law stay with a specialist: a model can be wrong in a confident tone.
What not to hand over: posting and closing documents on its own, any write to the database without a person's confirmation, calculations that taxes depend on.
AI agent for 1C: the agent outside, 1C only answers
A simple and safe scheme looks like this:
- An agent service (for example in Python) accepts the user's question.
- It calls the model API and passes a description of the tools (functions) that are available.
- The model decides which function to call and returns its name with arguments.
- The agent service calls a 1C HTTP service, receives the data and gives it back to the model.
- The model forms the answer.
In this scheme 1C publishes a few narrow methods, for example "stock by item" or "debt by counterparty". The platform has HTTP services for this, and you can also use the standard OData interface; check the exact publishing settings and rights in the 1C documentation for your version. The database does not need to be exposed outside: the agent service works inside the network, and only the request to the model API goes out.
A skeleton of an HTTP service method on the 1C side looks like this (details depend on your configuration, check the platform documentation):
// HTTP service module, GET handler for the /stock template
Функция StockGET(Запрос)
Артикул = Запрос.ПараметрыЗапроса.Получить("sku");
Если НЕ ЗначениеЗаполнено(Артикул) Тогда
Возврат Новый HTTPСервисОтвет(400);
КонецЕсли;
Данные = ПолучитьОстаткиПоАртикулу(Артикул); // your function: a register query, returns a Structure
Запись = Новый ЗаписьJSON;
Запись.УстановитьСтроку();
ЗаписатьJSON(Запись, Данные);
Ответ = Новый HTTPСервисОтвет(200);
Ответ.Заголовки.Вставить("Content-Type", "application/json; charset=utf-8");
Ответ.УстановитьТелоИзСтроки(Запись.Закрыть());
Возврат Ответ;
КонецФункцииCreate a separate user for the service, with read-only rights to the data it needs.
The agent service code
On the Python side this is a tool-calling loop over an OpenAI-compatible API. The request parameters are described in the chat completions reference, and the general scheme is covered in the article on an AI agent in Python from scratch.
import json
import os
import requests
from openai import OpenAI
client = OpenAI(
base_url="https://api.zukko.pro/v1",
api_key=os.environ["ZUKKO_API_KEY"],
)
ONEC = os.environ["ONEC_URL"] # for example http://srv-1c/base/hs/agent
ONEC_AUTH = (os.environ["ONEC_USER"], os.environ["ONEC_PASSWORD"])
def get_stock(sku: str) -> dict:Note three decisions. The functions only read data. The number of steps is capped. 1C errors go back to the model as data instead of crashing the service. If you want a ready agent shell rather than your own loop, look at Hermes, but access to 1C will still go through your narrow HTTP service.
Safety and control
- Rights. The service user sees only the needed registers. The method list is fixed: the model cannot call what is not in
TOOLS. - Personal data. Whatever a method returns goes to the model. Do not include passport data, phones and addresses in responses if the task does not need them, or mask them beforehand.
- Write confirmation. If you ever need a write (for example creating a draft document), make it a separate method and run it only after the user presses a button.
- A log. Store the question, the functions called and the answer. This is needed both for debugging and for audit.
- A limit. Create a separate key with a daily limit and a list of allowed models: that way the agent's spend stays under your ceiling.
What it costs
Prices on October 18, 2026, per 1M tokens. For gpt-6.1-sol input is $0.27, output $1.32. Suppose a question needs two calls to the model: the first picks a function, the second words the answer. In total per question 4,000 input tokens (tool descriptions and data count each time) and 300 output tokens.
Cost per question = 4,000 × 0.27 / 1,000,000 + 300 × 1.32 / 1,000,000 = 0.00108 + 0.000396 ≈ $0.0015.
For 50 questions a day and 22 working days a month: 50 × 22 × 0.0015 ≈ $1.6. Real figures depend on how much data you return to the model: a big report in a response increases input by an order of magnitude. Current prices: GET https://api.zukko.pro/v1/models or the "Models" page in the dashboard.
FAQ
Can I give the model direct access to a 1C database?
We advise against it. Narrow read-only methods give predictable behaviour and let you verify exactly what the model sees. Direct database access gives neither.
Which model to take?
For function calling and retelling data start with mid-range ones: gpt-6.1-sol or claude-sonnet-5-5. For bulk checks you can test deepseek-v4.1-flash. Compare on 20–30 of your own questions, not by index.
The model gets numbers wrong. What to do?
Require all numbers to come from the tool response and show the user the original 1C response next to the text. Check any number a document depends on yourself.
How do I connect from Russia?
The agent service calls the Zukko gateway, whose balance is topped up via SBP, a MasterCard card or crypto. Create a separate key for the agent in the Zukko dashboard and allow it only the models it needs.
zukko
Pay 25×
less
for Claude Code & ChatGPT
One fetch_* key and base URL api.zukko.pro — for Cursor, Claude Code, Codex, and any SDK.
Related articles
- An MCP server for Bitrix24: CRM deals and tasks in an agent's handsThe official Bitrix24 MCP gives an agent documentation, not portal data. How to write your own server for deals and tasks and keep the agent on a short leash.
- An AI agent for business: tasks, architecture and a realistic budgetNo promises to replace a department. Real agent tasks, a design of model, tools and guardrails, a monthly budget calculation and a pre-launch checklist.
- opencode agents: setting up roles, models and toolsA custom agent in opencode is a role, a model and a set of permissions. A working config where a cheap model handles routine work and a stronger one edits code.
- Plan mode in Claude Code: plan first, then edit the codeIn plan mode Claude Code reads your code and proposes a plan but edits nothing until you agree. How to enable it, use it and what it costs.