Skip to content

Managed Providers

Managed providers are cloud-hosted LLM services that netclaw connects to over HTTPS. Each requires an API key or OAuth token — OpenRouter, Anthropic, and OpenAI are supported.

Provider config lives in two files. Non-secret fields (type, endpoint, auth method) go in ~/.netclaw/config/netclaw.json. Credentials go in ~/.netclaw/config/secrets.json, which is encrypted at rest — write plaintext values and netclaw encrypts them on first read. Environment variables override both.

If you’re setting up netclaw for the first time, netclaw init handles provider selection interactively. This page covers manual configuration and the details behind each provider type.

For self-hosted inference (Ollama, llama.cpp, vLLM), see Self-Hosted Providers.

TypeDisplay NameDefault EndpointAuthKey Source
openrouterOpenRouterhttps://openrouter.ai/api/v1API keyopenrouter.ai/keys
anthropicAnthropichttps://api.anthropic.comAPI keyconsole.anthropic.com
openaiOpenAIhttps://api.openai.comOAuth PKCE or API keyplatform.openai.com

Each provider is a named entry under the Providers section. The key is a name you choose — you can have multiple entries of the same type (e.g., two Anthropic providers with different keys).

FieldTypeDefaultDescription
Typestring"ollama"Provider SDK: openrouter, anthropic, or openai for managed providers. Always set this explicitly.
Endpointstring""Base URL. Leave empty to use the provider’s default
ApiKeystring?nullAPI key. Store in secrets.json, never netclaw.json
AuthMethodenumNoneNone, ApiKey, OAuthDevice, or OAuthPkce
{
"Providers": {
"openrouter": {
"Type": "openrouter",
"Endpoint": "https://openrouter.ai/api/v1"
},
"my-anthropic": {
"Type": "anthropic"
},
"my-openai": {
"Type": "openai",
"AuthMethod": "OAuthPkce"
}
}
}
{
"Providers": {
"openrouter": { "ApiKey": "sk-or-v1-..." },
"my-anthropic": { "ApiKey": "sk-ant-..." }
}
}

OpenAI with OAuth doesn’t need an entry in secrets.json — tokens are managed automatically after the OAuth flow.

You can also manage credentials with netclaw secrets set instead of editing secrets.json directly.

After adding a provider, assign it to a model role — Main, Fallback, or Compaction — with netclaw model set.

One API key, hundreds of models. OpenRouter proxies requests to Anthropic, OpenAI, Meta, Mistral, and others, so you don’t need a separate account with each vendor.

Terminal window
netclaw provider add openrouter openrouter --api-key sk-or-v1-...

Or configure manually in netclaw.json:

{
"Providers": {
"openrouter": {
"Type": "openrouter"
}
}
}

The endpoint defaults to https://openrouter.ai/api/v1 — only override it if you’re using a proxy.

Get your key at openrouter.ai/keys. Browse available models in the OpenRouter model catalog.

Connects directly to Claude models via the Anthropic API.

Terminal window
netclaw provider add my-anthropic anthropic --api-key sk-ant-...

The endpoint defaults to https://api.anthropic.com. Netclaw sends the x-api-key header and anthropic-version: 2023-06-01 on probe requests.

Get your key at console.anthropic.com/settings/keys. See the Anthropic API docs for model versions and usage limits.

OpenAI supports two auth methods: OAuth PKCE (Proof Key for Code Exchange, uses your ChatGPT subscription) and API key (uses platform.openai.com credits).

If you already pay for ChatGPT Plus or Pro, this is the way to go — no API keys to manage. Setup happens inside the TUI, which opens a browser window for the OAuth flow:

Terminal window
netclaw provider # opens Provider Manager

Select + Add new provider, choose OpenAI, then pick ChatGPT Subscription (recommended).

You can also start the OAuth device flow from the CLI without the TUI:

Terminal window
netclaw provider add my-openai openai --auth oauth-device

OAuth requires a browser — if you’re on a headless server over SSH, use the API key method instead.

OAuth tokens expire periodically. When they do, open netclaw provider, select the unhealthy provider, and re-authenticate.

Because OAuth tokens can’t call OpenAI’s /v1/models endpoint, netclaw uses a curated model list:

CategoryModels
Frontiergpt-5.4, gpt-5, gpt-5-mini, gpt-5-nano, gpt-4.1, gpt-4.1-mini, gpt-4.1-nano
Reasoningo3, o3-mini, o4-mini
Codexgpt-5.3-codex, gpt-5.2-codex, gpt-5-codex

This list is updated with each netclaw release.

Terminal window
netclaw provider add my-openai openai --api-key sk-proj-...

Get your key at platform.openai.com/api-keys. With API key auth, netclaw discovers available models automatically via /v1/models.

Provider Manager TUI showing configured providers with health status

netclaw provider probes each configured provider on startup and shows whether it’s reachable and authenticated:

IndicatorMeaning
Healthy — models discovered
Unreachable or auth failure
Probe in progress

Select a provider to manage it:

KeyAction
KUpdate API key
RRemove provider
VRe-validate connection

Skip config files entirely by setting environment variables with the NETCLAW_ prefix. Double underscores (__) separate path segments, following the .NET configuration convention:

Terminal window
# Override a provider's API key
export NETCLAW_Providers__openrouter__ApiKey="sk-or-v1-..."
# Point a model role at a provider
export NETCLAW_Models__Main__Provider="openrouter"
export NETCLAW_Models__Main__ModelId="anthropic/claude-sonnet-4"

Environment variables take highest priority, overriding both netclaw.json and secrets.json. On Linux, variable names are case-sensitive — NETCLAW_Providers__openrouter__ApiKey won’t match NETCLAW_PROVIDERS__OPENROUTER__APIKEY.

When the TUI or daemon starts, netclaw probes each provider by hitting its model-listing endpoint. Each probe has a 10-second HTTP timeout.

Common probe errors:

HTTP StatusMessage
401Invalid credentials — double-check your provider key
403Access denied — credentials may lack model-listing permissions
404Models API not found — service may be down
429Rate limited — wait a moment and try again
5xxProvider returned an error — may be experiencing issues
Connection failureNetwork issue — check endpoint and connectivity

To test your configuration right now, run netclaw doctor for a full config and connectivity diagnostic, or open netclaw provider to see live health status.

  • Changing providers requires a daemon restart.
  • Missing credentials are a startup error, not a warning — the daemon won’t start if a configured provider has no API key and no NETCLAW_Providers__<name>__ApiKey env var.
  • Each model role uses exactly one provider. There’s no automatic failover or per-channel provider selection. Change the active provider with netclaw model set.