Qwen Chat
Qwen models are served through the OpenAI-compatible Chat Completions API. Client applications only need to call Cubicspaces /v1/chat/completions.
Endpoint
http
POST /v1/chat/completionsSupported Models
| Model | Notes |
|---|---|
qwen3.6-flash | Lightweight fast model |
qwen3.6-plus | Plus standard model |
Actual model availability depends on account permissions and platform configuration.
Request Example
bash
curl https://cubicspaces.cloud/v1/chat/completions \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "qwen3.6-flash",
"messages": [
{ "role": "system", "content": "You are a concise assistant." },
{ "role": "user", "content": "Confirm that the Qwen API is working." }
],
"temperature": 0.2,
"stream": false
}'Streaming
bash
curl https://cubicspaces.cloud/v1/chat/completions \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "qwen3.6-plus",
"messages": [
{ "role": "user", "content": "Introduce Qwen in one sentence." }
],
"stream": true,
"stream_options": {
"include_usage": true
}
}'Streaming responses follow the OpenAI SSE format. Read choices[0].delta.content from each data: chunk; the final chunk may include usage.
SDK Examples
python
from openai import OpenAI
client = OpenAI(
api_key="YOUR_API_KEY",
base_url="https://cubicspaces.cloud/v1"
)
response = client.chat.completions.create(
model="qwen3.6-flash",
messages=[
{"role": "user", "content": "Confirm that the API is working."}
],
temperature=0.2
)
print(response.choices[0].message.content)js
import OpenAI from "openai";
const client = new OpenAI({
apiKey: "YOUR_API_KEY",
baseURL: "https://cubicspaces.cloud/v1"
});
const response = await client.chat.completions.create({
model: "qwen3.6-plus",
messages: [{ role: "user", content: "Confirm that the API is working." }],
temperature: 0.2
});
console.log(response.choices[0].message.content);Troubleshooting
HTTP 404 or model unavailable
Make sure the request path is /v1/chat/completions and model is set to an available model for your account, such as qwen3.6-flash or qwen3.6-plus. If the request still fails, contact your platform administrator to confirm model availability.
The root URL returns HTML
https://cubicspaces.cloud/ is the web frontend. API calls must use:
text
https://cubicspaces.cloud/v1/chat/completions