JUHE API Marketplace

How to Use the Qwen API for Text, Code, and Multimodal Tasks

3 min read
By Liam Walker

Introduction

The Qwen API lets developers perform text generation, code completion, and multimodal tasks (like image understanding) in a unified way. By using Wisdom Gate, you simplify authentication, model selection, and API requests under one consistent format.

Understanding the Qwen Models

Qwen3-max Overview

Qwen3-max is a high-performance large language model for:

  • Text generation (creative, technical)
  • Code assistance in multiple languages
  • Image understanding and captioning

Model page: https://wisdom-gate.juheapi.com/models/qwen3-max

Pricing Comparison

OpenRouter vs Wisdom-Gate pricing (per 1M tokens)

ModelOpenRouter Input / OutputWisdom-Gate Input / OutputSavings
GPT-5$1.25 / $10.00$1.00 / $8.00~20% lower
Claude Sonnet 4$3.00 / $15.00$2.00 / $10.00~30% lower
qwen3-max$1.50 / $10.00$1.20 / $6.00~30% lower

Setting Up Access

Get Your API Key

Sign up or log in at Wisdom Gate, then find your API key in the dashboard.

Base URL and Endpoints

Base URL: https://wisdom-gate.juheapi.com/v1 Main endpoint for LLM (chat): /chat/completions

Text Generation with Qwen API

Simple Text Prompt Example

cURL

curl --location --request POST 'https://wisdom-gate.juheapi.com/v1/chat/completions' \
--header 'Authorization: YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
  "model": "qwen3-max",
  "messages": [
    {"role": "user", "content": "Hello, how can you help me today?"}
  ]
}'

Python

import requests
url = "https://wisdom-gate.juheapi.com/v1/chat/completions"
headers = {
  "Authorization": "YOUR_API_KEY",
  "Content-Type": "application/json"
}
payload = {
  "model": "qwen3-max",
  "messages": [{"role": "user", "content": "Hello, how can you help me today?"}]
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())

Guidelines for Better Outputs

  • Use clear instructions in your prompt.
  • Experiment with temperature (0.2-0.8) to balance creativity and focus.
  • Limit max_tokens to control response length.

Code Assistance with Qwen

Generate Python Function Example

messages = [{"role": "user", "content": "Write a Python function to reverse a string"}]
payload = {"model": "qwen3-max", "messages": messages}
response = requests.post(url, json=payload, headers=headers)
print(response.json())

Debugging and Code Completion

For debugging:

  • Provide the problematic code snippet.
  • Ask for corrections or suggestions. For completion:
  • Include partial code and desired continuation.

Multimodal Tasks

Image Understanding via Qwen

Send image data:

  • Use base64 encoding or a hosted image URL. Example: ask Qwen to describe the contents of the image.

Payload snippet:

{"model":"qwen3-max","messages":[{"role":"user","content":"Describe the image at https://example.com/image.jpg"}]}

Combined Text+Image Tasks

You can instruct Qwen with:

  • Context in text
  • Reference to specific images for multi-step reasoning

Working via Wisdom Gate Studio

Using the Online Chat Playground

Visit: https://wisdom-gate.juheapi.com/studio/chat

  • Select qwen3-max
  • Enter prompt and optional image reference

Best Practices

  • Handle errors gracefully: check HTTP status codes.
  • Respect rate limits shown in your account.
  • Store API keys in environment variables.
  • Validate inputs before sending to avoid wasted tokens.

Conclusion

By connecting to Qwen via Wisdom Gate, you can build text, code, and multimodal features without juggling multiple APIs. The unified interface makes switching between tasks fast and cost-effective. Explore the interactive Studio for quick experiments, then integrate into your apps with Python or cURL.

How to Use the Qwen API for Text, Code, and Multimodal Tasks | JuheAPI