OpenAI-compatible chat completion (Qwen)
OpenAI-compatible chat completion (Qwen)
Sync OpenAI-compatible chat completion proxied to DashScope.
Set stream=true for SSE; the response preserves OpenAI’s exact wire
framing so openai.OpenAI(base_url=".../v2/inference") clients work
unchanged. Meters one vision/inference event per non-error response
with token counts as properties.
Authentication
X-Api-Keystring
API key authentication via X-Api-Key header
OR
AuthorizationBearer
Bearer token authentication via Authorization header
Request
This endpoint expects an object.
model
Allow-listed Qwen model id.
messages
OpenAI chat messages array.
stream
Response
Successful Response