Show documentation navigation

How to use the AI assistant

Attach a device so the answer fits it. From an AI connection profile to a script in the batch editor, and knowing exactly what left your computer on the way.

Applies to
Questions over any protocol; live configuration fetch over 8291 and SSH, and over API and REST on RouterOS 7; RouterOS 6.x and 7.x
Last updated

The AI assistant answers RouterOS questions in three parts — a plain explanation, the technical details and a RouterOS script you can edit. It never runs anything. The script's only way out is the main window's batch editor, where the usual risk classification and confirmation apply.

Why attach a device#

A general AI chat doesn't know what your network looks like, so it can only give examples. With one device attached:

  • it sees that device's configuration (a read-only /export, only the sections you tick);
  • it knows the device's RouterOS version and writes commands for it;
  • the answer and script can use that device's interfaces and addresses, so you don't have to adapt an example.

For a general question, you can leave the device out.

Set up an AI connection profile#

  1. In the main window, click the ▾ next to AI assistant and choose AI connection settings… (or use the gear in the assistant window).
  2. Choose New, give the profile a name, and fill in the Base URL.
  3. Enter the API key if the service needs one. Local endpoints (localhost) usually do not.
  4. Fill in the Model. Get model list fills in the names the endpoint reports, and opening the model drop-down while it is empty fetches them too. It needs the API key first (except for a local endpoint), and when the list cannot be fetched it says why — a rejected key, an unreachable endpoint — instead of just coming back empty.
  5. Choose Test connection.
  6. Choose Save. With more than one profile, Set as default picks the one new windows start with.

This version supports one API format: OpenAI-compatible Chat Completions. Services such as OpenAI, OpenRouter, DeepSeek, Groq and Mistral offer it, and so do local runtimes such as Ollama, LM Studio and vLLM. These are examples of the format, not a tested compatibility list — Test connection is how you find out.

FieldDefaultWhat it is for
Base URLEmptyThe endpoint, for example https://api.openai.com/v1 or http://localhost:11434/v1. A full …/chat/completions URL also works
API keyNot setStored in Windows Credential Manager, never in a settings file
Send the key inAuthorization: BearerOr a custom header name, for endpoints that expect the key elsewhere (Azure OpenAI and some gateways)
ModelEmptyThe model name as the service spells it
Timeout (seconds)60How long to wait for the first response and between parts of a streamed answer (5–600)
Output limit (tokens)262144 (256K)The longest answer to ask for (256–262144). Reasoning models count their thinking toward it, and too low a value leaves the answer empty. If the service answers HTTP 400 because the model allows less, lower it to what the model supports (for example 16384)
TemperatureEmpty (not sent)0 to 2, only if you want to override the model's own default
Reference limit (KB)256The most reference material one request may carry (16 KB to 4 MB)
Reasoning effortLow (new profiles)Sent as reasoning_effort: Not sent (model default), Off — no thinking (none), Low, Medium or High. Lower means faster answers from reasoning models. Profiles saved before this option existed load as Not sent. If the endpoint rejects a value (HTTP 400), pick another one or go back to Not sent
Extra headersNoneOne Name=Value per line, for gateways that need them
Extra query stringNoneFor example api-version=2024-10-21
Model list URLEmpty (Base URL + /models)A full URL for endpoints that list models elsewhere, for example Ollama's native /api/tags, Azure's /openai/models?api-version=… or Gemini's compatibility layer at /v1beta/openai/models. The API key header and the extra query string are still sent. The reply can be data[].id, models[].name or a plain array
Extra request fields (JSON)EmptyOne JSON object merged into the request body, for vendor-specific switches such as {"thinking":{"type":"disabled"}} (DeepSeek) or {"options":{"num_ctx":32768}} (Ollama context size). Fields here replace the ones RosRunner sends with the same name; model, messages and stream cannot be set. Invalid JSON cannot be saved; at most 16,384 characters
Compatibility optionsOffmax_completion_tokens instead of max_tokens, usage reporting while streaming, or the system prompt sent as the first user message, for endpoints that need it

Everything from Timeout down is under Advanced.

