GGateYourWay API
SDKs and clients RU Create key

SDKs and clients

Choose an app, download its file, and insert your key. No shell environment setup or separate .env files.

01

Your application's file

Get your key from the cabinet. Its group must match the selected model group.

Operating system

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
2. Start a new session

Configuration reference: . Connection failed?

02

Save and check

  1. 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.
  2. Windows: paste the folder path into File Explorer. %USERPROFILE% opens your home folder. Enable file name extensions: use settings.json, not settings.json.txt. Use UTF-8 JSON without comments or trailing commas.
  3. Replace gyw-sk-YOUR_KEY with 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.
  4. Check the model and result in request history. A text response alone does not verify tools, images, or long documents.
03

Claude Code: settings.json

Fable 5 example. Download a file above for another model.

settings.json
{
  "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.

04

SDK

Select Python or JavaScript above to download a complete request example.

python
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)
python
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)
settings
OpenAI Base URL: https://api.gateyourway.com/v1/cursor
API key: gyw-sk-YOUR_KEY
Custom model: gyw-opus-5
toml
model = "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"
05

Files and addresses

ClientProtocol / base URLNote
Claude Codehttps://api.gateyourway.com~/.claude/settings.json
OpenCode / Claudehttps://api.gateyourway.com/v1@ai-sdk/anthropic
OpenCode / GPT, Grokhttps://api.gateyourway.com/v1@ai-sdk/openai-compatible
Cursor / Opus 5https://api.gateyourway.com/v1/cursorgyw-opus-5; Claude Arctic key
Cursor / GLM 5.3 Flashhttps://api.gateyourway.com/v1glm-5.3-flash; GLM 5.3 Flash key
Codex CLIhttps://api.gateyourway.com/v1wire_api = "responses"
CC SwitchSelected app's settingsA settings manager, not an inference client. Claude Code or Codex runs the actual request.
Pi~/.pi/agent/models.jsonopenai-responses, openai-completions, or anthropic-messages
oh-my-pi~/.omp/agent/models.ymlSeparate YAML schema; do not reuse the Pi config.
Roo CodeOpenAI Compatible or AnthropicSet a custom base URL and the exact model ID.
ClineOpenAI Compatible or AnthropicVerify the connection before starting an agent task.
06

Connection troubleshooting

SymptomCheck
401 / Invalid or revoked keyCheck 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.
403The 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.
402Check the available balance for the key group.
Codex: Missing environment variableAn 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 missingFor the Opus bridge, check /v1/cursor and model ID gyw-opus-5.
Cursor + GLM 404 / model missingGLM needs https://api.gateyourway.com/v1 and glm-5.3-flash. Do not use the Opus bridge at /v1/cursor.
OpenCode 404 / provider errorUse /v1, claude-opus-5, and @ai-sdk/anthropic.
Image was not receivedCheck attachment: true, image modality, and a real attachment preview.
First turn works, second stallsSave the time, client version, request ID, and last six key characters; never send the full key.
502 / 503 / 504Record 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.