Skip to main content

Image generations

OpenAI-compatible image generation endpoint.

POST https://api.ecohash.com/v1/images/generations

Headers

HeaderValue
AuthorizationBearer eco_YOUR_KEY
Content-Typeapplication/json

Request body

FieldTypeRequiredNotes
modelstringyesImage model ID (e.g. flux-1-schnell)
promptstringyesText prompt — up to ~1000 characters
nintegernoNumber of images. Currently only 1 is supported
sizestringno512x512, 768x768, 1024x1024, 1024x768, 768x1024. Default 1024x1024
response_formatstringno"b64_json" (default) or "url"
seedintegernoDeterministic generation (non-OpenAI extension)

Example request

curl https://api.ecohash.com/v1/images/generations \
-H "Authorization: Bearer eco_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "flux-1-schnell",
"prompt": "a watercolor painting of a fox in a misty forest",
"size": "1024x1024",
"response_format": "b64_json"
}'

Response body

{
"created": 1776391234,
"data": [{
"b64_json": "iVBORw0KGgo...",
"revised_prompt": null
}]
}

With response_format: "url", the response has url: "https://..." instead of b64_json — URL is valid for 24 hours.

Errors

See Errors. Common: 401, 402, 404, 429.