English
AI gateway
The AI gateway is one endpoint that all your AI tools share. You add API keys and AI subscriptions to the hub one time, the AI tools on every computer can use them, and you see the usage in one place.
SystemsLinuxWindowsmacOS
EditionsInternationalChina
Sincev0.1.0
The AI gateway installs with the hub and is already running. After you add a key or a subscription and connect your tools to the gateway, the tools keep no keys of their own. The gateway replaces only the model source and installs no tools, so you install tools such as Claude Code yourself. Hermes WebUI, Ayakaleaf and SiYuan use the AI gateway automatically, with nothing to set up.
Add an API key
Save the key on the Credentials page, then create a provider on the AI page that uses the key:
In the panel's sidebar, select Credentials, then select Add token under Tokens. Enter a name in Name, paste the key from your provider in Value, then select Save token. After you save it, the key stays hidden.

1Select Add token 
2Fill it in, then select Save token In the sidebar, select AI, then select Add provider under Providers.

Fill in the following fields, then select Save provider.
- Name: any name you choose.
- Kind: the API the provider offers, one of Anthropic, OpenAI, Gemini or OpenAI-compatible. For DeepSeek, for example, select OpenAI-compatible — /chat/completions.
- Base URL: the provider's address, when it differs from the official one. For DeepSeek, enter
https://api.deepseek.com. - Model aliases: one model name per line, at least one, because the gateway serves no models while the field is empty. For DeepSeek, enter two lines, first
deepseek-flash, thendeepseek-v4-pro. - API token: the token you saved in the first step.

1Select the saved token 
2Select Save provider A new row appears in the list, and a yellow notice states that the gateway restarts and requests in progress fail. Select Apply providers to put the change into effect. Refresh the page after a few seconds. The key is added when Activity at the top of the page shows running, answering and Serving 2 models.

1Select Apply providers 
2It shows Serving 2 models
The providers are ordered from top to bottom, and the first enabled one serves requests first. Drag a row by its start to change the order, or turn a provider off for a while with its row's switch. After any of these changes, select Apply providers.
Add a subscription
If you have an AI subscription, sign in with the account one time to use it, without a key. Accounts and API keys form one pool. When a tool requests a model, the gateway picks an account or key that offers that model.
On the AI page, select Sign in under Accounts, then choose a provider in the dialog.

1Select Sign in 
2Choose a provider The dialog shows an address. Select Copy, open the address in a browser, then sign in and approve. If the dialog shows a code, enter the code at that address.
After you sign in, the browser can report that the page cannot open, which is expected. Copy the contents of the address bar, paste them into Address bar or code, then select Finish sign-in. The subscription is added when a new row appears under Accounts.

Ollama on your systems
When a system with Ollama is online and its Ollama runs with at least one model, the hub adds it to the AI gateway. You add no key. The provider list on the AI page then shows a read-only row from my-computer's Ollama. Select Models on that row to open the model list of Ollama on that system.

In the gateway these models keep the names they have in Ollama, with no system name in front. When two systems hold a model of the same name, the gateway takes turns between them. The row goes away while the system is offline, while Ollama is stopped or uninstalled, and while Ollama holds no model; the gateway then stops serving those models.
Connect tools to the AI gateway
The setup depends on the programs installed on the computer.
Computers with only the client
On a computer with only the client installed, turn on a switch in the client window:
Open the client, go to its AI page, and select The AI tools use this gateway. The switch turns green, and the row shows The tools point at the hub. From then on, Claude Code, Codex, Gemini and OpenCode go through the gateway.
The client must keep running for the tools to connect to the gateway. When you turn the switch off, the tools return to their own settings.

1Select The AI tools use this gateway 
2The switch turns green Optional: to choose the models, select Configure, pick a model for each tool, then select Save.

The phone apps have no AI page.
Systems joined to the hub
On a system that joined the hub, the switch is on the system's page in the panel, and you set it per account:
In the lower part of the panel's sidebar, select the system's name. Under Available accounts, select Edit on the account's row.

Turn on AI tools use the hub's gateway, choose a model for each tool if you need to, then select Save. The setting is in effect when the account's row shows Uses the hub's AI gateway.

1Turn the switch on 
2Choose a model
The switch also covers CloudCLI and Codeg, and tools started in a VS Code or code-server terminal use the gateway too. While the gateway has no models available, the switch cannot be turned on. When you remove the account, or the system leaves the hub, the tools return to their own settings.
If a computer with the client has also joined the hub, the client's switch is grey. Use the switch in the panel instead.
Default model
The default model is the model that the AI tools, Ayakaleaf, Hermes WebUI and SiYuan use when nobody chose one. On the AI page, in the Access panel, choose a model in Default model, then select Apply access settings. Without a choice, the hub uses the first model by name among the models the gateway serves.
Generate a key for other tools
Some tools require you to enter an address and a key by hand, and for those you can generate a separate key. The key is for tools on the hub's computer, or for tools that connect to that computer through SSH port forwarding. The gateway is closed to the LAN, so the address is http://127.0.0.1:<port>, with the number from the Gateway port section as <port>.
On the AI page, select Generate key under Access. Endpoint is the address you enter in the tool.

Enter a name, then select Generate. Select Copy key, then enter the key and the Endpoint in the tool. The full key is visible only until this screen closes.

1Enter a name, then select Generate 
2Select Copy key
If you no longer need the key, select the trash icon on its row, then select Revoke in the dialog. Tools that use the key lose their connection to the gateway immediately.


To stop one client from using the gateway, turn off its AI gateway permission on the Clients page. The steps are in Clients.
View usage
Activity, at the top of the AI page, shows requests today, tokens today and the usage of the last 30 days. Select Journal to read the gateway's log.

AI usage on the Dashboard page also shows requests and tokens, and it can show one key alone.
