Integrations
Desktop and Web Clients
The following sections provide endpoint and protocol settings for Cherry Studio, Open WebUI, CC Switch, and Claude Code. Claude Code can also use ccNexus for protocol conversion when needed. Gemini CLI is not yet available.
Endpoint and Protocol Reference
| Client | Endpoint | Protocol or Type |
|---|---|---|
| Cherry Studio | https://api.khaix.net | OpenAI Responses |
| Open WebUI | https://api.khaix.net/v1 | OpenAI · Chat Completions by default |
| CC Switch · Claude Code | https://api.khaix.net | Anthropic Messages |
| CC Switch · Codex | https://api.khaix.net/v1 | OpenAI Responses |
| Direct Claude Code | https://api.khaix.net | Anthropic Messages |
| Claude Code via ccNexus | http://127.0.0.1:3000 | Local Messages conversion; upstream uses Responses |
| Gemini CLI | Not yet available | Requires the native Gemini protocol and cannot currently be configured |
Each client constructs request paths differently, so enter the endpoint exactly as shown in the table. Some require the site root, while others require /v1; one format cannot be used for every client.
Cherry Studio
First update to the current version from the Cherry Studio website, then configure KHaiXAPI with OpenAI Responses.
- Open Model Services and select Add Custom Provider.
- Enter
KHaiXAPIas the name andhttps://api.khaix.netas the API endpoint. - Enter the API Key assigned to this client.
- Manually add the text model
gpt-5.6-sol. - Open More Endpoints for the provider and enable
OpenAI Responses. - Run the connection test, save the configuration, and send a text message.
Open WebUI
Add KHaiXAPI through Open WebUI's OpenAI-compatible connection.
- As an administrator, open Admin Settings → Connections → OpenAI.
- Add a connection, enter
https://api.khaix.net/v1as the URL, and enter the API Key. - Use the default Chat Completions protocol for the initial connection. For image requests, use the Image API separately; do not enter
gpt-image-2as a chat model. - After saving, check the model list. If the model does not appear automatically, enter
gpt-5.6-solunder Model IDs (Filter). - Start a new conversation, send a text message, and review the request record in the console.
If the current version provides a Responses API Type, test it separately after Chat Completions works. If conversations, streaming, or tool calls behave unexpectedly, switch back to Chat Completions to determine whether the issue is protocol-related.
CC Switch
CC Switch centrally manages provider configurations for applications such as Claude Code and Codex. Install the current stable version from the official Releases page, then follow the official provider setup guide for the settings below.
- Open CC Switch, choose the application to configure from the app switcher at the top, then click the “+” button in the upper-right corner. Choose App-Specific Provider for the current application only, or Unified Provider when the configuration should be reused.
- Enter
KHaiXAPIas the provider name, select a custom provider, and use a separately created API Key for the current application. - For Claude Code, enter
https://api.khaix.netas the API endpoint, selectAnthropic Messagesas the API format, and enterclaude-sonnet-5as the main model. For role mappings, select supported models from the console, such asclaude-opus-4-8andclaude-fable-5. - For Codex, enter
https://api.khaix.net/v1as the API endpoint, selectOpenAI Responsesas the API format, and entergpt-5.6-solas the model. - Use Fetch Models to load the model list. If the current application or provider type does not support automatic fetching, enter the model IDs above manually. Save the provider, then enable KHaiXAPI.
- Run Stream Check first. After it succeeds, launch the target application from CC Switch, send a short message, and confirm the protocol, model, and status in the KHaiXAPI console.
Claude Code
KHaiXAPI provides POST /v1/messages natively, so Claude Code can connect directly. Use ccNexus only when the key group does not support Messages dispatch, the client version is outdated, or local model mapping is required.
Direct Native Messages Connection
First set temporary variables in the current terminal and start Claude Code. After confirming the connection works, persist them through the operating system or terminal's secret-management mechanism.
export ANTHROPIC_BASE_URL="https://api.khaix.net"
export ANTHROPIC_AUTH_TOKEN="$KHAIX_API_KEY"
export ANTHROPIC_MODEL="claude-sonnet-5"
claude$env:ANTHROPIC_BASE_URL = "https://api.khaix.net"
$env:ANTHROPIC_AUTH_TOKEN = $env:KHAIX_API_KEY
$env:ANTHROPIC_MODEL = "claude-sonnet-5"
claude- After startup, run
/statusto confirm the Base URL, authentication status, and model. - Send a text task first, then perform one read-only tool call.
- In the KHaiXAPI console, confirm that the request used the Messages protocol and the correct model.
ccNexus Alternative
ccNexus is a third-party local protocol converter. Use it only when direct access is unavailable or local model mapping is required. Verify the version and download source before installation.
- Add an upstream service in ccNexus: enter
https://api.khaix.netas the API endpoint and selectOpenAI Responsesas the converter. - Enter the KHaiXAPI key and text model
gpt-5.6-solin ccNexus, save, and run the endpoint test. - Start the local service and confirm it listens only on the local host. The example below uses the default port
3000. - Set Claude Code's
ANTHROPIC_BASE_URLtohttp://127.0.0.1:3000. - For Claude Code's authentication token, use a placeholder value accepted by the local proxy. Keep the real KHaiXAPI key only in the ccNexus upstream configuration.
export ANTHROPIC_BASE_URL="http://127.0.0.1:3000"
export ANTHROPIC_AUTH_TOKEN="ccnexus-local"
export ANTHROPIC_MODEL="gpt-5.6-sol"
claudeIf the ccNexus listening port or local authentication value changes, update the corresponding values in the example. Claude Code uses only the local proxy's authentication value.
Gemini CLI
There is currently no Base URL, environment variable, or test command available. Check the console for availability.
Verification and Security
- Keys: Create a separate key for each client to simplify limits, auditing, and revocation.
- Text: Send "Reply with: connection successful," then review the response and console record.
- Endpoint: For a 404 error, check for
/v1/v1, an incorrect endpoint, or a path automatically appended by the client. - Streaming and tools: Enable each feature one at a time after text requests work so protocol and key issues are easier to distinguish.
- Logs: Show only a few characters of a key in screenshots and support records.
- Automatic execution: Keep permission confirmations enabled for agent clients such as Claude Code when working in untrusted directories.