Setup & migration4 min read

OpenAI SDK: how to switch base_url to kiree.net

Part of the Kiree.net how-to series: short, with commands and checks you can repeat.

If your app already works with the OpenAI SDK, moving to Kiree.net takes one line. Only the address and key change; the request and response structure stays the same.

Python

from openai import OpenAI

client = OpenAI(
    base_url="https://kiree.net/v1",
    api_key="sk-...",
)

resp = client.chat.completions.create(
    model="gpt-4o",
    messages=[{"role": "user", "content": "Hello"}],
)
print(resp.choices[0].message.content)

Node.js

import OpenAI from "openai";

const client = new OpenAI({
  baseURL: "https://kiree.net/v1",
  apiKey: "sk-...",
});

const resp = await client.chat.completions.create({
  model: "gpt-4o",
  messages: [{ role: "user", content: "Hello" }],
});
console.log(resp.choices[0].message.content);

What to keep in mind

If a request returns 403 with the text insufficient quota, this is not a code error — the balance has run out. Top-up is done in packages through the Top-up page.

Need a key?

Create a key in a minute; Base URL https://kiree.net/v1, pay only for actual usage, no subscription.

Clients & integrations →