Open the assistant#

Choose AI assistant in the buttons above the device list (or Open AI assistant from its ▾ menu), or press Ctrl+I. The window is not modal, and you can open more than one.

  • No device ticked — a general RouterOS question and answer.
  • One device ticked — that device is the reference device.
  • Several ticked — pick one of them in the Device list, or keep (no device).

Once a conversation has started, its device is fixed. To use another one, start a New conversation.

Choose reference material#

Reference material is optional. The three choices are:

ChoiceWhat it does
No referenceOnly your question and the conversation are sent
Fetch export from deviceReads /export from the reference device — read-only, sensitive values hidden, no file created on the device
Load local .rscUses a .rsc file on your computer, for example one saved by configuration backup. Works with or without a device

Fetching the configuration live runs /export on the device, so what works depends on the protocol selected in the main window:

ProtocolFetch export from deviceLoad local .rsc
The connection WinBox uses (8291)YesYes
SSHYesYes
APIRouterOS 7 onlyYes
RESTRouterOS 7 onlyYes

Over API and REST, /export runs through /execute, and RouterOS 6 cannot return its output that way (RouterOS 6 has no REST at all), so for RouterOS 6 use 8291 or SSH. All four protocols return the same configuration.

The device also needs a password, from the shared credentials or its own. A fetched export or a loaded file larger than 4 MB is refused, and a local file has to be UTF-8 text.

The snapshot is split into sections such as /ip firewall filter. Choose sections… lists each one with its size; only the ticked sections are sent, and all are ticked to start with. Sending less keeps both the exposure and the token count down. Above about 64 KB (roughly 16k tokens) the window warns that a smaller model may not fit it; above the profile's Reference limit, it will not send at all.

The snapshot is attached with your first question and stays with the conversation. It cannot be taken back out: to change or remove it, start a New conversation.

What is redacted, and what is not#

Every line of the reference material — fetched or loaded — goes through the same redaction before it is sent:

Replaced with ***Sent as-is
Values of password, secret and key-type fields (for example password=, secret=, pre-shared-key=, private-key=)IP and MAC addresses
The serial numberDevice names (identity)
The software idComments, user names and DNS names

Addresses are left in on purpose: the model needs them to give an answer that fits your network. It also means the reference material is not anonymised. Two gaps are known: SNMP community names (the field is name=) and strings assigned in scripts with :local or :global are not recognised as secrets. Preview is how to check.

The device's name is sent along with the snapshot: its identity, or the name or address from the device list if the identity cannot be read. For a loaded file, the file name is sent instead.

Before anything is sent#

  • First-use notice — the first time you send, a notice explains where the data goes, what is included and what is redacted. I understand, send is the default button, so Enter sends and Esc cancels. After you confirm, it is not shown again.
  • Summary line — above Send, every time: your question, how many earlier turns, the snapshot's sections and size, and the profile and host it goes to.
  • Preview — the full text that will be sent, in order. The API key and HTTP headers are never shown there. You can copy it or save it as a .txt.

Reading an answer#

The answer streams in and is split as it arrives:

PartWhat you get
Plain explanationWhat it does and what effect it has, with one sentence about the risk
Technical detailsVersions it applies to, prerequisites, what changes, how to verify and how to roll back. Collapsed by default
RouterOS scriptThe commands, loaded into the script pane on the right

Explanations follow the interface language; commands stay in English. The model is told the reference device's RouterOS version (and its model, when known). When the version is unknown, it is asked to check with you first or to give both v6 and v7 syntax. Stop (or Esc) ends an answer early.

While the model is still thinking, the answer line shows a small animation with thinking…, which changes to answering… once text arrives. In the message box, Enter sends and Shift+Enter starts a new line (Ctrl+Enter also sends). In the conversation, Ctrl+C copies the selected text, or the whole message when nothing is selected. When you mention WinBox or ask where to click, the model is asked to end the plain explanation with numbered WinBox steps (menu path, button, tab and field); you can also paste the script into WinBox's New Terminal.

