Connect an agent
CC-Switch
CC-Switch manages provider switching for CLI tools including Claude Code, Codex, Gemini CLI and Grok Build. Add Yomi API as a custom provider to switch providers in one click without manually editing environment variables or configuration files each time.
Prerequisites
- Install at least one of Claude Code, Codex, Gemini CLI or Grok Build. See the Claude Code CLI and Codex CLI articles in this section for installation steps.
- Download and install CC-Switch from its official website or the releases page of its open-source repository.
- Create and save a key in the Yomi API console's API Keys page. It is visible only at creation.
Configure Yomi API
Use the Add Provider entry in CC-Switch to create a custom provider. Add separate configurations for Claude Code, Codex, Gemini CLI and Grok Build.
Add a provider for Claude Code
- Name: Yomi API (or any recognizable custom name)
- API address:
https://api.yomiapi.com - API Key:
YOUR_API_KEY(replace with your key)
If a default model field is available, enter a model ID such as claude-sonnet-5 or claude-opus-4-8.
Add a provider for Codex
- Name: Yomi API
- API address:
https://api.yomiapi.com/v1 - API Key:
YOUR_API_KEY
If a model is required, use gpt-5.6-sol or another ID from the Model Catalog.
Add a provider for Gemini
- Name: Yomi API
- API address:
https://api.yomiapi.com(without /v1; Gemini CLI appends the /v1beta path automatically) - API Key:
YOUR_API_KEY
If a model is required, use an available Gemini model ID from the Model Catalog.
Add a provider for Grok Build
- Name: Yomi API
- API address:
https://api.yomiapi.com/v1(with /v1; Grok Build uses the OpenAI-compatible format) - API Key:
YOUR_API_KEY
If a model is required, use grok-4.6 or another ID from the Model Catalog.
https://api.yomiapi.com (without /v1). Codex and Grok Build use the OpenAI-compatible format, so enter https://api.yomiapi.com/v1 (with /v1). Reversing these settings causes requests to fail.
Start and verify
- Switch the active provider to Yomi API in CC-Switch.
- Reopen the terminal or restart the running Claude Code / Codex session to apply the new configuration.
- Run the corresponding
claude/codex/gemini/grokcommand and send a test instruction. A normal response confirms successful setup. - Check the corresponding record under Usage in the Yomi API console User Center to confirm that the platform processed the request.
Common questions
Switching has no effect; the old provider is still used
Switches apply only to new sessions. Close and reopen the terminal, then start Claude Code or Codex. Also confirm that Yomi API is selected in CC-Switch.
401 authentication failure
The API key is incorrect, contains extra spaces from copying, or has been deleted. Check it in API Keys, then update the key for the corresponding provider in CC-Switch.
Model unavailable
Use a Model Catalog ID (such as claude-sonnet-5, gpt-5.6-sol), not a display name. Also confirm that your key's group includes the model.
Import error: Invalid provider app type: 'grokbuild'
Grok Build support requires CC-Switch v3.18.0 (2026-07-17) or later. Upgrade CC-Switch and try again.
