Keep keys server-side
The endpoint allows cross-origin requests for server and trusted client integrations, but that does not make a secret safe in shipped JavaScript. Route browser traffic through your own authenticated backend.
Qwen3.8 27B API
Use the familiar chat-completions shape while the Worker fixes the model, validates every boundary, enforces quotas, and keeps provider credentials off your client.
curl https://qwen3-8.org/v1/chat/completions \
-H "Authorization: Bearer $QWEN38_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "qwen/qwen3.8-27b",
"messages": [
{"role": "user", "content": "Explain the bug in this function..."}
],
"max_tokens": 512,
"temperature": 0.7
}'Request reference
Compatibility means the endpoint accepts the familiar chat completions shape. It does not mean every OpenAI field is accepted. Unknown fields are rejected so typos and unsupported options fail before they can create an unexpected provider request.
| Field | Accepted value | Default | Notes |
|---|---|---|---|
| model | qwen/qwen3.8-27b | Fixed | Optional in the request; the Worker always pins this model. |
| messages | 1–32 messages | Required | system, user, or assistant roles; non-empty text content only. |
| max_tokens | 1–1,024 | 512 | Maximum generated tokens requested from the provider. |
| temperature | 0–2 | 0.7 | Lower values are usually more repeatable; test on your task. |
| stream | false | false | Streaming responses are not supported by this endpoint. |
All message content together is limited to 7,500 UTF-8 bytes, and the full JSON body must stay below 48,000 bytes. Text messages are supported; image input, tool definitions, unknown fields, and custom provider routing are outside this contract.
The fixed route also prevents a caller from silently switching to a cheaper or incompatible checkpoint. If your application needs model selection, expose an explicit allowlist in your own backend instead of forwarding arbitrary provider identifiers.
The endpoint allows cross-origin requests for server and trusted client integrations, but that does not make a secret safe in shipped JavaScript. Route browser traffic through your own authenticated backend.
Store the provider completion ID, model, token usage when present, your request ID, and the remaining-quota header. Those fields make a quality or billing report traceable.
For meaningful comparisons, keep messages, temperature, maximum output, and application validation unchanged. A model update or prompt edit should become a new labeled test run.
Designed boundaries
A smaller contract makes failures visible and spending predictable. If you need streaming, million-token requests, images, or custom provider routing, this endpoint is not the right fit yet.
7.5 KB
Combined UTF-8 message content
32
Messages per request
1,024
Maximum output tokens
60s
Provider timeout
Operational behavior
A response includes a request ID for support and diagnostics. Successful calls also expose the remaining monthly call quota in x-ratelimit-remaining-requests.
400 / 413 / 415
Invalid JSON, unsupported content type, or an oversized body will fail again unchanged. Validate locally instead of retrying.
401
The Bearer key is missing, malformed, revoked, or has no active plan. Never put a server API key in public browser code.
429
The key crossed 60 calls per minute or the account reached its monthly quota. Queue work and cap retries so clients cannot create a retry storm.
502
A provider network or HTTP failure releases the reserved monthly call. A short, bounded exponential backoff is reasonable for idempotent application work.
Failure behavior
Every error includes a stable code, a safe message, and a request ID. Invalid input fails before calling the provider. A failed provider call releases its quota reservation.
{
"error": {
"code": "monthly_quota_exceeded",
"message": "The Pro monthly quota has been reached."
},
"request_id": "..."
}Choose a plan, sign in by email, then generate a key in your dashboard.
Before committing production traffic, build a task-specific evaluation and calculate the call budget.