SDKs
Python (openai SDK)
Use the official openai package with two changed parameters.
pip install openaifrom 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 = 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 }).