by 0G Foundation
Tencent Hunyuan Hy-Image-3.5 (preview) text-to-image with reference images and multi-turn editing, billed per generated image at the price of its size tier: 1K/2K (output area up to 2048x2048) or 4K (above). Synchronous: POST /v1/images/generations; one image per request (`n` must be 1). Up to 20 reference images in `image` or `images` (a string or an array of HTTP or `data:image/...` URLs). Multi-turn: send the previous response's `assembled_history` as `messages` with the new instruction as `prompt`, and the same `session` string on every turn; each response returns the next `assembled_history`. `size` is `<width>x<height>`, at most 4096x4096 in area (e.g. 2048x2048, or 4096x4096 at the 4K price); omitted, `generate_max_pixels` picks the area (1048576, 2359296 or 4194304; default 2359296). Optional: `seed` (integer), `resize_max_pixels` (area cap for reference images), `footnote` (watermark text, up to 16 characters), `use_search_tool` (true: let the model search the web).
—
—
$0.0252
per image
—
N/A for image
curl "https://router-api.0g.ai/v1/images/generations" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <YOUR_API_KEY>" \
-d '{
"model": "tencent/hy-image-3.5-preview",
"prompt": "A futuristic city skyline at sunset",
"n": 1,
"response_format": "b64_json"
}'
# Reference images (up to 20), e.g. to keep a character consistent: add
# "image": ["https://example.com/reference.png"]
# to the body. Each item is an http(s) URL or a data:image/...;base64,... URI.
# Response: {"data": [{"b64_json": "..."}], "x_0g_trace": {...}}
# Generation takes seconds to about a minute; the request stays open until the images are ready.Provider Routing
Control which provider handles your request using the X-0G-Provider-* request headers.
X-0G-Provider-Address pins a provider; X-0G-Provider-Identity pins which of its upstreams to route through — both values come from the address and provider_identity fields of GET /v1/providers. Together they address one specific upstream of one provider. Send neither and the router picks by price and health, exactly as before.
curl "https://router-api.0g.ai/v1/images/generations" \
-H "Authorization: Bearer <YOUR_API_KEY>" \
-H "Content-Type: application/json" \
-H "X-0G-Provider-Address: <PROVIDER_ADDRESS>" \
-H "X-0G-Provider-Identity: <UPSTREAM>" \
-H "X-0G-Provider-Sort: latency" \
-H "X-0G-Provider-Allow-Fallbacks: true" \
-d '{
"model": "tencent/hy-image-3.5-preview",
"prompt": "A futuristic city skyline at sunset"
}'