SDKs and clients
Choose an app, download its file, and insert your key. No shell environment setup or separate .env files.
Your application's file
Get your key from the cabinet. Its group must match the selected model group.
Leave the key empty to replace the placeholder in the downloaded file. An entered key is not sent to a server or saved in browser storage.
- 1. File location
- SDK dependency
- 2. Start a new session
Configuration reference: . Connection failed?
Save and check
- If a file already exists, back it up and merge the settings. Preserve other providers, MCP servers, hooks, and permissions. The new file must not be named
settings (1).json. - Windows: paste the folder path into File Explorer.
%USERPROFILE%opens your home folder. Enable file name extensions: usesettings.json, notsettings.json.txt. Use UTF-8 JSON without comments or trailing commas. - Replace
gyw-sk-YOUR_KEYwith your full key unless you entered it above. Close the old client session and start a new one. Send “Reply OK”, then ask it to read a small test file and report its contents. - Check the model and result in request history. A text response alone does not verify tools, images, or long documents.
Claude Code: settings.json
Fable 5 example. Download a file above for another model.
{
"model": "claude-fable-5",
"env": {
"ANTHROPIC_BASE_URL": "https://api.gateyourway.com",
"ANTHROPIC_AUTH_TOKEN": "gyw-sk-YOUR_KEY",
"ANTHROPIC_API_KEY": "",
"ANTHROPIC_MODEL": "claude-fable-5"
}
}"env" is a native Claude Code settings section, not a separate .env file. ANTHROPIC_AUTH_TOKEN contains the key; an empty ANTHROPIC_API_KEY clears the competing credential.
After restarting, check /status and /model. If the model or key differs, inspect the project’s .claude/settings.json and .claude/settings.local.json: these override user settings. --model also changes the selected model. Official settings and precedence.
SDK
Select Python or JavaScript above to download a complete request example.
from openai import OpenAI
client = OpenAI(
api_key="gyw-sk-YOUR_KEY",
base_url="https://api.gateyourway.com/v1",
)
response = client.responses.create(model="gpt-5.6-luna", input="Reply OK")
print(response.output_text)import anthropic
client = anthropic.Anthropic(
api_key="gyw-sk-YOUR_KEY",
base_url="https://api.gateyourway.com",
)
message = client.messages.create(
model="claude-fable-5", max_tokens=256,
messages=[{"role": "user", "content": "Reply OK"}],
)
print(message.content)OpenAI Base URL: https://api.gateyourway.com/v1/cursor
API key: gyw-sk-YOUR_KEY
Custom model: gyw-opus-5model = "gpt-5.6-luna"
model_provider = "gateyourway"
[model_providers.gateyourway]
name = "GateYourWay"
base_url = "https://api.gateyourway.com/v1"
wire_api = "responses"
experimental_bearer_token = "gyw-sk-YOUR_KEY"Files and addresses
| Client | Protocol / base URL | Note |
|---|---|---|
| Claude Code | https://api.gateyourway.com | ~/.claude/settings.json |
| OpenCode / Claude | https://api.gateyourway.com/v1 | @ai-sdk/anthropic |
| OpenCode / GPT, Grok | https://api.gateyourway.com/v1 | @ai-sdk/openai-compatible |
| Cursor / Opus 5 | https://api.gateyourway.com/v1/cursor | gyw-opus-5; Claude Arctic key |
| Cursor / GLM 5.3 Flash | https://api.gateyourway.com/v1 | glm-5.3-flash; GLM 5.3 Flash key |
| Codex CLI | https://api.gateyourway.com/v1 | wire_api = "responses" |
| CC Switch | Selected app's settings | A settings manager, not an inference client. Claude Code or Codex runs the actual request. |
| Pi | ~/.pi/agent/models.json | openai-responses, openai-completions, or anthropic-messages |
| oh-my-pi | ~/.omp/agent/models.yml | Separate YAML schema; do not reuse the Pi config. |
| Roo Code | OpenAI Compatible or Anthropic | Set a custom base URL and the exact model ID. |
| Cline | OpenAI Compatible or Anthropic | Verify the connection before starting an agent task. |
Connection troubleshooting
| Symptom | Check |
|---|---|
| 401 / Invalid or revoked key | Check the complete key without quotes, spaces, or Bearer. Verify the address and project/profile settings. In Claude Code do not leave different AUTH_TOKEN and API_KEY values. A 401 does not prove the intended key was sent. |
| 403 | The key was recognized but access was denied. Compare the key and model groups in the cabinet; one model ID can be offered in several groups. |
| 402 | Check the available balance for the key group. |
| Codex: Missing environment variable | An old provider still contains env_key. The file-only configuration uses experimental_bearer_token inside [model_providers.gateyourway]; do not combine it with env_key or auth. |
| Cursor + Opus 404 / model missing | For the Opus bridge, check /v1/cursor and model ID gyw-opus-5. |
| Cursor + GLM 404 / model missing | GLM needs https://api.gateyourway.com/v1 and glm-5.3-flash. Do not use the Opus bridge at /v1/cursor. |
| OpenCode 404 / provider error | Use /v1, claude-opus-5, and @ai-sdk/anthropic. |
| Image was not received | Check attachment: true, image modality, and a real attachment preview. |
| First turn works, second stalls | Save the time, client version, request ID, and last six key characters; never send the full key. |
| 502 / 503 / 504 | Record the HTTP status, time with timezone, and request ID. Do not randomly change models or keys. Do not automatically retry after useful output has arrived. |