qwen-image-2.0
qwen/qwen-image-2.0
Per image
From$0.049
Input
—
Context
Up to 66K
Max output
Up to 1
The lowest price across upstreams, for reference. Prices depend on size and are listed per upstream below.
Upstreams & pricing
| Upstream | Size · price | Data policy |
|---|---|---|
lune.io/DashScope/CNLowest price | All sizes$0.049 / image | — |
Routed in real time — you pay the listed price of whichever upstream serves your call. Data policies reflect each upstream's own data terms and its agreement with us. We do not independently audit upstream implementations.
How to call
bashrequest.sh
curl https://api.lune.io/v1/images/generations \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{"model": "qwen/qwen-image-2.0", "prompt": "A lighthouse at dusk, watercolor"}'pythonrequest.py
from openai import OpenAI
import os
client = OpenAI(
api_key=os.environ["API_KEY"],
base_url="https://api.lune.io/v1",
)
resp = client.images.generate(
model="qwen/qwen-image-2.0",
prompt="A lighthouse at dusk, watercolor",
)
# Some models return a link (download it promptly), others base64 in b64_json
print(resp.data[0].url or resp.data[0].b64_json[:80])tsrequest.ts
import OpenAI from "openai";
const client = new OpenAI({
apiKey: process.env.API_KEY,
baseURL: "https://api.lune.io/v1",
});
const resp = await client.images.generate({
model: "qwen/qwen-image-2.0",
prompt: "A lighthouse at dusk, watercolor",
});
// Some models return a link (download it promptly), others base64 in b64_json
console.log(resp.data[0].url ?? resp.data[0].b64_json?.slice(0, 80));gomain.go
package main
import (
"context"
"fmt"
"os"
"github.com/sashabaranov/go-openai"
)
func main() {
cfg := openai.DefaultConfig(os.Getenv("API_KEY"))
cfg.BaseURL = "https://api.lune.io/v1"
client := openai.NewClientWithConfig(cfg)
resp, err := client.CreateImage(context.Background(), openai.ImageRequest{
Model: "qwen/qwen-image-2.0",
Prompt: "A lighthouse at dusk, watercolor",
})
if err != nil {
panic(err)
}
fmt.Println(resp.Data[0].URL)
}