Use the OpenAI SDK with G0I
Already built on the OpenAI SDK? You do not need a new library. Point the SDK at G0I by changing one setting — base_url — and every model is available.
The only change: base_url
G0I implements the OpenAI API. Keep the OpenAI SDK; just set base_url to https://g0i.ai/v1 and use your G0I key.
Python
from openai import OpenAI
client = OpenAI(
api_key="$G0I_KEY",
base_url="https://g0i.ai/v1", # the only change
)
resp = client.chat.completions.create(
model="claude-opus-4-7",
messages=[{"role": "user", "content": "Write a haiku about APIs"}],
stream=True,
)
for chunk in resp:
print(chunk.choices[0].delta.content or "", end="")
Node.js
import OpenAI from "openai";
const client = new OpenAI({
apiKey: process.env.G0I_KEY,
baseURL: "https://g0i.ai/v1", // the only change
});
const r = await client.chat.completions.create({
model: "gemini-3-pro-preview",
messages: [{ role: "user", content: "Hello" }],
});
console.log(r.choices[0].message.content);
What carries over
- Streaming —
stream: trueworks unchanged. - Tool / function calling — same
toolsparameter. - Vision — image inputs in the same message format.
- Every SDK feature — retries, timeouts, async clients.
The difference: the model field now reaches 470+ models. See the catalog or the quickstart.
Frequently asked questions
Do I need a special G0I SDK?
No. The standard OpenAI SDK (Python, Node, and others) works — only the base_url changes.
Will tool calling and streaming still work?
Yes. G0I is built to the OpenAI spec, so streaming, tool calling and vision all work unchanged.
Which base URL do I use?
https://g0i.ai/v1
Related: OpenAI API alternative Claude API Unified AI API AI gateway LLM API