|
| 1 | +--- |
| 2 | +hidden: true |
| 3 | +noIndex: true |
| 4 | +--- |
| 5 | + |
| 6 | +# qwen3-max-preview |
| 7 | + |
| 8 | +<table data-header-hidden data-full-width="true"><thead><tr><th width="546.4443969726562" valign="top"></th><th width="202.666748046875" valign="top"></th></tr></thead><tbody><tr><td valign="top"><div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><p>This documentation is valid for the following model: </p><p><code>alibaba/qwen3-max-preview</code></p></div></td><td valign="top"><a href="https://aimlapi.com/app/?model=alibaba/qwen3-max-preview&mode=chat" class="button primary">Try in Playground</a></td></tr></tbody></table> |
| 9 | + |
| 10 | +## Model Overview |
| 11 | + |
| 12 | + |
| 13 | + |
| 14 | +## How to Make a Call |
| 15 | + |
| 16 | +<details> |
| 17 | + |
| 18 | +<summary>Step-by-Step Instructions</summary> |
| 19 | + |
| 20 | +### :digit\_one: Setup You Can’t Skip |
| 21 | + |
| 22 | +:black\_small\_square: [**Create an Account**](https://aimlapi.com/app/sign-up): Visit the AI/ML API website and create an account (if you don’t have one yet).\ |
| 23 | +:black\_small\_square: [**Generate an API Key**](https://aimlapi.com/app/keys): After logging in, navigate to your account dashboard and generate your API key. Ensure that key is enabled on UI. |
| 24 | + |
| 25 | +###  :digit\_two: Copy the code example |
| 26 | + |
| 27 | +At the bottom of this page, you'll find [a code example](qwen3-max-preview.md#code-example) that shows how to structure the request. Choose the code snippet in your preferred programming language and copy it into your development environment. |
| 28 | + |
| 29 | +### :digit\_three: Modify the code example |
| 30 | + |
| 31 | +:black\_small\_square: Replace `<YOUR_AIMLAPI_KEY>` with your actual AI/ML API key from your account.\ |
| 32 | +:black\_small\_square: Insert your question or request into the `content` field—this is what the model will respond to. |
| 33 | + |
| 34 | +### :digit\_four: <sup><sub><mark style="background-color:yellow;">(Optional)<mark style="background-color:yellow;"><sub></sup> Adjust other optional parameters if needed |
| 35 | + |
| 36 | +Only `model` and `messages` are required parameters for this model (and we’ve already filled them in for you in the example), but you can include optional parameters if needed to adjust the model’s behavior. Below, you can find the corresponding [API schema](qwen3-max-preview.md#api-schema), which lists all available parameters along with notes on how to use them. |
| 37 | + |
| 38 | +### :digit\_five: Run your modified code |
| 39 | + |
| 40 | +Run your modified code in your development environment. Response time depends on various factors, but for simple prompts it rarely exceeds a few seconds. |
| 41 | + |
| 42 | +{% hint style="success" %} |
| 43 | +If you need a more detailed walkthrough for setting up your development environment and making a request step by step — feel free to use our [Quickstart guide](../../../quickstart/setting-up.md). |
| 44 | +{% endhint %} |
| 45 | + |
| 46 | +</details> |
| 47 | + |
| 48 | +## API Schema |
| 49 | + |
| 50 | +{% openapi-operation spec="qwen3-max-preview" path="/v1/chat/completions" method="post" %} |
| 51 | +[OpenAPI qwen3-max-preview](https://raw.githubusercontent.com/aimlapi/api-docs/refs/heads/main/docs/api-references/text-models-llm/Alibaba-Cloud/qwen3-max-preview.json) |
| 52 | +{% endopenapi-operation %} |
| 53 | + |
| 54 | +## Code Example |
| 55 | + |
| 56 | +{% tabs %} |
| 57 | +{% tab title="Python" %} |
| 58 | +{% code overflow="wrap" %} |
| 59 | +```python |
| 60 | +import requests |
| 61 | +import json # for getting a structured output with indentation |
| 62 | + |
| 63 | +response = requests.post( |
| 64 | + "https://api.aimlapi.com/v1/chat/completions", |
| 65 | + headers={ |
| 66 | + # Insert your AIML API Key instead of <YOUR_AIMLAPI_KEY>: |
| 67 | + "Authorization":"Bearer <YOUR_AIMLAPI_KEY>", |
| 68 | + "Content-Type":"application/json" |
| 69 | + }, |
| 70 | + json={ |
| 71 | + "model":"alibaba/qwen3-max-preview", |
| 72 | + "messages":[ |
| 73 | + { |
| 74 | + "role":"user", |
| 75 | + "content":"Hello" # insert your prompt here, instead of Hello |
| 76 | + } |
| 77 | + ], |
| 78 | + "enable_thinking": False |
| 79 | + } |
| 80 | +) |
| 81 | + |
| 82 | +data = response.json() |
| 83 | +print(json.dumps(data, indent=2, ensure_ascii=False)) |
| 84 | +``` |
| 85 | +{% endcode %} |
| 86 | +{% endtab %} |
| 87 | + |
| 88 | +{% tab title="JavaScript" %} |
| 89 | +{% code overflow="wrap" %} |
| 90 | +```javascript |
| 91 | +async function main() { |
| 92 | + const response = await fetch('https://api.aimlapi.com/v1/chat/completions', { |
| 93 | + method: 'POST', |
| 94 | + headers: { |
| 95 | + // insert your AIML API Key instead of <YOUR_AIMLAPI_KEY> |
| 96 | + 'Authorization': 'Bearer <YOUR_AIMLAPI_KEY>', |
| 97 | + 'Content-Type': 'application/json', |
| 98 | + }, |
| 99 | + body: JSON.stringify({ |
| 100 | + model: 'alibaba/qwen3-max-preview', |
| 101 | + messages:[ |
| 102 | + { |
| 103 | + role:'user', |
| 104 | + content: 'Hello' // insert your prompt here, instead of Hello |
| 105 | + } |
| 106 | + ], |
| 107 | + }), |
| 108 | + }); |
| 109 | + |
| 110 | + const data = await response.json(); |
| 111 | + console.log(JSON.stringify(data, null, 2)); |
| 112 | +} |
| 113 | + |
| 114 | +main(); |
| 115 | +``` |
| 116 | +{% endcode %} |
| 117 | +{% endtab %} |
| 118 | +{% endtabs %} |
| 119 | + |
| 120 | +<details> |
| 121 | + |
| 122 | +<summary>Response</summary> |
| 123 | + |
| 124 | +{% code overflow="wrap" %} |
| 125 | +```json5 |
| 126 | +``` |
| 127 | +{% endcode %} |
| 128 | + |
| 129 | +</details> |
0 commit comments