{"components":{"schemas":{"ChatCompletionRequest":{"properties":{"max_tokens":{"description":"Maximum number of tokens to generate in the completion.","type":"integer"},"messages":{"description":"OpenAI-compatible chat-completions message list, in conversation order.","items":{"$ref":"#/components/schemas/ChatMessage"},"minItems":1,"type":"array"},"model":{"description":"Model Studio model name selected by the caller (e.g. \"qwen3-max\", \"qwen-max\", \"qwen-plus\", \"qwen-flash\", \"qwen3-coder-plus\").","type":"string"},"stream":{"description":"Whether to request streaming output (server-sent events) for supported models.","type":"boolean"},"temperature":{"description":"Sampling temperature. Higher values produce more diverse output.","type":"number"},"tool_choice":{"description":"Controls tool selection: \"none\", \"auto\", or a specific tool reference object.","oneOf":[{"type":"string"},{"type":"object"}]},"tools":{"description":"Tool definitions the model may call, in OpenAI-compatible function-calling format.","items":{"$ref":"#/components/schemas/Tool"},"type":"array"},"top_p":{"description":"Nucleus sampling probability mass.","type":"number"}},"required":["model","messages"],"type":"object"},"ChatCompletionResponse":{"properties":{"choices":{"items":{"properties":{"finish_reason":{"type":"string"},"index":{"type":"integer"},"message":{"$ref":"#/components/schemas/ChatMessage"}},"type":"object"},"type":"array"},"created":{"type":"integer"},"id":{"type":"string"},"model":{"type":"string"},"object":{"type":"string"},"usage":{"properties":{"completion_tokens":{"type":"integer"},"prompt_tokens":{"type":"integer"},"total_tokens":{"type":"integer"}},"type":"object"}},"type":"object"},"ChatMessage":{"properties":{"content":{"description":"Message content. For OpenAI-compatible chat completions, this is the prompt or response text. May be null on assistant messages that carry only tool_calls.","type":["string","null"]},"role":{"enum":["system","user","assistant","tool"],"type":"string"},"tool_call_id":{"description":"For role \"tool\" messages, the id of the tool call this message responds to.","type":"string"},"tool_calls":{"description":"Tool calls emitted by the assistant, in OpenAI-compatible function-calling format.","items":{"$ref":"#/components/schemas/ToolCall"},"type":"array"}},"required":["role"],"type":"object"},"ErrorResponse":{"properties":{"error":{"oneOf":[{"type":"string"},{"properties":{"code":{"type":["string","null"]},"message":{"type":"string"},"param":{"type":["string","null"]},"type":{"type":"string"}},"type":"object"}]},"request_id":{"type":"string"}},"type":"object"},"ModelList":{"properties":{"data":{"items":{"properties":{"id":{"description":"Model identifier, e.g. qwen3-max.","type":"string"},"object":{"type":"string"},"owned_by":{"type":"string"}},"required":["id"],"type":"object"},"type":"array"},"object":{"enum":["list"],"type":"string"}},"type":"object"},"Tool":{"properties":{"function":{"description":"Function definition the model may call: name, description, and JSON Schema parameters.","properties":{"description":{"description":"Human-readable description of what the function does, used by the model to decide when to call it.","type":"string"},"name":{"description":"Function name the model uses in tool calls (e.g. \"get_weather\").","type":"string"},"parameters":{"description":"JSON Schema describing the function arguments.","type":"object"}},"required":["name"],"type":"object"},"type":{"enum":["function"],"type":"string"}},"required":["type","function"],"type":"object"},"ToolCall":{"properties":{"function":{"properties":{"arguments":{"description":"JSON-encoded function arguments.","type":"string"},"name":{"type":"string"}},"type":"object"},"id":{"type":"string"},"type":{"enum":["function"],"type":"string"}},"type":"object"}}},"info":{"description":"Filtered OpenAPI description for the Qwen chat completions proxy. The upstream endpoint is Alibaba Cloud Model Studio's OpenAI-compatible chat completions API in the Singapore region; the caller selects the Qwen model via the request `model` field.","title":"Alibaba Cloud Model Studio (Qwen) API","version":"v1"},"openapi":"3.0.3","paths":{"/compatible-mode/v1/chat/completions":{"post":{"description":"Submit a chat completion request to a caller-selected Qwen model. The request body mirrors Alibaba Cloud Model Studio's OpenAI-compatible chat completions format, including multi-turn messages, sampling options, streaming, and tool calling.","operationId":"alibaba.modelstudio.chatCompletions","requestBody":{"content":{"application/json":{"example":{"messages":[{"content":"You are a concise assistant.","role":"system"},{"content":"Explain the difference between a mutex and a semaphore in two sentences.","role":"user"}],"model":"qwen-flash"},"schema":{"$ref":"#/components/schemas/ChatCompletionRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatCompletionResponse"}}},"description":"Successful chat completion response."},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Invalid request."}},"summary":"Create a chat completion with a Qwen model","tags":["chat.completions"],"x-pay-metering":{"dimensions":[{"direction":"input","meter":{"path":"/usage/prompt_tokens","source":"response_json"},"scale":1000000,"tiers":[{"notes":"Conservative fallback: qwen3-coder-plus 256K-1M input list price.","price_usd":6.0}],"unit":"tokens"},{"direction":"output","meter":{"path":"/usage/completion_tokens","source":"response_json"},"scale":1000000,"tiers":[{"notes":"Conservative fallback: qwen3-coder-plus 256K-1M output list price.","price_usd":60.0}],"unit":"tokens"}],"schemes":["mpp-session","x402-upto"],"upto":{"max_usd":0.1,"response_body":{"max_bytes":33554432,"mode":"buffer"}},"variants":[{"description":"Qwen 3.8 Max, including dated aliases.","dimensions":[{"direction":"input","meter":{"path":"/usage/prompt_tokens","source":"response_json"},"scale":1000000,"tiers":[{"price_usd":1.999}],"unit":"tokens"},{"direction":"output","meter":{"path":"/usage/completion_tokens","source":"response_json"},"scale":1000000,"tiers":[{"price_usd":5.996}],"unit":"tokens"}],"param":"model","value":"qwen3.8-max"},{"description":"Qwen 3.8 Flash, including dated aliases.","dimensions":[{"direction":"input","meter":{"path":"/usage/prompt_tokens","source":"response_json"},"scale":1000000,"tiers":[{"price_usd":0.146}],"unit":"tokens"},{"direction":"output","meter":{"path":"/usage/completion_tokens","source":"response_json"},"scale":1000000,"tiers":[{"price_usd":0.457}],"unit":"tokens"}],"param":"model","value":"qwen3.8-flash"},{"description":"Qwen 3.8 2.4T-A95B open-weight model.","dimensions":[{"direction":"input","meter":{"path":"/usage/prompt_tokens","source":"response_json"},"scale":1000000,"tiers":[{"price_usd":1.999}],"unit":"tokens"},{"direction":"output","meter":{"path":"/usage/completion_tokens","source":"response_json"},"scale":1000000,"tiers":[{"price_usd":5.996}],"unit":"tokens"}],"param":"model","value":"qwen3.8-2.4t-a95b"},{"description":"Qwen 3.8 27B open-weight model.","dimensions":[{"direction":"input","meter":{"path":"/usage/prompt_tokens","source":"response_json"},"scale":1000000,"tiers":[{"price_usd":0.487}],"unit":"tokens"},{"direction":"output","meter":{"path":"/usage/completion_tokens","source":"response_json"},"scale":1000000,"tiers":[{"price_usd":2.917}],"unit":"tokens"}],"param":"model","value":"qwen3.8-27b"},{"description":"Qwen 3.7 Max, including dated aliases.","dimensions":[{"direction":"input","meter":{"path":"/usage/prompt_tokens","source":"response_json"},"scale":1000000,"tiers":[{"price_usd":2.499}],"unit":"tokens"},{"direction":"output","meter":{"path":"/usage/completion_tokens","source":"response_json"},"scale":1000000,"tiers":[{"price_usd":7.495}],"unit":"tokens"}],"param":"model","value":"qwen3.7-max"},{"description":"Qwen 3.7 Plus, including dated aliases.","dimensions":[{"direction":"input","meter":{"path":"/usage/prompt_tokens","source":"response_json"},"scale":1000000,"tiers":[{"condition":{"field":"input_tokens","op":"<=","value":256000},"price_usd":0.4},{"price_usd":1.2}],"unit":"tokens"},{"direction":"output","meter":{"path":"/usage/completion_tokens","source":"response_json"},"scale":1000000,"tiers":[{"condition":{"field":"input_tokens","op":"<=","value":256000},"price_usd":1.599},{"price_usd":4.797}],"unit":"tokens"}],"param":"model","value":"qwen3.7-plus"},{"description":"Qwen 3.6 Plus, including dated aliases.","dimensions":[{"direction":"input","meter":{"path":"/usage/prompt_tokens","source":"response_json"},"scale":1000000,"tiers":[{"condition":{"field":"input_tokens","op":"<=","value":256000},"price_usd":0.5},{"price_usd":2.0}],"unit":"tokens"},{"direction":"output","meter":{"path":"/usage/completion_tokens","source":"response_json"},"scale":1000000,"tiers":[{"condition":{"field":"input_tokens","op":"<=","value":256000},"price_usd":2.998},{"price_usd":5.996}],"unit":"tokens"}],"param":"model","value":"qwen3.6-plus"},{"description":"Qwen 3.6 Flash, including dated aliases.","dimensions":[{"direction":"input","meter":{"path":"/usage/prompt_tokens","source":"response_json"},"scale":1000000,"tiers":[{"condition":{"field":"input_tokens","op":"<=","value":256000},"price_usd":0.25},{"price_usd":1.0}],"unit":"tokens"},{"direction":"output","meter":{"path":"/usage/completion_tokens","source":"response_json"},"scale":1000000,"tiers":[{"condition":{"field":"input_tokens","op":"<=","value":256000},"price_usd":0.96},{"price_usd":3.997}],"unit":"tokens"}],"param":"model","value":"qwen3.6-flash"},{"description":"Qwen 3.5 Plus, including dated aliases.","dimensions":[{"direction":"input","meter":{"path":"/usage/prompt_tokens","source":"response_json"},"scale":1000000,"tiers":[{"condition":{"field":"input_tokens","op":"<=","value":256000},"price_usd":0.392},{"price_usd":0.49}],"unit":"tokens"},{"direction":"output","meter":{"path":"/usage/completion_tokens","source":"response_json"},"scale":1000000,"tiers":[{"condition":{"field":"input_tokens","op":"<=","value":256000},"price_usd":2.349},{"price_usd":2.936}],"unit":"tokens"}],"param":"model","value":"qwen3.5-plus"},{"description":"Qwen 3.5 Flash, including dated aliases.","dimensions":[{"direction":"input","meter":{"path":"/usage/prompt_tokens","source":"response_json"},"scale":1000000,"tiers":[{"price_usd":0.098}],"unit":"tokens"},{"direction":"output","meter":{"path":"/usage/completion_tokens","source":"response_json"},"scale":1000000,"tiers":[{"price_usd":0.392}],"unit":"tokens"}],"param":"model","value":"qwen3.5-flash"},{"description":"Qwen 3 Max, including dated aliases.","dimensions":[{"direction":"input","meter":{"path":"/usage/prompt_tokens","source":"response_json"},"scale":1000000,"tiers":[{"condition":{"field":"input_tokens","op":"<=","value":32000},"price_usd":1.175},{"condition":{"field":"input_tokens","op":"<=","value":128000},"price_usd":2.349},{"price_usd":2.936}],"unit":"tokens"},{"direction":"output","meter":{"path":"/usage/completion_tokens","source":"response_json"},"scale":1000000,"tiers":[{"condition":{"field":"input_tokens","op":"<=","value":32000},"price_usd":5.872},{"condition":{"field":"input_tokens","op":"<=","value":128000},"price_usd":11.743},{"price_usd":14.679}],"unit":"tokens"}],"param":"model","value":"qwen3-max"},{"description":"Legacy Qwen Max.","dimensions":[{"direction":"input","meter":{"path":"/usage/prompt_tokens","source":"response_json"},"scale":1000000,"tiers":[{"price_usd":1.566}],"unit":"tokens"},{"direction":"output","meter":{"path":"/usage/completion_tokens","source":"response_json"},"scale":1000000,"tiers":[{"price_usd":6.263}],"unit":"tokens"}],"param":"model","value":"qwen-max"},{"description":"Legacy Qwen Plus; output uses the conservative thinking-mode rate.","dimensions":[{"direction":"input","meter":{"path":"/usage/prompt_tokens","source":"response_json"},"scale":1000000,"tiers":[{"condition":{"field":"input_tokens","op":"<=","value":256000},"price_usd":0.392},{"price_usd":1.175}],"unit":"tokens"},{"direction":"output","meter":{"path":"/usage/completion_tokens","source":"response_json"},"scale":1000000,"tiers":[{"condition":{"field":"input_tokens","op":"<=","value":256000},"price_usd":3.915},{"price_usd":11.743}],"unit":"tokens"}],"param":"model","value":"qwen-plus"},{"description":"Legacy Qwen Flash, including dated aliases.","dimensions":[{"direction":"input","meter":{"path":"/usage/prompt_tokens","source":"response_json"},"scale":1000000,"tiers":[{"condition":{"field":"input_tokens","op":"<=","value":256000},"price_usd":0.049},{"price_usd":0.245}],"unit":"tokens"},{"direction":"output","meter":{"path":"/usage/completion_tokens","source":"response_json"},"scale":1000000,"tiers":[{"condition":{"field":"input_tokens","op":"<=","value":256000},"price_usd":0.392},{"price_usd":1.958}],"unit":"tokens"}],"param":"model","value":"qwen-flash"},{"description":"Qwen 3 Coder Plus, including dated aliases.","dimensions":[{"direction":"input","meter":{"path":"/usage/prompt_tokens","source":"response_json"},"scale":1000000,"tiers":[{"condition":{"field":"input_tokens","op":"<=","value":32000},"price_usd":0.979},{"condition":{"field":"input_tokens","op":"<=","value":128000},"price_usd":1.762},{"condition":{"field":"input_tokens","op":"<=","value":256000},"price_usd":2.936},{"price_usd":5.872}],"unit":"tokens"},{"direction":"output","meter":{"path":"/usage/completion_tokens","source":"response_json"},"scale":1000000,"tiers":[{"condition":{"field":"input_tokens","op":"<=","value":32000},"price_usd":4.893},{"condition":{"field":"input_tokens","op":"<=","value":128000},"price_usd":8.808},{"condition":{"field":"input_tokens","op":"<=","value":256000},"price_usd":14.679},{"price_usd":58.714}],"unit":"tokens"}],"param":"model","value":"qwen3-coder-plus"},{"description":"Qwen 3 Coder Flash, including dated aliases.","dimensions":[{"direction":"input","meter":{"path":"/usage/prompt_tokens","source":"response_json"},"scale":1000000,"tiers":[{"condition":{"field":"input_tokens","op":"<=","value":32000},"price_usd":0.294},{"condition":{"field":"input_tokens","op":"<=","value":128000},"price_usd":0.49},{"condition":{"field":"input_tokens","op":"<=","value":256000},"price_usd":0.783},{"price_usd":1.566}],"unit":"tokens"},{"direction":"output","meter":{"path":"/usage/completion_tokens","source":"response_json"},"scale":1000000,"tiers":[{"condition":{"field":"input_tokens","op":"<=","value":32000},"price_usd":1.468},{"condition":{"field":"input_tokens","op":"<=","value":128000},"price_usd":2.447},{"condition":{"field":"input_tokens","op":"<=","value":256000},"price_usd":3.915},{"price_usd":9.395}],"unit":"tokens"}],"param":"model","value":"qwen3-coder-flash"}]}}},"/compatible-mode/v1/models":{"get":{"description":"List the Qwen models exposed through the OpenAI-compatible surface. Free endpoint used by clients to enumerate models before paying for generation.","operationId":"alibaba.modelstudio.listModels","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModelList"}}},"description":"Model list."}},"summary":"List available Qwen models","tags":["models"]}}},"servers":[{"url":"https://modelstudio.alibaba.gateway-402.com"}],"tags":[{"name":"chat.completions"},{"name":"models"}]}