Skip to main content
Clients & tools

Postman

API testing tool

Postman is a graphical HTTP testing tool that makes it easy to test Qwen Cloud APIs. Use it to quickly validate API endpoints, test async operations for image/video generation, and prototype integrations before writing code.

Quick start

Get running in a few minutes:
# 1. Install
Download Postman from postman.com/downloads

# 2. Create request (New → HTTP Request)
Method: POST
URL: https://dashscope-intl.aliyuncs.com/api/v1/services/aigc/text-generation/generation

# 3. Configure (Headers tab)
Authorization: Bearer sk-xxx
Content-Type: application/json

# 4. Test (Body tab → raw → JSON)
{
  "model": "qwen-plus",
  "input": {
    "messages": [{"role": "user", "content": "Hello, who are you?"}]
  }
}
You should see: JSON response with the model's reply

Configuration

Basic setup

Configure Postman for Qwen Cloud APIs:
  • API endpoints: https://dashscope-intl.aliyuncs.com
  • Authentication: Bearer token with API key
  • Content-Type: application/json
Free quota and billing:
  • First-time users get a free quota (valid for 90 days)
  • Enable Free quota only to prevent unexpected charges

API types

Qwen Cloud offers two API patterns:
TypeUse forResponse pattern
SynchronousText generation, embeddingsImmediate response
AsynchronousImage/video generationTask ID → Poll for result

Synchronous APIs

Text generation example

1

Create request

New → HTTP Request → POST
2

Set URL

https://dashscope-intl.aliyuncs.com/api/v1/services/aigc/text-generation/generation
3

Add headers

KeyValue
AuthorizationBearer YOUR_API_KEY
Content-Typeapplication/json
4

Add body

{
  "model": "qwen-plus",
  "input": {
    "messages": [
      {"role": "user", "content": "Write a haiku about coding"}
    ]
  },
  "parameters": {
    "temperature": 0.7
  }
}
5

Send request

Click Send → View response

Asynchronous APIs

For time-consuming tasks (images, videos), use the async pattern:

Step 1: Create task

1

Configure request

Method: POST URL: https://dashscope-intl.aliyuncs.com/api/v1/services/aigc/text2image/image-synthesis
2

Add headers

KeyValue
X-DashScope-Asyncenable
AuthorizationBearer YOUR_API_KEY
Content-Typeapplication/json
3

Add body

{
  "model": "wan2.5-t2i-preview",
  "input": {
    "prompt": "A serene mountain landscape at sunset"
  },
  "parameters": {
    "size": "1024*1024",
    "n": 1
  }
}
4

Send and save task_id

Response contains output.task_id - save this value

Step 2: Query result

1

Configure query

Method: GET URL: https://dashscope-intl.aliyuncs.com/api/v1/tasks/{task_id} Replace {task_id} with actual ID
2

Add headers

KeyValue
AuthorizationBearer YOUR_API_KEY
3

Poll for completion

Send request repeatedly until:
  • output.task_status = SUCCEEDED
  • Results appear in output.results

cURL to Postman mapping

Converting cURL examples to Postman:
cURLPostmanLocation
curl -X POSTPOSTMethod dropdown
URLURLURL field
-H 'Key: Value'HeadersHeaders tab
-d '{...}'BodyBody tab (raw JSON)
$VARIABLE{{variable}}Environment variables

Environment variables

Set up reusable variables:
1

Create environment

Environments → Create New → Name it "Qwen Cloud"
2

Add variables

VariableValue
api_keyYOUR_API_KEY
base_urlhttps://dashscope-intl.aliyuncs.com
modelqwen-plus
3

Use in requests

  • Headers: Bearer {{api_key}}
  • URL: {{base_url}}/api/v1/...
  • Body: "model": "{{model}}"

Collections

Organize related requests:
  1. Create collection: Collections → New Collection
  2. Add requests: Drag requests into collection
  3. Share: Export as JSON or share link
  4. Run all: Runner → Select collection → Run

Testing tips

Response validation

Add tests in Tests tab:
pm.test("Status is 200", () => {
  pm.response.to.have.status(200);
});

pm.test("Has output", () => {
  const json = pm.response.json();
  pm.expect(json).to.have.property("output");
});

Async polling automation

Automate task polling with scripts:
// In Tests tab of create task request
const taskId = pm.response.json().output.task_id;
pm.environment.set("task_id", taskId);

// Set next request to query task
postman.setNextRequest("Query Task Status");

Troubleshooting

401 Unauthorized
Solution:
  • Check API key is correct
  • Verify "Bearer " prefix in Authorization header
  • Ensure API key has quota
400 Bad Request
Solution:
  • Validate JSON syntax in body
  • Check required fields are present
  • Verify model name is correct
Task stuck in PENDING
Solution:
  • Image/video generation can take minutes
  • Continue polling every 5-10 seconds
  • Check task_metrics for progress
Connection timeout
Solution:
  • Increase timeout in Settings → General
  • Check network connectivity
  • Try a simpler request first

Production notes

Postman is for testing only. In production:
  • Use official SDKs for your language
  • Implement proper error handling
  • Add retry logic for async tasks
  • Store API keys securely
Postman | Qwen Cloud