GGateYourWay API
Status RU Create key
Integrations

SDKs and clients

Choose the compatible protocol and do not mix Anthropic-scoped and OpenAI-scoped keys in one provider configuration.

01

SDK

python
from openai import OpenAI

client = OpenAI(
    api_key="gyw-sk-YOUR_KEY",
    base_url="https://api.gateyourway.com/v1",
)
python
import anthropic

client = anthropic.Anthropic(
    api_key="gyw-sk-YOUR_KEY",
    base_url="https://api.gateyourway.com",
)
settings
OpenAI Base URL: https://api.gateyourway.com/v1/cursor
API key: gyw-sk-YOUR_KEY
Custom model: gyw-opus-5
toml
# ~/.codex/config.toml
[model_providers.gateyourway]
name = "GateYourWay"
base_url = "https://api.gateyourway.com/v1"
# env_key is the environment variable name, not the API key itself.
env_key = "GATEYOURWAY_API_KEY"
wire_api = "responses"

# ~/.codex/gateyourway.config.toml
model_provider = "gateyourway"
model = "gpt-5.6-luna"
02

Compatibility rules

ClientProtocol / base URLNote
Claude Codehttps://api.gateyourway.comANTHROPIC_API_KEY + ANTHROPIC_BASE_URL
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
Codex CLIhttps://api.gateyourway.com/v1wire_api = "responses"
CC SwitchCustom OpenAI or AnthropicMatch the protocol to the key family.
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.
03

Cursor + Claude Opus 5

Cursor Agent/Chat uses a dedicated OpenAI-compatible bridge. Do not use the normal Anthropic model ID here.

SettingValue
ModeCustom OpenAI API
OpenAI Base URLhttps://api.gateyourway.com/v1/cursor
Modelgyw-opus-5
Key groupClaude Arctic
Context profile1,000,000
Default maximum output128,000
Reasoningadaptive, default max

Bridge smoke check

bash
curl https://api.gateyourway.com/v1/cursor/models \
  -H "Authorization: Bearer gyw-sk-YOUR_CLAUDE_ARCTIC_KEY"

The response should contain only gyw-opus-5. Then verify a real Agent/Chat turn, a tool call, and continuation after the tool result.

04

OpenCode + Claude Opus 5

OpenCode uses the native Anthropic Messages transport through @ai-sdk/anthropic. Opus 5 requires a Claude Arctic key.

opencode.json
{
  "$schema": "https://opencode.ai/config.json",
  "model": "gateyourway/claude-opus-5",
  "small_model": "gateyourway/claude-opus-5",
  "attachment": {
    "image": {
      "auto_resize": true,
      "max_width": 2000,
      "max_height": 2000,
      "max_base64_bytes": 5242880
    }
  },
  "compaction": {
    "auto": true,
    "prune": true,
    "reserved": 128000
  },
  "provider": {
    "gateyourway": {
      "npm": "@ai-sdk/anthropic",
      "name": "GateYourWay",
      "options": {
        "baseURL": "https://api.gateyourway.com/v1",
        "apiKey": "{env:GATEYOURWAY_API_KEY}",
        "timeout": 1800000,
        "chunkTimeout": 120000
      },
      "models": {
        "claude-opus-5": {
          "name": "Claude Opus 5 - 1M / 128K",
          "attachment": true,
          "modalities": {
            "input": ["text", "image"],
            "output": ["text"]
          },
          "limit": {
            "context": 1000000,
            "output": 128000
          }
        }
      }
    }
  }
}
  • baseURL already includes /v1; do not append /messages.
  • small_model is pinned to Opus 5 so background operations do not switch to an unsupported model.
  • modalities.input declares text + image support; without it OpenCode may drop the image part.
  • timeout / chunkTimeout allow long reasoning and tool loops to complete.

API smoke check outside the client

bash
curl https://api.gateyourway.com/v1/messages \
  -H "x-api-key: $GATEYOURWAY_API_KEY" \
  -H "anthropic-version: 2023-06-01" \
  -H "content-type: application/json" \
  -d '{
    "model": "claude-opus-5",
    "max_tokens": 256,
    "messages": [{"role":"user","content":"Reply with exactly: GateYourWay OpenCode OK"}]
  }'

After starting OpenCode, verify opencode debug config, two consecutive turns, tool-result continuation, and vision with a real attachment rather than a text file path.

05

Current configuration formats

These paths and fields follow the latest official client guides. Pi and oh-my-pi configuration formats are not interchangeable.

ClientConfiguration targetCritical rule
Codex CLI~/.codex/config.toml + ~/.codex/gateyourway.config.tomlenv_key contains the name GATEYOURWAY_API_KEY, not the secret. Do not use [profiles.gateyourway].
Claude CodeCurrent shell environmentANTHROPIC_API_KEY + ANTHROPIC_BASE_URL; base URL without /v1
CC SwitchApp-specific Custom providerUse env JSON for Claude Code; keep the new separate profile file for Codex.
Pi~/.pi/agent/models.jsonJSON provider; Pi reloads the file automatically.
oh-my-pi~/.omp/agent/models.ymlYAML provider with an explicit api.
Roo CodeSettings → API ProviderOpenAI Compatible for GPT/Grok; Anthropic for Claude.
ClineAPI Provider settingsSet the custom base URL, key, and model ID, then run Verify.

Official sources: Codex CLI, Claude Code, CC Switch, Pi, oh-my-pi, Roo Code, Cline.

06

Troubleshooting

SymptomCheck
Codex: Missing environment variableenv_key must be GATEYOURWAY_API_KEY. Export the actual key in that environment variable.
Codex: legacy profile errorRemove profile = "gateyourway" and [profiles.gateyourway]; use a separate gateyourway.config.toml.
Cursor 404 / model missingCheck /v1/cursor and model ID gyw-opus-5.
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.
07

Automatic setup

The assistant generates separate current configurations for Codex CLI, Claude Code, CC Switch, Pi, oh-my-pi, Roo Code, and Cline. Cursor and OpenCode keep their existing specialized instructions.

Local assistant

Build a client configuration

The key is inserted only into the local browser result and is not saved to storage.

Browser only
Operating system