With a reasoning model, a Thinking (N characters) block above the answer shows the model's reasoning as it arrives. It is collapsed by default and stays after the answer is complete, but it is not kept in the conversation, is not sent back to the model, and is not copied by Ctrl+C. If you are waiting a long time for that reasoning, lower Reasoning effort in the profile.

If the model does not follow the format, the whole answer goes under technical details and the first code block becomes the script. A script is marked Incomplete when the answer hit the output limit, did not finish, or left the script section open, and when the service's content filter stopped it.

The script pane#

  • The script is editable, with the same syntax highlighting as the main window's editor.
  • The risk badge shows Read-only, Changes settings or Destructive, from the same assessment the main window uses.
  • The byte count is measured against the limit of the protocol currently selected in the main window.
  • Edited appears once you change the script. Use this answer's script loads the script of an earlier answer.
  • Copy and Save as .rsc… take the script elsewhere without touching the batch editor.

Send to batch editor#

Send to batch editor (or Ctrl+Shift+Enter) puts the script into the main window's batch editor. It does not run it. Before it does, it checks:

  1. A batch is running — not sent; try again when it finishes.
  2. The pane is empty — nothing to send.
  3. The script is incomplete — not sent until you have edited it, which is how you take responsibility for it.
  4. It is too long for the current protocol, alone or together with what is already in the editor — not sent, and never truncated. Shorten it, or switch to line-by-line mode in the main window.
  5. The editor already has commands — you choose Replace or Append.
  6. The selection differs from the reference device — you choose Select only this device or keep the current selection.

The script arrives under one comment line that records where it came from:

text
# Generated by AI assistant (answer 2, edited by hand); reference: Core-Router-01 / RouterOS 7.23.2; 2026-09-24 14:05

From there it is an ordinary batch: nothing runs until you click Run, the targets and commands are confirmed first, and destructive commands still need typed confirmation.

Follow-up questions and new conversations#

Questions in one window form a single conversation, so you can ask follow-ups. When a conversation gets long, the window suggests starting afresh, because it may no longer fit the model's context.

New conversation (or Ctrl+N) clears the conversation and its reference material, and lets you choose the device and the reference again. When there is a conversation to lose, it asks first, because nothing is kept once it is cleared.

Conversations are not saved#

A conversation exists only in its window. Closing the window or starting a new conversation discards it.

Export conversation saves it as Markdown (.md): the time, the reference device and version, the AI connection profile's name, and every question with its answer. You choose whether to add the reference configuration (redacted) as an appendix. The file never contains the Base URL or the API key — but it does contain whatever your questions and answers said, so review it before passing it on.

When something goes wrong#

The message saysWhat to check
Could not reach the AI serviceThe Base URL, your network, or a proxy
The AI service did not respond in timeRaise the timeout, or try a smaller model or less reference material
Answers are slow; the model thinks for a long timeLower Reasoning effort to Low or Off — no thinking (none) in AI connection settings → Advanced
The AI service rejected the API keyThe key and its permissions at the service
Rate limiting or out of quotaWait, or check your plan with the service
Endpoint not foundThe Base URL's path, for example whether it should end in /v1
The model name does not exist on this endpointGet model list, or the model name's exact spelling
The model list cannot be fetchedFill in Model list URL with the endpoint's full model-list address, or type the model name yourself
Too long for this modelChoose fewer sections, or start a new conversation
API and REST can only fetch the export on RouterOS 7For RouterOS 6, switch to 8291 or SSH in the main window, or load a local .rsc
Could not reach the device over RESTRouterOS 6 has no REST; on RouterOS 7, enable the www-ssl service — or switch to 8291 or SSH
The export came back incompleteFetch it again, or switch to 8291
No password for this deviceGive the device a password in the main window, or load a local .rsc
The export is larger than 4 MBLoad a .rsc and choose fewer sections

What it will not do#

  • It does not run commands, and it does not let the model read from your devices. The only device access is the read-only /export you ask for.
  • It does not attach more than one device to a conversation.
  • It does not save conversations. Exporting one is always your decision.
  • It does not anonymise addresses, names or comments. Only secret-type values, the serial number and the software id are redacted.

Next#