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.
Get running in a few minutes:
You should see: JSON response with the model's reply
Configure Postman for Qwen Cloud APIs:
Qwen Cloud offers two API patterns:
For time-consuming tasks (images, videos), use the async pattern:
Converting cURL examples to Postman:
Set up reusable variables:
Organize related requests:
Add tests in Tests tab:
Automate task polling with scripts:
401 Unauthorized
Quick start
Get running in a few minutes:
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:
| Type | Use for | Response pattern |
|---|---|---|
| Synchronous | Text generation, embeddings | Immediate response |
| Asynchronous | Image/video generation | Task ID → Poll for result |
Synchronous APIs
Text generation example
1
Create request
New → HTTP Request → POST
2
Set URL
3
Add headers
| Key | Value |
|---|---|
| Authorization | Bearer YOUR_API_KEY |
| Content-Type | application/json |
4
Add body
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-synthesis2
Add headers
| Key | Value |
|---|---|
| X-DashScope-Async | enable |
| Authorization | Bearer YOUR_API_KEY |
| Content-Type | application/json |
3
Add body
4
Send and save task_id
Response contains
output.task_id - save this valueStep 2: Query result
1
Configure query
Method: GET
URL:
https://dashscope-intl.aliyuncs.com/api/v1/tasks/{task_id}
Replace {task_id} with actual ID2
Add headers
| Key | Value |
|---|---|
| Authorization | Bearer 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:
| cURL | Postman | Location |
|---|---|---|
curl -X POST | POST | Method dropdown |
| URL | URL | URL field |
-H 'Key: Value' | Headers | Headers tab |
-d '{...}' | Body | Body 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
| Variable | Value |
|---|---|
| api_key | YOUR_API_KEY |
| base_url | https://dashscope-intl.aliyuncs.com |
| model | qwen-plus |
3
Use in requests
- Headers:
Bearer {{api_key}} - URL:
{{base_url}}/api/v1/... - Body:
"model": "{{model}}"
Collections
Organize related requests:
- Create collection: Collections → New Collection
- Add requests: Drag requests into collection
- Share: Export as JSON or share link
- Run all: Runner → Select collection → Run
Testing tips
Response validation
Add tests in Tests tab:
Async polling automation
Automate task polling with scripts:
Troubleshooting
401 Unauthorized
Solution:400 Bad Request
- Check API key is correct
- Verify "Bearer " prefix in Authorization header
- Ensure API key has quota
Solution:Task stuck in PENDING
- Validate JSON syntax in body
- Check required fields are present
- Verify model name is correct
Solution:Connection timeout
- Image/video generation can take minutes
- Continue polling every 5-10 seconds
- Check task_metrics for progress
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
Related resources
- API Reference: Complete API documentation →
- Models: Available models → | Pricing →
- SDKs: Official client libraries →
- Postman docs: Official Postman guide →