Documentation Navigation
On This Page

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

ClientEndpointProtocol or Type
Cherry Studiohttps://api.khaix.netOpenAI Responses
Open WebUIhttps://api.khaix.net/v1OpenAI · Chat Completions by default
CC Switch · Claude Codehttps://api.khaix.netAnthropic Messages
CC Switch · Codexhttps://api.khaix.net/v1OpenAI Responses
Direct Claude Codehttps://api.khaix.netAnthropic Messages
Claude Code via ccNexushttp://127.0.0.1:3000Local Messages conversion; upstream uses Responses
Gemini CLINot yet availableRequires 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.

  1. Open Model Services and select Add Custom Provider.
  2. Enter KHaiXAPI as the name and https://api.khaix.net as the API endpoint.
  3. Enter the API Key assigned to this client.
  4. Manually add the text model gpt-5.6-sol.
  5. Open More Endpoints for the provider and enable OpenAI Responses.
  6. Run the connection test, save the configuration, and send a text message.

Open WebUI

Add KHaiXAPI through Open WebUI's OpenAI-compatible connection.

  1. As an administrator, open Admin Settings → Connections → OpenAI.
  2. Add a connection, enter https://api.khaix.net/v1 as the URL, and enter the API Key.
  3. Use the default Chat Completions protocol for the initial connection. For image requests, use the Image API separately; do not enter gpt-image-2 as a chat model.
  4. After saving, check the model list. If the model does not appear automatically, enter gpt-5.6-sol under Model IDs (Filter).
  5. 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.

  1. 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.
  2. Enter KHaiXAPI as the provider name, select a custom provider, and use a separately created API Key for the current application.
  3. For Claude Code, enter https://api.khaix.net as the API endpoint, select Anthropic Messages as the API format, and enter claude-sonnet-5 as the main model. For role mappings, select supported models from the console, such as claude-opus-4-8 and claude-fable-5.
  4. For Codex, enter https://api.khaix.net/v1 as the API endpoint, select OpenAI Responses as the API format, and enter gpt-5.6-sol as the model.
  5. 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.
  6. 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.

macOS / Linux
export ANTHROPIC_BASE_URL="https://api.khaix.net"
export ANTHROPIC_AUTH_TOKEN="$KHAIX_API_KEY"
export ANTHROPIC_MODEL="claude-sonnet-5"
claude
PowerShell
$env:ANTHROPIC_BASE_URL = "https://api.khaix.net"
$env:ANTHROPIC_AUTH_TOKEN = $env:KHAIX_API_KEY
$env:ANTHROPIC_MODEL = "claude-sonnet-5"
claude
  1. After startup, run /status to confirm the Base URL, authentication status, and model.
  2. Send a text task first, then perform one read-only tool call.
  3. 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.

  1. Add an upstream service in ccNexus: enter https://api.khaix.net as the API endpoint and select OpenAI Responses as the converter.
  2. Enter the KHaiXAPI key and text model gpt-5.6-sol in ccNexus, save, and run the endpoint test.
  3. Start the local service and confirm it listens only on the local host. The example below uses the default port 3000.
  4. Set Claude Code's ANTHROPIC_BASE_URL to http://127.0.0.1:3000.
  5. 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.
macOS / Linux · ccNexus
export ANTHROPIC_BASE_URL="http://127.0.0.1:3000"
export ANTHROPIC_AUTH_TOKEN="ccnexus-local"
export ANTHROPIC_MODEL="gpt-5.6-sol"
claude

If 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

  1. Keys: Create a separate key for each client to simplify limits, auditing, and revocation.
  2. Text: Send "Reply with: connection successful," then review the response and console record.
  3. Endpoint: For a 404 error, check for /v1/v1, an incorrect endpoint, or a path automatically appended by the client.
  4. Streaming and tools: Enable each feature one at a time after text requests work so protocol and key issues are easier to distinguish.
  5. Logs: Show only a few characters of a key in screenshots and support records.
  6. Automatic execution: Keep permission confirmations enabled for agent clients such as Claude Code when working in untrusted directories.