Kimi K3 Integration Guide: Base URL, Claude Code, and Codex

Connect Kimi K3 through GPT88, verify the API, configure Claude Code or Codex CLI, and diagnose endpoint and socket errors.

Short answer

  • OpenAI-compatible SDKs and cURL use https://api.gpt88.cc with /v1/chat/completions.
  • Codex providers typically use https://api.gpt88.cc/v1.
  • Claude Code uses the Anthropic-compatible endpoint at https://api.gpt88.cc.
  • The model ID is exactly kimi-k3.

Prerequisites

  1. Create a GPT88 API key and keep it in an environment variable, never in Git or frontend code.
  2. Confirm balance or available quota and that the key can access kimi-k3.
  3. Use a client version that supports a custom OpenAI or Anthropic endpoint.
terminalbash
export GPT88_API_KEY=your_gpt88_api_key

Verify the API first

list-modelsbash
curl https://api.gpt88.cc/v1/models \
  -H "Authorization: Bearer $GPT88_API_KEY"
chat-completionsbash
curl https://api.gpt88.cc/v1/chat/completions \
  -H "Authorization: Bearer $GPT88_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "kimi-k3",
    "stream": false,
    "messages": [{"role": "user", "content": "Describe Kimi K3 in three sentences."}]
  }'

Success means a JSON response with content under choices[0].message.content. If this fails, record the status code and error body before changing client settings. Check the key, balance, model permission, and path first.

You can also open the Kimi K3 model page or the error reference.

Claude Code configuration

claude-codebash
export ANTHROPIC_BASE_URL=https://api.gpt88.cc
export ANTHROPIC_API_KEY="$GPT88_API_KEY"
export ANTHROPIC_MODEL=kimi-k3
claude

If the client only accepts the official Claude model list, a custom model ID may be rejected. Upgrade the client and confirm custom model support, or use an OpenAI-compatible client to isolate the API first.

Codex CLI configuration

~/.codex/config.tomltoml
# ~/.codex/config.toml
model = "kimi-k3"
model_provider = "gpt88"

[model_providers.gpt88]
name = "gpt88"
base_url = "https://api.gpt88.cc/v1"
env_key = "GPT88_API_KEY"

# shell
export GPT88_API_KEY="your-gpt88-api-key"
codex --model kimi-k3

Configuration key names vary by Codex version, but preserve the three values: model kimi-k3, provider URL https://api.gpt88.cc/v1, and the GPT88 API key.

Claude Code or Codex

  • Choose Codex: repository changes, terminal commands, tests, patches, and long coding tasks.
  • Choose Claude Code: an existing Claude workflow with custom model and Anthropic endpoint support.
  • Only testing K3: start with cURL, the Python OpenAI SDK, or ChatBox.

Troubleshoot connection errors

  1. Run the same /v1/models and /v1/chat/completions requests with the same key.
  2. Use exactly kimi-k3, not a display name or an arbitrary openai/ prefix.
  3. Check whether the client expects a Base URL or a complete endpoint and avoid duplicate /v1.
  4. Remove extra spaces, quotes, and newlines from the key; check balance and HTTPS proxy settings.
  5. If cURL succeeds but the client fails, investigate protocol adaptation, model allowlists, client version, and proxy configuration.

Acceptance checklist

  • The key is injected through an environment variable.
  • GET https://api.gpt88.cc/v1/models confirms model access.
  • The request model is kimi-k3.
  • OpenAI-compatible requests use https://api.gpt88.cc; the Codex provider uses https://api.gpt88.cc/v1.
  • A small real-project test records success rate, latency, context behaviour, and actual cost.