Images
Generate AI images with the Fish Audio Open API.
Images
Use GET /api/open/v1/media/models?mediaType=image to discover verified models, POST /api/open/v1/media/images/jobs to generate, and GET /api/open/v1/media/images/jobs/{jobId} to read a job owned by the API-key user.
Request
Create requests use bearer authentication and API quota:
Authorization: Bearer FISHAUDIO_API_KEY
Idempotency-Key: UNIQUE_REQUEST_IDcurl https://fishaudio.org/api/open/v1/media/images/jobs \
-H "Authorization: Bearer $FISHAUDIO_API_KEY" \
-H "Idempotency-Key: image-$(uuidgen)" \
-H "Content-Type: application/json" \
-d '{"prompt":"cinematic product photo","model":"nano-banana","aspect_ratio":"9:16"}'Response
Image task responses typically include task id, status, result image URL on success, and an error code on failure. Store the task id before polling so users can recover the result after page refresh or worker restart.
Billing And Credits
The endpoint uses API quota, not website member credits. Provider, storage, or persistence failures are refunded idempotently. Check Profile before large batches.
Idempotency-Key is required and must be unique for each intended creation. Retrying the same request with the same key returns the original response without creating or charging a second task.
Errors
Handle unsupported model, invalid reference image, insufficient credits, and processing failure separately. If image endpoints are absent from GET /api/openapi.json, treat the capability as not publicly available for the account.
Resolution and reference options
Use resolution: "1k" (default), "2k", or "4k" only when offered by the model catalog. Each catalog variant includes its credit quote and reference limit. For edits, provide either image_url or an ordered image_urls array of up to four references, never both. GPT Image 2 currently supports references only at 1K; Nano Banana Pro supports up to four at all three tiers.