
AI image generation API
From prompt
to picture.
Bring image generation to your app with the PixQueue API. Describe an image and pay for the resolution you request.
Available modelsQwen-Image-2.1MOSS-ImageSenseNova-U1
Provisional rate0.005 USD / megapixel
Billable pixelsRequest width × height
Get started
Browse the FAQAPI preview
API integration examples
After submitting a job, use the Location response header to check its progress and results.
Server environment variables
PIXQUEUE_GENERATION_URL- Full endpoint URL ending in /generations
PIXQUEUE_API_KEY- Your API key
PIXQUEUE_IDEMPOTENCY_KEY- Use a unique value for each new job. Reuse it when retrying that job.
import json
import os
from urllib.request import Request, urlopen
payload = {
"model": "Qwen-Image-2.1",
"prompt": "Moonlit alpine peaks above a sea of clouds",
"width": 1024,
"height": 1024
}
request = Request(
os.environ["PIXQUEUE_GENERATION_URL"],
method="POST",
headers={
"Authorization": "Bearer " + os.environ["PIXQUEUE_API_KEY"],
"Idempotency-Key": os.environ["PIXQUEUE_IDEMPOTENCY_KEY"],
"Content-Type": "application/json",
},
data=json.dumps(payload).encode("utf-8"),
)
with urlopen(request, timeout=60) as response:
print(response.status, response.headers["Location"])const payload = {
"model": "Qwen-Image-2.1",
"prompt": "Moonlit alpine peaks above a sea of clouds",
"width": 1024,
"height": 1024
};
const response = await fetch(process.env.PIXQUEUE_GENERATION_URL, {
method: "POST",
headers: {
Authorization: "Bearer " + process.env.PIXQUEUE_API_KEY,
"Idempotency-Key": process.env.PIXQUEUE_IDEMPOTENCY_KEY,
"Content-Type": "application/json",
},
body: JSON.stringify(payload),
signal: AbortSignal.timeout(60_000),
});
if (!response.ok) throw new Error("HTTP " + response.status);
console.log(response.status, response.headers.get("Location"));package main
import (
"fmt"
"log"
"net/http"
"os"
"strings"
"time"
)
func main() {
body := strings.NewReader(`{
"model": "Qwen-Image-2.1",
"prompt": "Moonlit alpine peaks above a sea of clouds",
"width": 1024,
"height": 1024
}`)
req, err := http.NewRequest(http.MethodPost, os.Getenv("PIXQUEUE_GENERATION_URL"), body)
if err != nil {
log.Fatal(err)
}
req.Header.Set("Authorization", "Bearer " + os.Getenv("PIXQUEUE_API_KEY"))
req.Header.Set("Idempotency-Key", os.Getenv("PIXQUEUE_IDEMPOTENCY_KEY"))
req.Header.Set("Content-Type", "application/json")
client := &http.Client{Timeout: 60 * time.Second}
res, err := client.Do(req)
if err != nil {
log.Fatal(err)
}
defer res.Body.Close()
fmt.Println(res.Status, res.Header.Get("Location"))
}curl --request POST "$PIXQUEUE_GENERATION_URL" \
--header "Authorization: Bearer $PIXQUEUE_API_KEY" \
--header "Idempotency-Key: $PIXQUEUE_IDEMPOTENCY_KEY" \
--header "Content-Type: application/json" \
--include --max-time 60 --fail-with-body \
--data-binary '{
"model": "Qwen-Image-2.1",
"prompt": "Moonlit alpine peaks above a sea of clouds",
"width": 1024,
"height": 1024
}'POST · application/json
Frequently asked questions
Answers to questions about accounts, model selection, and usage-based pricing.
How do I get started?
Which image models can I choose?
The catalog includes Qwen-Image-2.1, MOSS-Image, and SenseNova-U1. Each model page lists its capabilities and pricing.
View model catalogHow is usage measured?
Usage is the width multiplied by the height in your API request.
The provisional rate is 0.005 USD per 1,000,000 pixels.
See pricing examplesHow do I get account or API support?
The contact form is not accepting submissions yet. For API issues, include the model name, requested resolution, and any error message.
Contact us