SDKs

Python (openai SDK)

Use the official openai package with two changed parameters.

shell
pip install openai
main.py
from openai import OpenAI

client = OpenAI(
    base_url="https://api.geniusrelaygpt.com/v1",
    api_key="sk-your-key",
)

resp = client.chat.completions.create(
    model="deepseek-v4.1-flash-heretic",
    messages=[{"role": "user", "content": "Write a haiku about autumn"}],
)
print(resp.choices[0].message.content)

Streaming

stream.py
stream = client.chat.completions.create(
    model="deepseek-v4.1-flash-heretic",
    messages=[{"role": "user", "content": "Tell me a short story"}],
    stream=True,
)
for chunk in stream:
    if chunk.choices and chunk.choices[0].delta.content:
        print(chunk.choices[0].delta.content, end="", flush=True)

Node.js works the same way: new OpenAI({ baseURL, apiKey }).