BeatAPI Image API

Image API

Create one asynchronous image generation task with a stable BeatAPI model ID.

ModelInput modesRequired fieldsMain controls
nano-bananaText, reference imagesmodel, promptUp to 10 references, aspect ratio, PNG/JPEG output
nano-banana-2Text, reference imagesmodel, promptUp to 10 references, 1K/2K/4K, PNG/JPEG output
nano-banana-2-liteText, reference imagesmodel, promptUp to 10 references, fixed 1K, PNG/JPEG output
nano-banana-proText, reference imagesmodel, promptUp to 8 references, up to 4K
gpt-image-2Text, reference imagesmodel, promptUp to 16 references, broad aspect ratios, up to 4K
seedream-5-proText, reference imagesmodel, promptUp to 10 references, 1K/2K/4K
grok-imagine-image-2.0Text, reference imagesmodel, promptUp to 5 references, automatic edit-mode selection

Open the matching model page for every field, default, enum, combination rule, request example, response, and error behavior.

List available models

GET /v1/media/models

ParameterLocationTypeRequiredAllowed values
media_typeQuerystringNoimage, video

This public endpoint does not require authentication.

$curl "https://api.beatapi.io/v1/media/models?media_type=image"
1{
2 "data": {
3 "object": "list",
4 "data": [
5 {
6 "id": "gpt-image-2",
7 "object": "generation_model",
8 "name": "GPT Image 2",
9 "media_type": "image",
10 "input_modes": ["text", "image"]
11 }
12 ]
13 }
14}
FieldTypeMeaning
idstringStable public model alias
objectstringgeneration_model
namestringDisplay name
media_typestringimage or video
input_modesstring[]Any of text, image, frames, reference

Internal provider routing is not part of the public contract.

Shared create contract

POST /v1/images/tasks

HeaderTypeRequiredRules
AuthorizationstringYesBearer <BEATAPI_API_KEY>
Content-TypestringYesapplication/json
Idempotency-KeystringNo, recommendedUp to 255 characters; one key per logical create

The body must match exactly one model schema. model is the discriminator; unknown fields are rejected.

$curl https://api.beatapi.io/v1/images/tasks \
> -X POST \
> -H "Authorization: Bearer $BEATAPI_API_KEY" \
> -H "Idempotency-Key: image-gpt-image-2-001" \
> -H "Content-Type: application/json" \
> -d '{
> "model": "gpt-image-2",
> "prompt": "Editorial product photograph on a warm stone pedestal.",
> "aspect_ratio": "1:1",
> "resolution": "1K"
> }'

A valid request returns 201 Created with data.id, task_kind="image", the selected model, status="queued", usage metrics, and request_id. Poll GET /v1/tasks/{task_id} every 5–10 seconds until succeeded or failed; successful image is in data.output.media[] and data.output.r2_url.

An exact idempotent replay returns the accepted task. Reusing a key with a different body returns 409 idempotency_conflict.

Shared errors

HTTPCommon codeClient action
400bad_requestFix fields, values, combinations, counts, or media URLs
401unauthorizedCheck the Bearer key
402insufficient_creditsAdd credits before creating a new task
409idempotency_conflictReuse the key only with the exact same body
429Rate or concurrency codeHonor the retry delay or wait for active work to finish

Error responses include error.code, error.message, error.request_id, and optional error.retry_after_seconds. The per-model pages below are the production request contracts.