Docs/ Configuration

Client setup

Most clients require only two changes: point the endpoint to GPT-Load and replace the provider key with an AccessKey.

General rules §

For any client, change the same two settings:

  • Endpoint URL — Set it to http://127.0.0.1:3001. Whether to include /v1 depends on the client; see the examples below.
  • Key — Use the AccessKey created in the management UI, not the upstream provider's key.

Keep the client's native authentication method; the gateway accepts Authorization: Bearer, x-api-key, x-goog-api-key, and Gemini's key query parameter.

Model names must match

The requested model must be exposed by a Group authorized for this AccessKey. If the model is reported missing, check the Group's Models tab; see Groups and channels.

Let the management UI generate the configuration §

The management UI can generate connection settings for each client. Select an AccessKey and target client, then copy the generated configuration.

FIG. 1 — One-click configuration generationSelect Key and Client

Supports Claude Code, Codex, Gemini CLI, Cherry Studio, Cline, NextChat, Open WebUI, CC Switch, New API, and curl. The generated configuration states which protocol the client needs, so tick that one and you cannot go wrong.

OpenAI SDK§

The official SDK requires only two changes:

Python
from openai import OpenAI

client = OpenAI(
    base_url="http://127.0.0.1:3001/v1",    # Change this line 
    api_key= "Your AccessKey" ,           # Change this line 
)

resp = client.chat.completions.create(
    model= "Your model name" ,
    messages=[{"role": "user", "content":  "Hello" }],
)
Node.js
import OpenAI from "openai";

const client = new OpenAI({
  baseURL: "http://127.0.0.1:3001/v1",
  apiKey:  "Your AccessKey" ,
});

Environment variables work too: set OPENAI_BASE_URL and OPENAI_API_KEY without changing the code.

Anthropic SDK§

Python
from anthropic import Anthropic

client = Anthropic(
    base_url="http://127.0.0.1:3001",    # Note: do not include /v1 
    api_key= "Your AccessKey" ,
)

Anthropic clients use /v1/messages. The SDK appends that path, so set base_url to the server root.

Claude Code§

Use environment variables to point to the gateway:

Set in terminal before starting
export ANTHROPIC_BASE_URL="http://127.0.0.1:3001"
export ANTHROPIC_AUTH_TOKEN= "Your AccessKey" 

claude

Add the variables to your shell profile to make them persistent. Enable the Anthropic Messages protocol on this AccessKey.

Codex CLI§

Codex uses the OpenAI protocol. Point its endpoint and key to the gateway, or copy the Codex configuration generated by the management UI.

Environment variable method
export OPENAI_BASE_URL="http://127.0.0.1:3001/v1"
export OPENAI_API_KEY= "Your AccessKey" 
Codex needs Responses, not Chat Completions

This AccessKey must have the OpenAI Responses protocol ticked. Codex uses the Responses API; if you tick only Chat Completions the request is rejected outright — route checking will show protocol_filtered.

Do not confuse with subscription account

This section covers connecting the Codex client to the gateway. Using a Codex subscription account as an upstream is a separate workflow; see Subscription accounts.

Gemini CLI§

Environment variable method
export GOOGLE_GEMINI_BASE_URL="http://127.0.0.1:3001"
export GEMINI_API_KEY= "Your AccessKey" 

Gemini clients use /v1beta/models/…. Enable the Gemini protocol on the AccessKey.

Desktop clients §

GUI clients such as Cherry Studio, NextChat, Open WebUI, and Cline usually expose Custom API Address and API Key fields. Configure them as follows:

  • API Address: http://127.0.0.1:3001/v1
  • API Key: your AccessKey
  • Model: enter a model exposed by the Group. Some clients can fetch the list automatically with Get Models.

For screenshot steps specific to a client, using the management UI's one-click generation is faster—it will give the exact fields corresponding to that client.

When unable to connect §

Troubleshoot in this order; the first two steps identify most problems:

  1. Use curl first to verify the gateway itself — This separates gateway behavior from client configuration problems:
Minimum Verification
curl http://127.0.0.1:3001/v1/chat/completions \
  -H  "Authorization: Bearer Your AccessKey"  \
  -H "Content-Type: application/json" \
  -d '{ "model":"Your model name","messages":[{"role":"user","content":"hi"}]}'
  1. curl works but the client does not — Usually the endpoint has an extra or missing /v1, or the protocol is not enabled on the AccessKey.
  2. Prompt indicates the model does not exist — Confirm that the model is exposed in the Group's Models tab.
  3. Request sent but failed — Use Request Logs in Monitoring and troubleshooting for the exact error; Route Check shows candidate Groups and the number of available credentials.
Client setup - GPT-Load