Skip to content

Manage connections

Manage the full connection lifecycle and understand app-specific behavior.

Updated View as Markdown
For humans

OcHub stores connections separately for each app. A Claude Code connection does not automatically appear in Codex, but Copy to app can regenerate it in the target tool’s format.

Live OcHub connection page rendered by GPUI WebAssembly

Discover existing configuration

When you open an app page, OcHub reads the tool’s current live configuration:

  • Recognized connections appear under Direct connections.
  • Connections already present in the tool but not currently selected are marked Added.
  • The active connection is marked Current.
  • If a custom field cannot be represented completely, inspect the write preview before saving so it is not lost.

Everyday connection actions

Action Use it for
Edit Change endpoints, keys, models, notes, or advanced fields
Drag to reorder Change list and system-menu order
Copy to app Regenerate a new connection in another app’s format
Add to tool Preload a connection without making it current
Switch Make it the live connection immediately
Remove from tool Keep OcHub data while removing the live tool entry
Delete Permanently remove the connection from OcHub
Illustrated walkthroughClick a screen to enlarge it, then use ← → to walk the steps. The blue outline marks the control or result.
1
STEP 01Open a connection
2
STEP 02Edit its fields
3
STEP 03Add it to the tool
4
STEP 04Switch it live
5
STEP 05Copy it to another app
6
STEP 06Remove or delete carefully

If a connection is current, switch to another one before deleting it.

Official login

Use official login writes no third-party Base URL or API key. It keeps the tool’s own login state. Use it when:

  • Claude Code or Codex is already signed in with an official account.
  • You need to switch temporarily from a third-party API back to the official service.
  • You want to preserve native subscription and account features.

For Codex, both auth.json and config.toml belong to the active connection version. When either file changes outside OcHub, review and save that version before switching away if you want to keep it.

App-specific settings

Open App settings in the upper-right corner of an app page:

App Main settings
Claude Code Skip MCP onboarding, Claude plugin integration, custom config directory
Codex Unified history, migrate existing sessions, custom config directory
OpenCode Custom config directory
OpenClaw Custom config directory
Hermes Custom config directory
Grok Build Custom config directory

A custom directory changes where configuration, MCP, or session history is read. Restart OcHub and the target tool after saving it.

Checks in the editor

  • Test URL measures the latency of an HTTP response.
  • Fetch models requests the model list with the current endpoint and key.
  • Check balance works only for upstream services that implement a compatible balance endpoint.
  • Files to be written shows generated content and destination paths.
  • Common configuration merges an app-level shared snippet into connections that enable it.

A successful test does not prove that a model can be called. A real request from the target CLI is the final check.

When configuration changed externally

OcHub treats each active connection as a saved configuration version. Before switching, it compares that saved version with the files currently on disk:

  1. Review the side-by-side file diff. Red shows the saved version and green shows the current file.
  2. Choose Save as new version to store the current files in the active connection, then switch. Switching back later restores this new version.
  3. Choose Revert to saved to discard the current on-disk edits, restore the saved connection version, then switch.
  4. Choose Cancel to leave both OcHub and the live files unchanged.

This flow applies to every switch-style app whose live configuration OcHub can read, including Claude Code, Codex, Grok Build, Kimi Code, and switch plugins. Codex shows auth.json and config.toml as separate files. Even malformed auth.json text is included and can be saved and restored exactly.

Do not let OcHub, cc-switch, and a manual editor write the same file at once.

Verify a new connection

After saving or switching a connection in any app:

  1. Review the generated file and path.
  2. Confirm the card is Added or Current after saving.
  3. Fully restart the target tool.
  4. Select the new provider and model.
  5. Make one short request.
  6. Check tool errors, OcHub usage, or upstream logs.
Problem Common cause
Connection missing It was saved but not added, or the directory is wrong
One connection replaced another Duplicate Provider ID in a coexistence app
401 Key, environment variable, or launch environment mismatch
404 / body error Wrong backend, protocol, or API mode
Model appears but fails Model ID, context limit, or permission mismatch
Advanced save fails Incorrect JSON/YAML node type

App-specific field guides

To bring in connections from an older manager, use Migrate from cc-switch instead of copying every entry by hand.

Navigation

Type to search…

↑↓ navigate↵ selectEsc close