Getting started

Use it in an app

Connect the tools you already use with your APIKing key. Pick an app, follow the setup steps, and copy its settings. Claude Code uses Claude models; Gemini CLI uses Gemini models.

#1. Pick your app

Chat and translation apps

Coding tools

Your own code

#2. Copy the settings

Cherry Studio

Open: Settings → Model Providers → Add provider

  1. Create a custom OpenAI-compatible provider named APIKing. Enter the API key and host, then enable the provider.
  2. Sync models or add the exact Model ID manually. In a new chat, select the model under APIKing and send a test message.

API Key

API Host

Model ID

Enter the site root in API Host. Cherry Studio appends the request path.

Keep your API key private

Store the key in an environment variable or secret manager. Never paste a permanent key into browser code, screenshots, or a repository.

#3. Check it works

  1. Pick the model in the app and send a short message such as “hello”.
  2. Open Console → Usage and look for the test request with the model you selected.
  3. For a 401, check that the APIKing key is active. For a 404 or model error, check the URL and exact Model ID in the selected guide.

#MCP tools

Model connection and MCP are separate

APIKing provides the model connection. MCP servers provide external tools and data. Configure the APIKing provider and each MCP server separately inside Codex, Cursor, or your other client.

For Codex, add a remote MCP server with the CLI or place the equivalent block in ~/.codex/config.toml:

Codex MCP
# CLI
codex mcp add my-tools --url https://mcp.example.com/mcp

# equivalent ~/.codex/config.toml
[mcp_servers.my-tools]
url = "https://mcp.example.com/mcp"

MCP authentication is separate

Your APIKing API key authenticates model requests only. Follow the MCP server provider’s instructions for OAuth, headers, or environment variables, then restart the client so it reloads the configuration.

#Moving from the OpenAI SDK

#The two-line diff

For most codebases this is the entire PR. Because the wire format is OpenAI-compatible, streaming, tool calling, vision, and structured outputs continue to work with the code you already have.

const client = new OpenAI({
- baseURL: "https://api.openai.com/v1",
+ baseURL: "https://apiking.ai/v1",
- apiKey: process.env.OPENAI_API_KEY,
+ apiKey: process.env.GATEWAY_API_KEY,
});

Still stuck?

Send us the request ID or the error message and we will look into it.