Skip to documentation
DEVELOPER DOCS / HASHBIDXMODEL ACCESS. ONE INTEGRATION.

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/generations

Key request parameters

ParameterTypeDescription
modelstring · RequiredModel identifier, e.g. doubao-seedream-5-0-pro-260628 / qwen-image-plus / gpt-image-2
promptstring · RequiredText prompt
nintegerNumber of images; default 1
sizestringSize preset (e.g. 2K) or WxH (e.g. 2048x2048); supported values depend on the model
response_formatenumurl (default) | b64_json
watermarkbooleanWhether to add a watermark (Doubao / Volcano Engine only)
userstringEnd-user identifier for abuse tracking

Key response parameters

ParameterTypeDescription
createdintegerUnix timestamp (seconds)
data[].urlstringReturned when response_format=url
data[].b64_jsonstringReturned when response_format=b64_json
data[].revised_promptstringModel-revised prompt, if any
data[].sizestringActual size of the generated image
usage.generated_imagesintegerNumber of images generated
usage.output_tokensintegerImage tokens counted toward billing
usage.total_tokensintegerSum

Integration examples

Replace the API key and model ID in these examples with your values.

cURL
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
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
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
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
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.

All API endpoints
BUILD WITH HASHBIDX

Find your model. Make your first call.

Models & pricing