Qai follows the OpenAI chat completions API, so the official OpenAI SDKs work as they are. Change the base URL to https://llm.quickcasa.ai/v1 and use a Qai API key.
Use the official package for your language. No Qai-specific SDK is needed.
pip install openai # or npm install openai
Set base_url and pass your Qai key. Start on qai-hello-world, which is free, then change the model name for production.
import os
from openai import OpenAI
client = OpenAI(base_url="https://llm.quickcasa.ai/v1", api_key=os.environ["QAI_API_KEY"])
response = client.chat.completions.create(
model="qai-hello-world",
messages=[{"role": "user", "content": "Hello"}],
)
print(response.choices[0].message.content)
for chunk in client.chat.completions.create(
model="qai-pro",
messages=[{"role": "user", "content": "Write a haiku about Mondays"}],
stream=True,
):
if chunk.choices:
print(chunk.choices[0].delta.content or "", end="")Same idea in TypeScript or JavaScript: set baseURL and the key.
import OpenAI from 'openai';
const client = new OpenAI({
baseURL: 'https://llm.quickcasa.ai/v1',
apiKey: process.env.QAI_API_KEY,
});
const response = await client.chat.completions.create({
model: 'qai-pro',
messages: [{ role: 'user', content: 'Hello' }],
});
console.log(response.choices[0].message.content);Both SDKs read OPENAI_BASE_URL and OPENAI_API_KEY, so existing code switches to Qai without edits.
export OPENAI_BASE_URL=https://llm.quickcasa.ai/v1 export OPENAI_API_KEY=YOUR_QAI_API_KEY
Tested against Qai on November 25, 2026 with openai 3.59 (Python) and openai 7.64 (Node): chat, streaming, tool calls, JSON mode and image generation.
client.chat.completions, not client.responses: Qai does not serve the Responses API and answers it with a 404.client.images.generate with qai-imagine-turbo or qai-imagine-quality. Send hostMedia: true (in Python, extra_body={"hostMedia": True}) for a permanent URL. Uncensored imagine tiers (qai-imagine-uncensored and friends) return b64_json only and do not store the file.qai-flash, qai-think) think before they answer and those tokens count toward max_tokens, so leave a few hundred tokens of headroom.client.chat.completions.create.