PrivateMind exposes an OpenAI-compatible image-generation endpoint. Image models generate an image from a text prompt.
Generate an image
POST /v1/images/generations returns an image generated from a text prompt.
cURL
curl -s "https://api.privatemind.com/v1/images/generations" \
-H "Authorization: Bearer $PMIND_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "cosmos3-super-text2image",
"prompt": "a red panda on a mossy log in a misty forest at sunrise, photorealistic",
"size": "1024x1024"
}'model(required): image model id. List withGET /v1/models(typeimage-gen). The aliast2ialso resolves to this model.prompt(required): text description of the image to generate.size(required): output resolution asWIDTHxHEIGHT(e.g.1024x1024). A missing or malformed value is rejected with a 400.n(default1): number of images to generate.negative_prompt(optional): text describing what to avoid in the image.num_inference_steps(default50): diffusion steps. Fewer is faster; more can refine detail.guidance_scale(default4.0): how strongly the image adheres to the prompt.seed(optional): fix for reproducible output. Omit for a random image each call.response_format(defaultb64_json):b64_jsonreturns the image inline as base64;urlis not supported.
Response
The response follows the OpenAI images shape. The image is returned inline as base64-encoded PNG under data[].b64_json:
JSON
{
"created": 1781481050,
"data": [
{ "b64_json": "iVBORw0KGgoAAAANSUhEUgAA..." }
]
}Decode it to a file:
Python
import base64, json, requests, os
resp = requests.post(
"https://api.privatemind.com/v1/images/generations",
headers={"Authorization": f"Bearer {os.environ['PMIND_KEY']}"},
json={
"model": "cosmos3-super-text2image",
"prompt": "a red panda on a mossy log in a misty forest at sunrise, photorealistic",
"size": "1024x1024",
},
timeout=300,
)
resp.raise_for_status()
img = base64.b64decode(resp.json()["data"][0]["b64_json"])
open("out.png", "wb").write(img)Content safety
Image models may apply a content-safety guardrail (unsafe-content classification and face blurring) before returning results. Prompts or outputs flagged as unsafe are rejected with an error.
Where next
- Models to list image-capable models in your org.
- Authentication for issuing and using API keys.
- Rate limits for budget and RPM behaviour.
- Errors for status codes and error shapes.