APIMaster.ai

Hy Image 3.5 Preview · API reference and billing

Generate images from text, use reference images, or edit an image over multiple turns.

A valid APIMaster API key is required. Send a JSON request with Bearer authentication.

POST /v1/wand/hunyuan-image/v35-generation · Content-Type: application/json

Request parameters

Field Type Description
model string hy-image-v3.5-preview (required).
messages object[] Time-ordered messages. The last user message is the current instruction. Earlier messages provide editing context. Required.
size string Width and height as widthxheight, for example 4096x4096. Each side is 256–8192 pixels, with an area limit of 16,777,216 pixels.
seed int64 Integer from 0 to 2⁶³−1. Omit it or use 0 for a random seed.
generate_max_pixels integer Used when size is absent. The available values are 1,048,576, 2,359,296 (default), and 4,194,304. Intermediate values round to the nearest tier. Use size for 4K.
resize_max_pixels integer Reference images above this area are scaled down proportionally. Default is 1,048,576 pixels.
session string Keep this value unchanged within an editing session to help reuse routing and the KV cache.
footnote string Custom watermark in the lower-right corner, up to 16 Unicode characters.
use_search_tool object Use {"value":true} or {"value":false}. Search is off by default.

Each message has a role (user, assistant, or tool) and a content array. Use type=text with text, or type=image_url with image_url:{url:...}. Images can be public URLs or MIME-prefixed data URIs, up to 20 MB each and 20 images per context. The context limit is 100,000 tokens. For tool results, pass back the matching tool_call_id. Mark previously generated image content with is_generate:true.

An assistant message can pass back reasoning and tool_calls unchanged. If it only calls a tool, content may be omitted. A tool call uses {id,type:"function",function:{name,arguments}}, with a JSON string in arguments.

curl -X POST "https://apimaster.ai/v1/wand/hunyuan-image/v35-generation" \
  -H "Authorization: Bearer $APIMASTER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"hy-image-v3.5-preview","size":"1024x1024","messages":[{"role":"user","content":[{"type":"text","text":"A blue circle on a white background"}]}]}'

Response

The response can contain consecutive JSON frames. Follow the actual Content-Type. The final image URL is in choices[0].delta.image.url, with dimensions in width and height. A null finish_reason can accompany a successful response. Use the image URL to confirm success and download it before it expires. For another editing turn, reuse assembled_history as the conversation context. Save the request_id when diagnosing errors or interrupted connections. Repeating a generation can incur another charge.

Billing

The gateway reserves credit in advance and settles once using tokenhub_usage.total_tokens. See the model card for the current APIMaster price.