API console
POST/v1/images/generations
Bash
curl https://spro.hridaai.com/v1/images/generations \ -H "Content-Type: application/json" \ -H "Authorization: Bearer spro-xxxxxxxxxxxxxxxx" \ -d '{ "model": "openai/gpt-image-1", "prompt": "A white Siamese cat wearing a tiny wizard hat", "size": "1024x1024" }'JSON
{ "created": 1756968000, "data": [ { "url": "https://..." } ], "usage": { "input_tokens": 12, "output_tokens": 1056, "total_tokens": 1068, "input_tokens_details": { "image_tokens": 0 } }}Generate an image
POST https://spro.hridaai.com/v1/images/generations
Creates an image from a text prompt. OpenAI-compatible — use the OpenAI SDK with the Spro base URL. Streaming is not supported yet.
Request body
| Parameter | Type | Required | Description |
|---|---|---|---|
model | string | Required | Image model ID, provider-prefixed — e.g. openai/gpt-image-1. |
prompt | string | Required | Text description of the image to generate. |
background | string | Optional | transparent or opaque (supported models only). |
moderation | string | Optional | Moderation strictness — low or auto. |
n | integer | Optional | Number of images to generate. Defaults to 1. |
output_compression | integer | Optional | Compression level (0–100) for jpeg/webp output. |
output_format | string | Optional | png, jpeg, or webp. |
quality | string | Optional | Quality tier — e.g. low, medium, high (gpt-image) or standard, hd (dall-e-3). |
size | string | Optional | Image dimensions — e.g. 1024x1024. |
user | string | Optional | A unique identifier representing your end user. |
Guardrails
The prompt goes through input guardrails — a violation with a block action returns 403 Forbidden before the upstream call. Generated images are binary, so output guardrails cannot read them yet; the output pass logs usage only. Usage is billed with a separate image_tokens rate for the image portion of the prompt (see input_tokens_details.image_tokens).
{ "error": { "message": "Request blocked by guardrail: sensitive_information_disclosure", "type": "guardrail_block", "code": "GUARDRAIL_BLOCKED" }}