Authentication
All API requests require authentication via an API key. You can pass your key using either the Authorization header (OpenAI-style) or the x-api-key header.
Option 1: Bearer Token (recommended)
Authorization: Bearer sk-your-api-key-here
Option 2: API Key Header
x-api-key: sk-your-api-key-here
Base URL
All API requests should be made to:
https://llm.quickcasa.ai
Because the API is OpenAI-compatible, you can use the official OpenAI SDK by simply changing the base_url and api_key.
Error Handling
Errors follow the OpenAI error format:
{
"error": {
"message": "Invalid API key",
"type": "invalid_request_error",
"code": "unauthorized"
}
}
Common HTTP status codes:
- 400 — Bad request (missing or invalid parameters)
- 401 — Unauthorised (invalid or missing API key)
- 429 — Rate limit exceeded
- 502 — Upstream provider error
- 503 — Service temporarily unavailable
List Models
Returns a list of all available models.
curl https://llm.quickcasa.ai/v1/models \ -H "Authorization: Bearer sk-your-api-key"
Response
{
"object": "list",
"data": [
{ "id": "qc-text-hello-world", "object": "model", "owned_by": "quickcasa", "type": "text" },
{ "id": "qc-text-1", "object": "model", "owned_by": "quickcasa", "type": "text" },
{ "id": "qc-text-2", "object": "model", "owned_by": "quickcasa", "type": "text" },
{ "id": "qc-image-turbo", "object": "model", "owned_by": "quickcasa", "type": "image" },
{ "id": "qc-image-quality", "object": "model", "owned_by": "quickcasa", "type": "image" },
{ "id": "qc-video", "object": "model", "owned_by": "quickcasa", "type": "video" }
]
}
Chat Completions
Generate a text completion from a conversation. Fully compatible with the OpenAI chat completions API.
Request Body
| Parameter | Type | Description |
|---|---|---|
| model required | string | qc-text-hello-world (free), qc-text-1, or qc-text-2 |
| messages required | array | Array of message objects with role and content |
| stream optional | boolean | Enable Server-Sent Events streaming. Default: false |
| temperature optional | number | Sampling temperature (0–2). Default: 1 |
| max_tokens optional | integer | Maximum tokens to generate |
| top_p optional | number | Nucleus sampling threshold |
| stop optional | string | array | Stop sequence(s) |
Example: Non-streaming
curl https://llm.quickcasa.ai/v1/chat/completions \ -H "Authorization: Bearer sk-your-api-key" \ -H "Content-Type: application/json" \ -d '{ "model": "qc-text-1", "messages": [ {"role": "system", "content": "You are a helpful assistant."}, {"role": "user", "content": "What is QuickCasa?"} ], "temperature": 0.7 }'
Example: Streaming
curl https://llm.quickcasa.ai/v1/chat/completions \ -H "Authorization: Bearer sk-your-api-key" \ -H "Content-Type: application/json" \ -N \ -d '{ "model": "qc-text-2", "messages": [ {"role": "user", "content": "Write a haiku about apartments."} ], "stream": true }'
Response
{
"id": "chatcmpl-abc123",
"object": "chat.completion",
"created": 1700000000,
"model": "qc-text-1",
"choices": [{
"index": 0,
"message": {
"role": "assistant",
"content": "QuickCasa is a property management platform..."
},
"finish_reason": "stop"
}],
"usage": {
"prompt_tokens": 25,
"completion_tokens": 42,
"total_tokens": 67
}
}
Image Generation
Generate images from a text prompt. Compatible with the OpenAI images API.
Request Body
| Parameter | Type | Description |
|---|---|---|
| model required | string | qc-image-turbo (fast, ~3s) or qc-image-quality (detailed, ~15s) |
| prompt required | string | A text description of the desired image |
| n optional | integer | Number of images to generate. Default: 1 |
| size optional | string | Image size as WxH (e.g. 1024x1024). Defaults vary by model. |
| response_format optional | string | b64_json or url. Default: b64_json |
Example
curl https://llm.quickcasa.ai/v1/images/generations \ -H "Authorization: Bearer sk-your-api-key" \ -H "Content-Type: application/json" \ -d '{ "model": "qc-image-turbo", "prompt": "A modern apartment building at golden hour, photorealistic", "size": "1024x1024", "response_format": "b64_json" }'
Response
{
"created": 1700000000,
"data": [
{
"b64_json": "iVBORw0KGgoAAAANSUhEUg..."
}
]
}
Video Generation
Generate short videos from a text prompt. This is a QuickCasa-specific endpoint (not part of the OpenAI spec). Videos are generated using our internal 14B-parameter video model.
Request Body
| Parameter | Type | Description |
|---|---|---|
| model required | string | qc-video |
| prompt required | string | A text description of the desired video |
| size optional | string | Video resolution as WxH. Default: 832x480 |
| duration optional | number | Video duration in seconds. Default: 6 |
| fps optional | integer | Frames per second. Default: 16 |
Example
curl https://llm.quickcasa.ai/v1/videos/generations \ -H "Authorization: Bearer sk-your-api-key" \ -H "Content-Type: application/json" \ -d '{ "model": "qc-video", "prompt": "Aerial drone shot of a luxury condo complex, cinematic", "size": "832x480", "duration": 6 }'
Response
{
"created": 1700000000,
"data": [
{
"url": "https://llm.quickcasa.ai/output/video/QC-Wan_00001.mp4",
"content_type": "video/mp4",
"duration_seconds": 6
}
]
}
Note: Video generation can take up to 90 seconds depending on the duration and resolution requested. The request will block until the video is ready.
Python SDK
Use the official openai Python package. Just point it at our base URL.
pip install openai
Chat Completion
from openai import OpenAI client = OpenAI( base_url="https://llm.quickcasa.ai/v1", api_key="sk-your-api-key", ) response = client.chat.completions.create( model="qc-text-1", messages=[ {"role": "user", "content": "Hello!"} ], ) print(response.choices[0].message.content)
Streaming
stream = client.chat.completions.create(
model="qc-text-2",
messages=[{"role": "user", "content": "Tell me a story."}],
stream=True,
)
for chunk in stream:
if chunk.choices[0].delta.content:
print(chunk.choices[0].delta.content, end="")
Image Generation
image = client.images.generate(
model="qc-image-turbo",
prompt="A cozy studio apartment with warm lighting",
size="1024x1024",
response_format="b64_json",
)
print(image.data[0].b64_json[:50])
Node.js SDK
Use the official openai npm package.
npm install openai
Chat Completion
import OpenAI from 'openai'; const client = new OpenAI({ baseURL: 'https://llm.quickcasa.ai/v1', apiKey: 'sk-your-api-key', }); const response = await client.chat.completions.create({ model: 'qc-text-1', messages: [ { role: 'user', content: 'Hello!' }, ], }); console.log(response.choices[0].message.content);
Streaming
const stream = await client.chat.completions.create({ model: 'qc-text-2', messages: [{ role: 'user', content: 'Tell me a story.' }], stream: true, }); for await (const chunk of stream) { const content = chunk.choices[0]?.delta?.content; if (content) { process.stdout.write(content); } }
Video Generation (fetch)
// Video generation uses a custom endpoint, so use fetch directly const response = await fetch('https://llm.quickcasa.ai/v1/videos/generations', { method: 'POST', headers: { 'Content-Type': 'application/json', 'Authorization': 'Bearer sk-your-api-key', }, body: JSON.stringify({ model: 'qc-video', prompt: 'Aerial tour of a modern apartment complex', duration: 6, }), }); const result = await response.json(); console.log(result.data[0].url);
cURL Quick Reference
Text
curl -X POST https://llm.quickcasa.ai/v1/chat/completions \ -H "Authorization: Bearer $QC_API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"qc-text-1","messages":[{"role":"user","content":"Hi!"}]}'
Image
curl -X POST https://llm.quickcasa.ai/v1/images/generations \ -H "Authorization: Bearer $QC_API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"qc-image-turbo","prompt":"sunset over a city skyline"}'
Video
curl -X POST https://llm.quickcasa.ai/v1/videos/generations \ -H "Authorization: Bearer $QC_API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"qc-video","prompt":"walkthrough of a modern kitchen","duration":6}'