Developers

Studio API

Images and video over HTTP, with the same keys you use for the LLM API (make one per app on ai-era.id/studio/api). Paid in IDR from your balance; failed jobs are refunded.

Base URL https://api.ai-era.id/v1/studio

Auth Authorization: Bearer $AIERA_API_KEY (from your dashboard)

Prefer an AI app? The same tools are on MCP.

Quick start

An image in one call

curl https://api.ai-era.id/v1/studio/images \
  -H "Authorization: Bearer $AIERA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model": "z-image-turbo", "prompt": "a red apple on a marble table", "aspect": "1:1", "wait": 30}'

With wait (up to 60 seconds) the answer is 200 once the image is ready, else 202 and you poll. Images land in your Studio gallery too.

{
  "id": "req_6f0c…",
  "object": "studio.request",
  "status": "completed",            // processing | completed | failed
  "charged_idr": 480,
  "charge_final": true,
  "generations": [{
    "id": "9c28cfe6-…",
    "status": "completed",
    "model": "z-image-turbo",
    "outputs": [{ "asset_id": "…", "url": "https://ai-era.id/api/studio/media/…?t=…", "mime": "image/png" }]
  }]
}

Output URLs are signed and work for 7 days. Download what you want to keep.

Video

Start, then poll or wait for a webhook

Video takes a few minutes. Check the price first: it is held from your balance when you start.

curl https://api.ai-era.id/v1/studio/estimate -H "Authorization: Bearer $AIERA_API_KEY" -H "Content-Type: application/json" \
  -d '{"model": "wan-3", "prompt": "a cat walks through a garden", "duration": 5, "resolution": "480p"}'

curl https://api.ai-era.id/v1/studio/videos -H "Authorization: Bearer $AIERA_API_KEY" -H "Content-Type: application/json" \
  -H "Idempotency-Key: order-1234" \
  -d '{"model": "wan-3", "prompt": "a cat walks through a garden", "duration": 5, "resolution": "480p",
       "callback_url": "https://example.com/aiera-webhook"}'

curl https://api.ai-era.id/v1/studio/requests/req_6f0c… -H "Authorization: Bearer $AIERA_API_KEY"

Model ids and the values each accepts come from GET /models. Idempotency-Key is optional: retrying with the same key returns the first answer and charges nothing.

References

Your own images, video and audio

references, start_frame, end_frame, video_references and audio_references take an asset_id from POST /uploads, or a public https link that is downloaded for you (JPG, PNG, WEBP, MP4, WAV, MP3, up to 45 MB).

curl https://api.ai-era.id/v1/studio/uploads -H "Authorization: Bearer $AIERA_API_KEY" -F [email protected]

curl https://api.ai-era.id/v1/studio/images -H "Authorization: Bearer $AIERA_API_KEY" -H "Content-Type: application/json" \
  -d '{"model": "nano-banana-2", "prompt": "the product on a beach at sunset", "references": ["<asset_id>"], "wait": 60}'

Lip sync

A talking photo from a voice clip

Models like kling-avatar-2-std and omnihuman-1.5 take one photo and one audio clip. The video is as long as the audio and priced per second of it.

curl https://api.ai-era.id/v1/studio/uploads -H "Authorization: Bearer $AIERA_API_KEY" -F [email protected]
curl https://api.ai-era.id/v1/studio/uploads -H "Authorization: Bearer $AIERA_API_KEY" -F [email protected]

curl https://api.ai-era.id/v1/studio/videos -H "Authorization: Bearer $AIERA_API_KEY" -H "Content-Type: application/json" \
  -d '{"model": "kling-avatar-2-std", "references": ["<photo asset_id>"], "audio_references": ["<audio asset_id>"]}'

No duration and no prompt needed. To give an existing video new speech, use a model whose needs in GET /models says “Re-voice a video”, with the video in video_references.

Reference

Endpoints

GET/modelsModels you can use, with ratios, resolutions and durations. ?kind=image|video
POST/estimatePrice of a request before running it. Same body as images/videos.
POST/imagesCreate 1 to 4 images. Add "wait": 30 to get the result in the same call.
POST/videosCreate one video. Returns at once; poll or use a webhook.
GET/requests/{id}A request and its generations, with result URLs once done.
GET/generationsYour work, newest first. ?kind, ?limit, ?before, ?search
GET/generations/{id}One generation.
POST/uploadsStore an image, MP4 or WAV/MP3 to use as a reference. Multipart file, or JSON url / data_base64.
GET/balanceYour balance in IDR.
GET/webhook-secretThe secret your webhooks are signed with.

Generate body: model, prompt, and optionally aspect, resolution, quality, n (images, 1 to 4), duration and sound (video), the reference fields above, folder, callback_url, wait (images).

Webhooks

Signed callbacks

Sent once every generation in the request has finished and the final price is settled.

POST <your callback_url>
Aiera-Signature: t=1761100000,v1=5b1c…
Aiera-Webhook-Id: evt_6f0c…

{ "id": "evt_6f0c…", "type": "studio.request.completed", "created_at": "…", "data": { …the request… } }

Verify with the secret from GET /webhook-secret: HMAC-SHA256 of <t>.<raw body>, hex. Answer 2xx within 10 seconds. Failures are retried after 1 min, 5 min, 30 min, 2 h and 6 h. The type is studio.request.failed when nothing succeeded.

// Node
import crypto from "node:crypto";
function verify(rawBody, header, secret) {
  const { t, v1 } = Object.fromEntries(header.split(",").map((p) => p.split("=")));
  const want = crypto.createHmac("sha256", secret).update(`${t}.${rawBody}`).digest("hex");
  const fresh = Math.abs(Date.now() / 1000 - Number(t)) < 300;
  return fresh && crypto.timingSafeEqual(Buffer.from(want), Buffer.from(v1));
}
# Python
import hashlib, hmac, time
def verify(raw_body: bytes, header: str, secret: str) -> bool:
    parts = dict(p.split("=", 1) for p in header.split(","))
    want = hmac.new(secret.encode(), f"{parts['t']}.".encode() + raw_body, hashlib.sha256).hexdigest()
    return abs(time.time() - int(parts["t"])) < 300 and hmac.compare_digest(want, parts["v1"])

Errors

Status codes

Errors look like the LLM API's: { error: { message, type, code } }.

400Bad input: unknown model, wrong kind, invalid settings or callback_url. error.reason says which.
401Missing, unknown, expired or suspended key.
402Not enough balance. error.need_idr and error.balance_idr; top up at ai-era.id/dashboard/topup.
404Not found, or not yours.
409The same Idempotency-Key is still being submitted. Retry in a moment.
422Idempotency-Key reused with a different body.
429Rate limit: 120 calls and 20 generate calls a minute per key.
503The price or the model vendor is unavailable right now. Nothing was charged.