Quick Start
Make your first request to Qwen3.6 35B A3B from any OpenAI-compatible client.
1 Create an API key
Create an account, then an API key on your account page. It's shown once, so copy it then. It works within a minute.
The examples read the key from an environment variable:
export MALLARD_API_KEY="your key"2 Set the base URL
- Base URL
https://api.mallardai.co.uk/v1- Model ID
qwen/qwen3.6-35b-a3b
3 Make your first request
curl
curl https://api.mallardai.co.uk/v1/chat/completions \ -H "Authorization: Bearer $MALLARD_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "qwen/qwen3.6-35b-a3b", "messages": [{"role": "user", "content": "What is the capital of Wales?"}] }'Python
import os from openai import OpenAI client = OpenAI( base_url="https://api.mallardai.co.uk/v1", api_key=os.environ["MALLARD_API_KEY"], ) response = client.chat.completions.create( model="qwen/qwen3.6-35b-a3b", messages=[{"role": "user", "content": "What is the capital of Wales?"}], ) print(response.choices[0].message.content)JavaScript
import OpenAI from "openai"; const client = new OpenAI({ baseURL: "https://api.mallardai.co.uk/v1", apiKey: process.env.MALLARD_API_KEY, }); const response = await client.chat.completions.create({ model: "qwen/qwen3.6-35b-a3b", messages: [{ role: "user", content: "What is the capital of Wales?" }], }); console.log(response.choices[0].message.content);
Going further
Streaming
Set stream to true.
stream = client.chat.completions.create(
model="qwen/qwen3.6-35b-a3b",
messages=[{"role": "user", "content": "Name three Welsh castles."}],
stream=True,
)
for chunk in stream:
if chunk.choices and chunk.choices[0].delta.content:
print(chunk.choices[0].delta.content, end="", flush=True)The last chunk carries the usage, with an empty choices list. While a long prompt is read, the stream sends : keep-alive comment lines, which clients skip.
Reasoning
Reasoning is on by default, and counts as output. The message carries it in reasoning, and the answer in content. When streaming, it's in delta.reasoning.
To switch it off, send one of these:
"reasoning": {"enabled": false}"reasoning_effort": "none""chat_template_kwargs": {"enable_thinking": false}
response = client.chat.completions.create(
model="qwen/qwen3.6-35b-a3b",
messages=[{"role": "user", "content": "What is the capital of Wales?"}],
extra_body={"reasoning": {"enabled": False}},
)Images
Send up to 4 images per request as image_url parts, each a link or a data: URL. A linked image can be up to 10 MB, at a public address on port 80 or 443.
curl https://api.mallardai.co.uk/v1/chat/completions \
-H "Authorization: Bearer $MALLARD_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "qwen/qwen3.6-35b-a3b",
"messages": [{
"role": "user",
"content": [
{"type": "text", "text": "Describe this image in one sentence."},
{"type": "image_url", "image_url": {"url": "https://mallardai.co.uk/mallard-share.png"}}
]
}]
}'Errors
| Status | Meaning |
|---|---|
400 | Invalid JSON, an image that couldn't be fetched, n or best_of above 1, prompt_logprobs, or a prompt plus max_tokens over 262,144 tokens. |
401 | The API key is missing, wrong or revoked. |
402 | Your prepaid balance has run out. Top up on your account page. |
404 | Unknown model ID. Use qwen/qwen3.6-35b-a3b. |
429 | Your API key is at its limit of concurrent requests. Retry after 30 seconds. |
500 | A fault on our side. Email us if it keeps happening. |
503 | The model is busy or down and no capacity came free within 5 minutes, or the API is starting up. Retry shortly. A streamed request gets this as an error event. |
Errors come as {"error": {"message": …, "type": …}}. A 402's type is insufficient_quota.