Python SDK
Two supported paths in Python. Lead with the stock SDKs; reach for the branded wrapper for ergonomics.
Option 1 — stock SDKs (zero new deps)
Section titled “Option 1 — stock SDKs (zero new deps)”from openai import OpenAIclient = OpenAI( base_url="https://api.opengateway.one/oss/v1", # includes /v1 api_key="YOUR_KEY",)from anthropic import Anthropicanthropic = Anthropic( base_url="https://api.opengateway.one/oss", # NO /v1 api_key="YOUR_KEY",)Option 2 — the branded opengateway wrapper
Section titled “Option 2 — the branded opengateway wrapper”pip install "opengateway[all]" # wrapper + stock openai & anthropic clientsIt wraps (never forks) the stock clients, importing them lazily so
import opengateway works even without them installed.
from opengateway import OpenGateway
og = OpenGateway(api_key="YOUR_KEY") # lane="oss" by default
resp = og.complete( model="qwen3-coder", # -> claude-turbo-hub-qwen3-coder effort="high", # -> reasoning_effort="high" messages=[{"role": "user", "content": "Refactor this function."}],)print(resp.choices[0].message.content)
# Full stock OpenAI surface (base URL baked in):og.openai.responses.create(model="claude-turbo-hub-gpt-oss-120b", input="hi")og.openai.embeddings.create(model="Qwen/Qwen3-Embedding-0.6B", input="hi")
# Anthropic Messages on the same gateway/lane (base URL omits /v1):og.anthropic.messages.create( model="claude-turbo-hub-qwen3-coder", max_tokens=256, messages=[{"role": "user", "content": "Review this diff."}],)Helpers
Section titled “Helpers”from opengateway import ( openai_base_url, # -> .../oss/v1 (includes /v1) anthropic_base_url, # -> .../oss (no /v1) resolve_alias, # "qwen3-coder" -> "claude-turbo-hub-qwen3-coder" to_reasoning_effort, # "max" -> "xhigh" to_anthropic_effort, # "high" -> {"thinking": {...}, "output_config": {...}}) OpenGateway Guide
Ask about configuring OpenGateway — lanes, base URLs, client setup, model choice, or an error you hit. Answers are grounded in the docs.