NEBIUS TF RELAY / DOCS
Documentation
Everything you need to run your coding agents on Nebius Token Factory, with optional Tavily web search.
What it does
Nebius Token Factory serves open models over an OpenAI-compatible API. It does not speak the Anthropic Messages API that Claude Code uses, nor the OpenAI Responses API that Codex uses. The relay runs a small local daemon that translates those wire formats to Nebius /chat/completions on the fly - your agent believes it is talking to its native backend, while every token is served by Nebius.
Claude Code and Codex. The daemon translates each request and response, tracks cost, retries transient failures, trims context to fit, and emulates native web search.
Everything else. Launched with a generated provider config pointed at Nebius - no proxy needed, since they already speak the OpenAI-compatible format.
nebiusrelay chatgpt offrestores that integration.Install
The one-liner installs nebiusrelay plus a short alias per harness into ~/.nebiusrelay/bin/, and installs Bun for you if it is not already present.
curl -fsSL https://nebius-tf-relay.vercel.app/install.sh | bashFirst run walks you through configuration, or run it directly:
nebiusrelay configureYou will be asked for two keys:
| Key | Where to get it | Required |
|---|---|---|
| Nebius API key | tokenfactory.nebius.com | Yes |
| Tavily API key | app.tavily.com | Optional - enables web search |
~/.nebiusrelay/config.json and used to authenticate requests to Nebius and Tavily. In an interactive terminal, a missing agent can be installed after you confirm its displayed install command. Non-interactive runs print installation instructions.Harnesses
Launch any of them directly. Extra arguments are passed straight through to the underlying agent.
| Harness | Command | Mode | Notes |
|---|---|---|---|
| Claude Code | nclaude | Proxied | Anthropic Messages API translated to Nebius. |
| Codex CLI | ncodex | Proxied | OpenAI Responses API translated to Nebius. |
| OpenCode | nopencode | Spawned | Nebius wired in as an OpenAI-compatible provider. |
| Pi Code | npi | Spawned | Custom Nebius provider in a temporary config directory. |
| Prime Agent | nprime | Spawned | PrimeIntellect's RLM agent on Nebius models. |
| Hermes Agent | nhermes | Spawned | Nous Research's agent, isolated home overlay. |
| DeepSeek Harness | ndeepseek | Spawned | DeepSeek's web profile with Nebius layered in. |
| Grok Build | ngrok | Spawned | xAI's terminal harness; your key never reaches api.x.ai. |
nclaude -p "explain this repo"Commands
| Command | What it does |
|---|---|
nebiusrelay | Interactive launcher - pick a harness. |
nebiusrelay configure | Set your API keys. |
nebiusrelay usage --last 7d | Local spend by model and tool. Never uploaded. |
nebiusrelay update | Update to the latest release now. |
nebiusrelay daemon install | Start the daemon at login (launchd / systemd). |
nebiusrelay daemon status | Show auto-start status. |
nebiusrelay daemon stop | Stop the running daemon. |
nebiusrelay chatgpt off | Restore your previous Codex / ChatGPT config. |
ChatGPT / Codex Desktop (alpha)
The released CLI includes nebiusrelay chatgpt (alias: codex-app) for compatible desktop coding tasks. It configures a local Responses provider in ~/.codex/config.toml, writes a model catalog, and attempts to open the desktop app.
nebiusrelay chatgptRestore the backed-up configuration when you are finished:
nebiusrelay chatgpt offModels
The model list is fetched live from Nebius at startup, so every model they serve is available and each model's vision support comes from the API's own modality field - never a hand-maintained list. Results are cached locally and fall back to a bundled snapshot when offline.
| Model | Best for | Context | Vision |
|---|---|---|---|
| GLM 5.3 FlashDEFAULT | Fast, very low cost, agentic | 1M | No |
| GLM 5.3 | Coding, reasoning, tool use | 1,024K | No |
| DeepSeek V4 Pro 0813 | Reasoning and agentic coding | 979K | No |
| Kimi K3 | Frontier coding + agentic | 1M | No |
| Kimi K2.6 | Vision flagship | 262K | Yes |
| Kimi K2.7 Code | Coding | 262K | No |
| MiniMax M3 | Fast, cheap | 196K | No |
| Qwen 3.5 397B | General / coding flagship | 262K | No |
| DeepSeek V4 Flash | Fast DeepSeek V4 | 1M | No |
| DeepSeek V4 Pro | Long-context reasoning | 1M | No |
| Qwen2.5-VL 72B | Vision fallback | 32K | Yes |
Relay 0.15.4 adds bundled support for GLM 5.3 and DeepSeek V4 Pro 0813. GLM 5.3 Flash remains the default. Select either new model explicitly:
nebiusrelay --model zai-org/GLM-5.3 codex
nebiusrelay --model deepseek-ai/DeepSeek-V4-Pro-0813 codexImages & vision
In Relay 0.15.3 and later, select a vision-capable model explicitly when launching Codex. The default GLM model is text-only. Image options belong to Codex, not every harness; other agents keep their native attachment controls.
ncodex --model moonshotai/Kimi-K2.6Use Codex's clipboard-image shortcut where your terminal supports it. Normal terminal paste may paste text only; the relay does not monitor your clipboard. For a reliable file-based alternative, save the image on the machine running Codex:
ncodex --model moonshotai/Kimi-K2.6 --image "/path/to/screenshot.png" "Describe this image"Web search
Claude Code and Codex expose a native web_search tool. The relay backs it with Tavily: with a key configured, searches return real results with citations. Without one, a search returns a clear "TAVILY_API_KEY not set" message rather than failing silently. Nebius has no hosted search tool, so this is how agents get live web access.
Cost metering
Claude and Codex are proxied, so the daemon meters every turn. The other harnesses hold the key and call Nebius directly, which is why they report $0.00. NEBIUSRELAY_METER=1 points them at the daemon instead:
NEBIUSRELAY_METER=1 npi --print "..."Nebius TF Relay ▸ Launching Pi Code with Nebius Token Factory. [nebiusrelay cost] session total: $0.0056 (1,518 in, 69 out)
They then share the same client as everyone else - automatic model fallback, the per-model circuit breaker, transient-fault retries - and the real Nebius key stays inside the daemon, since the harness only ever sees a local session token. If the daemon is unreachable the launcher says so and connects directly, so metering can never be the reason a session fails to start.
Environment
| Variable | Effect |
|---|---|
NEBIUS_API_KEY | Nebius Token Factory key (or set it via configure). |
TAVILY_API_KEY | Enables web search (or set it via configure). |
NEBIUS_BASE_URL | Override the API base. Default https://api.tokenfactory.nebius.com/v1. |
NEBIUSRELAY_REASONING_EFFORT | none | low | medium | high | max. Default none for speed; raise it for harder tasks. |
NEBIUSRELAY_FALLBACK_MODEL | Model to fail over to when the target returns no response headers. Default moonshotai/Kimi-K2.6; set off to disable. |
NEBIUSRELAY_METER=1 | Route the spawned harnesses through the daemon so they get cost metering, model fallback and retries. Off by default. |
NEBIUSRELAY_REASONING_HISTORY | full (default) | interleaved | off. How much prior reasoning is replayed each turn. off is cheapest on long sessions. |
NEBIUSRELAY_CACHE_READ_RATIO | Price of a cached input token as a fraction of the input price. Default 1, since Nebius publishes no cached rate - so the total is an upper bound. |
NEBIUSRELAY_CODEX_MEMORY_MODEL | Model that summarizes Codex traces for durable memory. Defaults to MiniMax M3. |
NEBIUSRELAY_DISABLE_AUTOUPDATE=1 | Stop the installed binary from self-updating. |
NEBIUSRELAY_TELEMETRY_URL | Opt in to telemetry by pointing at your own collector. Off by default. |
Troubleshooting
Configuration crashes or cannot read a key
Update the installed CLI, then run configuration again in an interactive terminal. Required keys cannot be blank; press Enter to skip the optional Tavily key.
nebiusrelay updatenebiusrelay configureCommand not found after installation
Open a new terminal so your shell picks up the installer's PATH change. You can also run the installed executable directly:
~/.nebiusrelay/bin/nebiusrelay configureWeb search says TAVILY_API_KEY is not set
Add a Tavily key with nebiusrelay configure, then launch a new agent session. A Nebius key alone does not enable web search.
A spawned agent reports zero cost
Enable daemon metering for that launch. See Cost metering for details.
NEBIUSRELAY_METER=1 npiFor AI agents
An LLM-readable doc is published at llms.txt. If you are an agent asked to install, configure or drive nebiusrelay - including headless - read that first. It covers install, configure, every command, the models, and headless usage patterns.