--config, and any setting can be overridden with a command-line flag at startup. The connector never reads environment variables, and it only ever forwards to the upstreams you define here — never to a URL supplied by the gateway.
Your
ConnectorId and Token are issued by the Tokios console when you create a connector. The token is shown only once — paste it into your config file and store it somewhere safe.Precedence:
CLI flags›TOKIOS_* env vars›tokios-connector.json›defaultsThe config file
A minimal config has aConnector section with your credentials and one local upstream:
tokios-connector.json
Connector fields
string
required
managed by pairingrestart requiredThe connector’s id from the console (e.g.
con_...). Identifies this connector to the Tokios gateway.string
required
managed by pairingsecret — redacted in logsThe connector token issued when you create the connector (e.g.
ct-...), bound to your tenant. Shown only once in the console.string
The
wss:// gateway endpoint the connector dials. Defaults to the hosted Tokios gateway, so you normally leave this unset. (Self-hosted deployments point it at their own server, e.g. wss://your-server/connector/connect.)integer
default:"8"
Maximum number of in-flight requests the connector forwards at once. Requests beyond the cap are rejected with
503 connector_busy until a slot frees.Declaring what the connector serves
Pick one of two shapes — specifying both is rejected. Single upstream — one local server serving one or more model ids:tokios-connector.json
tokios-connector.json
Models / Routes[].Model are the model ids your local server uses — what you’d send it directly (e.g. gemma4:e4b in Ollama). You expose one under a public API name (e.g. gemma-tunnel) by registering a deployment in the console; that public name is what clients send in the "model" field, and the gateway rewrites it to the upstream id before forwarding it down the tunnel. See Model Routing.
Upstream fields
Each upstream — the singleUpstream, or each entry under Upstreams — accepts:
string
required
requiredThe base URL of your model server, including the
/v1 segment — e.g. http://127.0.0.1:11434/v1. The connector appends the request path (/chat/completions) to it. Your server must expose an OpenAI-compatible Chat Completions API. See Backends.string[]
Optional host pin. Empty (the default): the connector trusts the host in
BaseUrl as-is — local and remote upstreams need no extra setting. Non-empty: the BaseUrl host must appear in the list, so a later BaseUrl edit that points somewhere else fails at startup instead of silently sending traffic (and the upstream’s ApiKey) to the new host.string[]
Request paths the connector may forward. Defaults to
["/chat/completions"].To reach a model on another machine on your network, point
BaseUrl at it — for example http://192.168.1.50:11434/v1. No opt-in setting is needed: the connector forwards only to hosts named in its own config file, never to a URL supplied by the gateway. Older configs may still contain AllowLan; the connector ignores it.Authenticating to a remote upstream
To forward to a hosted, OpenAI-compatible provider instead of a local server, pointBaseUrl at the provider and supply credentials on the upstream:
string
The key injected into the upstream request.
string
default:"Authorization"
The header the key is sent in. Use
x-api-key for Anthropic-style providers, api-key for Azure OpenAI.string
default:"Bearer "
Prefix prepended to the key. Set to an empty string for raw-key schemes (e.g.
x-api-key, api-key).object
Static headers added to every upstream request.
object
Static query-string parameters appended to the upstream URL (e.g. Azure OpenAI’s
api-version).Command-line flags
Any config value can also be overridden on the command line using its full key path:
There is no
--log-level flag. Set verbosity through the Logging section (below) or the --Logging:LogLevel:Default=... override shown above.Logging
The connector always logs to the console. Control verbosity and turn on optional rolling daily files with a top-levelLogging section — a sibling of Connector:
tokios-connector.json
string
default:"Information"
Verbosity:
Trace, Debug, Information, Warning, or Error. Set to Debug to capture per-request routing, the cid, and upstream detail when troubleshooting.string
Turn on rolling daily log files in this directory (created if missing). Empty (the default) means console only. A relative path resolves next to the connector binary — not the working directory — so logs land predictably even when the connector is launched by double-click.
integer
default:"14"
Number of daily log files to keep.
logs/tokios-connector-YYYYMMDD.log.
Complete example
- macOS
- Linux
- Windows
Config path:
~/Library/Application Support/tokios/tokios-connector.jsonRunning as a background service
- macOS (launchd)
- Linux (systemd)
- Windows (Service)
Create a plist file at Load and start the service:
~/Library/LaunchAgents/com.tokios.connector.plist:~/Library/LaunchAgents/com.tokios.connector.plist
Related errors
See Troubleshooting for resolution steps.