Skip to content

Overview ​

This guide helps you connect these AI coding tools to an official API, a self-hosted compatible gateway or a third-party compatible service:

  • Codex
  • Claude Code
  • OpenCode
  • GitHub Copilot CLI

It is a provider-agnostic setup guide: the portable configuration and troubleshooting advice is not tied to one service. KunCode examples show the format only; they are not a prerequisite.

The core workflow is simple: identify your service source, obtain a key and service address, then point the tool at that service.

Placeholder conventions ​

This site deliberately uses two kinds of example addresses: the beginner quickstart uses the generic placeholder https://gateway.example.com, while tool pages use the KunCode example https://kuncode.120403.xyz. Both are placeholders only; replace them with your own service address when you configure a tool.

Keys are shown as sk-your-key or sk-xxxxxxxx, which are also placeholders. A real key's format is decided by the provider and may not start with sk-.

Model names such as deepseek-flash and gpt-5 are examples as well. Call /v1/models and replace them with a model ID actually returned by your service.

PlaceholderReplace it with
https://gateway.example.com or https://kuncode.120403.xyzYour own service address
sk-your-key or sk-xxxxxxxxThe API key issued by your provider
deepseek-flash or gpt-5A model ID actually returned by /v1/models

Identify your service source ​

Service sourceWhat you needWhere to get it
Official APIOfficial key, service address, model names and protocolFollow the OpenAI, Anthropic or other official platform documentation
Self-hosted compatible gatewayGateway address, key and available modelsFollow your deployment documentation or administrator instructions
Third-party compatible serviceProvider key, API endpoint and available modelsSign in to the provider console and follow its documentation

If you use an official API or self-hosted gateway, there may be no sign-in-to-provider-console step. Follow the documentation for that platform. This guide covers client configuration and troubleshooting only; it does not provide account signup, key issuance, top-ups or provider support.

Three steps ​

  1. Prepare an API key and service address from the console, administrator or provider documentation for your service source.
  2. Pick an endpoint: OpenAI Chat Completions, OpenAI Responses or Anthropic Messages.
  3. Configure and verify by writing the Base URL and key the tool expects into its config file, then run a command to confirm it works.

New to API keys, groups, channels and ratios? Start with Concepts.

Want to just follow along once? See 15-minute minimal setup, which strings these three steps into one copy-pasteable command line using a single fixed set of placeholders.

What you need ​

ItemDescription
API keyA credential from your provider or gateway; it does not have to start with sk-
Service addressThe address supplied by the official API, self-hosted gateway or third-party service
Model nameThe model ID actually served, e.g. gpt-5 or claude-sonnet-4
The toolCodex / Claude Code / OpenCode / GitHub Copilot CLI already installed

About service addresses

https://your-gateway.example.com is a generic placeholder. Replace it with your own service address.

Some pages use KunCode as a demo, which is just one option among many. For whether a tool expects the root path or a path ending in /v1, use that tool setup page and the Base URL guidance in Choose an endpoint.

Next ​

Released under the CC BY-SA 4.0 license

Copyright © 2023-2026 final

Disclaimer