Images
Generate image
OpenAI-compatible image generation. Model-agnostic — works with Volcano Engine Seedream, Bailian qwen-image, OpenAI gpt-image, and others. The gateway forwards only the fields listed below and ignores the rest; values such as size are validated by the upstream model.
POST
/v1/images/generationsKey request parameters
| Parameter | Type | Description |
|---|---|---|
model | string · Required | Model identifier, e.g. doubao-seedream-5-0-pro-260628 / qwen-image-plus / gpt-image-2 |
prompt | string · Required | Text prompt |
n | integer | Number of images; default 1 |
size | string | Size preset (e.g. 2K) or WxH (e.g. 2048x2048); supported values depend on the model |
response_format | enum | url (default) | b64_json |
watermark | boolean | Whether to add a watermark (Doubao / Volcano Engine only) |
user | string | End-user identifier for abuse tracking |
Key response parameters
| Parameter | Type | Description |
|---|---|---|
created | integer | Unix timestamp (seconds) |
data[].url | string | Returned when response_format=url |
data[].b64_json | string | Returned when response_format=b64_json |
data[].revised_prompt | string | Model-revised prompt, if any |
data[].size | string | Actual size of the generated image |
usage.generated_images | integer | Number of images generated |
usage.output_tokens | integer | Image tokens counted toward billing |
usage.total_tokens | integer | Sum |
Integration examples
Replace the API key and model ID in these examples with your values.
cURL
curl https://hashbidx.ai/v1/images/generations \
-H "Authorization: Bearer <YOUR_API_KEY>" \
-H "Content-Type: application/json" \
-d '{
"model": "doubao-seedream-5-0-pro-260628",
"prompt": "interstellar, a black hole, a shattered vintage train bursting out of it, cinematic",
"size": "2K",
"response_format": "url",
"watermark": false
}'Python
import httpx
resp = httpx.post(
"https://hashbidx.ai/v1/images/generations",
headers={"Authorization": "Bearer <YOUR_API_KEY>"},
json={
"model": "doubao-seedream-5-0-pro-260628",
"prompt": "a cat playing piano, cinematic lighting",
"size": "2K",
"response_format": "url",
"watermark": False,
},
)
resp.raise_for_status()
print(resp.json())Node.js
const resp = await fetch("https://hashbidx.ai/v1/images/generations", {
method: "POST",
headers: {
"Authorization": "Bearer <YOUR_API_KEY>",
"Content-Type": "application/json",
},
body: JSON.stringify({
model: "doubao-seedream-5-0-pro-260628",
prompt: "a cat playing piano, cinematic lighting",
size: "2K",
response_format: "url",
watermark: false,
}),
});
console.log(await resp.json());Go
body, _ := json.Marshal(map[string]any{
"model": "doubao-seedream-5-0-pro-260628",
"prompt": "a cat playing piano, cinematic lighting",
"size": "2K",
"response_format": "url",
"watermark": false,
})
req, _ := http.NewRequest("POST",
"https://hashbidx.ai/v1/images/generations", bytes.NewReader(body))
req.Header.Set("Authorization", "Bearer <YOUR_API_KEY>")
req.Header.Set("Content-Type", "application/json")
resp, err := http.DefaultClient.Do(req)Rust
let body = serde_json::json!({
"model": "doubao-seedream-5-0-pro-260628",
"prompt": "a cat playing piano, cinematic lighting",
"size": "2K",
"response_format": "url",
"watermark": false,
});
let resp = reqwest::Client::new()
.post("https://hashbidx.ai/v1/images/generations")
.bearer_auth("<YOUR_API_KEY>")
.json(&body)
.send().await?;If the response includes X-Request-Id, include it when troubleshooting an issue.