Model provider mode points a tool at OcHub’s local gateway, which then sends requests to the active upstream. You can switch upstreams without repeatedly rewriting tool configuration, while centralizing protocol conversion, model mapping, and usage tracking.
Use this path when
- Several tools should share the same upstream.
- The client and upstream use different API interfaces.
- You need model aliases, reasoning normalization, usage accounting, or a prepared backup upstream.
For one endpoint in one tool, a direct connection has fewer moving parts.
Create a model provider
-
Open Model providers. If compatible local configuration already contains an API key, try Import from existing configuration first.
-
Add a model provider. Enter a name, upstream API origin, and access key. Enter the origin without a trailing
/v1— OcHub appends the per-interface request path (such as/v1/messages) itself. -
Detect interfaces. Select Detect to probe Anthropic Messages, OpenAI Chat, and OpenAI Responses. If automatic detection fails, enable only the interfaces documented by the upstream.
-
Keep the first setup simple. Leave the default model, model exceptions, and custom reasoning budgets empty.
-
Save and review the card. Before saving, the editor’s HTTP latency test confirms the address is reachable; after saving, check the card’s interface chips, model count, and on/off state. Reachability does not prove that authentication or a real model request will succeed.
-
Switch a tool onto it. Open the target app page (Codex, Claude Code, …) and select Switch on the entry under Model provider mode. The entry is then marked Current with an In use button, and the tool’s live configuration points to the local gateway.
Switch model providers
Model providers are switched from the app page as well:
- On the target app page, choose an enabled provider in the Model provider mode section (the Active model provider panel once one is applied).
- Switching now updates only the local route instead of repeatedly rewriting tool configuration.
- The Active model provider panel marks the one in use and shows its default model or number of model mappings.
Verify the request path
- Start the target CLI and make a short request.
- In Usage → Request logs, find an entry whose source is Model provider request.
- Open it and verify the request model, pricing model, provider, status, and latency.
If the tool cannot connect, first confirm that OcHub is still running, then check that the model provider is enabled.
Connect another local tool
The Connect other tools section provides a loopback URL and local key. Any local client that supports OpenAI Chat can use them.
Disconnect or restore direct mode
- Delete the connection that points at the model provider on the app’s Connections page to remove that app’s relation to it.
- A model provider in use cannot be deleted; the dialog lists the affected apps. Switch those apps to another model provider or a direct connection first.
- Disabling a model provider in use immediately breaks those tool requests; switch the affected apps first.
- To return to direct mode, switch to a direct connection on the app page.
For model mappings, interface exceptions, and backup-upstream workflows, read Routing recipes.

