Skip to navigation

BeatAPI Quick Guide

View as Markdown

BeatAPI uses one server-side API key across Text, Workflow, Realtime, Video, Image, and Effect APIs. Start with the three steps below, then use the rest of this guide for synchronous text responses, shared task fields, uploads, limits, and production errors.

First task in three steps

1. Create an API key

Create a key in Dashboard → API Keys, then load it into your shell without placing it in command history:

read -rsp "BeatAPI API key: " BEATAPI_API_KEY && echo
export BEATAPI_API_KEY

Send this header with every request. Image, video, effect, workflow and capability requests go to https://api.beatapi.io. Text requests go to https://direct.beatapi.io (see Text API). The key is the same:

Authorization: Bearer <BEATAPI_API_KEY>

2. Create a task

A new account starts on free credit: a small starter balance (the amount depends on the sign-up region, and some regions start at zero) that can call only the models on the free-tier list. nano-banana-2 is on it. Any model not on the list answers 403 forbidden until the account’s first top-up, and a top-up unlocks every model. GET https://api.beatapi.io/v1/free-tier returns the current list without a key. Each model also carries requires_topup in GET /v1/media/models and in Inspect and Search results: true means the model is refused until the first top-up, and false means at least one tier is open, not that every call will pass. In a region that starts at zero, the first call answers 402 insufficient_credits until you top up. See Free models.

This minimal image request uses POST /v1/images/tasks:

curl https://api.beatapi.io/v1/images/tasks \
-X POST \
-H "Authorization: Bearer $BEATAPI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "nano-banana-2",
"prompt": "Editorial product photograph on a warm stone pedestal."
}'

A valid request returns 201 Created. Save the returned data.id.

Enum values are case-insensitive, and older spellings (1080P, 4k, Fast, Quality) are still accepted. The documentation writes only the canonical spelling.

3. Poll the result

curl https://api.beatapi.io/v1/tasks/task_8K2qA \
-H "Authorization: Bearer $BEATAPI_API_KEY"

Replace task_8K2qA with the data.id from step 2. Wait data.poll_after_seconds seconds between polls. Use the value in the response rather than a constant of your own: it is present while the task runs, and today it is 5 for images, 8 for video and effects, and 10 for data and workflows. On succeeded, read data.output.media and stop polling. On failed, read data.error_code, data.error_message and data.retryable, then stop polling.

Polling GET /v1/tasks/{task_id} is not subject to the request-rate limit, so following poll_after_seconds never earns a 429 from BeatAPI. A 429, 500 or 503 on a poll is transient and says nothing about the task: wait and ask again.

Keep permanent API keys on trusted servers. Never place them in browser code, mobile code, scripts, logs, or screenshots. Realtime browsers receive only a short-lived client_secret created by your server.

Submit, poll and download (Python)

A complete script that submits an image task, waits with a total timeout, handles failed and retryable, and downloads the result:

import os
import time
import uuid
import requests
API = "https://api.beatapi.io"
HEADERS = {"Authorization": f"Bearer {os.environ['BEATAPI_API_KEY']}"}
TRANSIENT = {429, 500, 502, 503, 504}
def create_task(payload, idempotency_key, attempts=4):
for attempt in range(attempts):
# The same key on every attempt: only a 2xx answer is stored, so a retry cannot create a second task.
response = requests.post(
f"{API}/v1/images/tasks",
headers={**HEADERS, "Idempotency-Key": idempotency_key},
json=payload,
timeout=60,
)
if response.ok:
return response.json()["data"]
try:
error = response.json().get("error", {})
except ValueError: # a 502/504 from the network edge has no JSON body: retry it like a 503
error = {"retryable": True}
if not error.get("retryable") or attempt == attempts - 1:
# Keep request_id: it identifies this call when you contact support.
raise RuntimeError(f"{response.status_code} {error.get('code')}: {error.get('message')} ({error.get('request_id')})")
time.sleep(error.get("retry_after_seconds") or min(2 ** attempt * 2, 60)) # a 429 says how long
def wait_for_task(task_id, total_timeout=1800):
deadline = time.monotonic() + total_timeout
wait = 5
while time.monotonic() < deadline:
response = requests.get(f"{API}/v1/tasks/{task_id}", headers=HEADERS, timeout=30)
if response.status_code in TRANSIENT: # not a verdict on the task
time.sleep(float(response.headers.get("Retry-After", wait)))
continue
response.raise_for_status()
task = response.json()["data"]
if task["status"] in ("succeeded", "failed"):
return task
wait = task.get("poll_after_seconds", wait) # the server's interval wins
time.sleep(wait)
# The task is still running on our side. Keep the ID and poll again later; do not resubmit.
raise TimeoutError(f"{task_id} unfinished after {total_timeout}s")
def run(payload, attempts=3):
for attempt in range(attempts):
# A new key per attempt: the key of a failed task would replay that task's stored 201.
task = create_task(payload, idempotency_key=str(uuid.uuid4()))
task = wait_for_task(task["id"])
if task["status"] == "succeeded":
return task
print(f"failed: {task['error_code']}: {task['error_message']} (request_id {task['request_id']})")
if not task["retryable"]: # content_policy_violation, bad_request: change the request
break
raise RuntimeError("task failed")
task = run({"model": "nano-banana-2", "prompt": "Editorial product photograph on a warm stone pedestal."})
for index, media in enumerate(task["output"]["media"]):
file = requests.get(media["url"], timeout=120) # no key needed; save it, the link expires
file.raise_for_status()
with open(f"result-{index}.{media['mime_type'].split('/')[-1]}", "wb") as handle:
handle.write(file.content)
  • Total timeout. The script gives up after 1800 seconds (30 minutes). The slowest models typically finish in about 400 seconds, so this leaves room for queueing without hanging forever. Giving up is your decision, not the task’s: BeatAPI itself stops a task only after its processing window.
  • A create error is retried only when it says so. create_task retries when the error has retryable: true, waits retry_after_seconds on a 429, and sends the same Idempotency-Key each time: only 2xx answers are stored, so a retry cannot create a second task.
  • failed is a normal answer. The HTTP status is 200; the credits reserved for the task are refunded. Retry only when retryable is true.
  • One key per logical request. Reusing the key of a failed task returns that stored task, not a new one.

Get results by webhook

Instead of polling you can register an HTTPS endpoint with POST /v1/webhooks. BeatAPI then posts task.succeeded or task.failed to it when a task finishes, with the same task object that GET /v1/tasks/{task_id} returns. Verify the signature, deduplicate by event ID, and keep a slow reconciliation poll as the fallback. The payloads, headers, retries and verification code are on the Webhooks page.

To have one task’s result delivered to one address instead, add callback_url to an image or video task request; it must be on the host of one of your webhook endpoints. See the One-off callback section of the Webhooks page.

Choose an API

APICreate operationInputResult
Text (GPT-6.2)POST /v1/responsesText, images, tools, and reasoning controlsSynchronous JSON or streamed text response
Workflow — Music VideoPOST /v1/music-video/tasksAudio and tier-specific visual referencesComplete Music Video and storyboard metadata
Workflow — EcommercePOST /v1/ecommerce-video/tasksProduct images, duration, creative briefComplete product video
Workflow — Video AnalysisPOST /v1/video-analysis/tasksUploaded video, analysis prompt, and depthAnalysis text and token usage
RealtimePOST /v1/realtime/sessionsBrowser origin and fixed duration; then live MediaStreamLive generated WebRTC video
VideoPOST /v1/videos/tasksModel-specific prompt and media referencesOne hosted video
ImagePOST /v1/images/tasksModel-specific prompt and optional referencesOne hosted image
EffectPOST /v1/effects/tasksPublished Effect ID, images, supported optionsOne hosted image or video effect result

Text calls go to https://direct.beatapi.io and return synchronously or as a server-sent event stream. Realtime creates a short-lived Session. Workflow, Video, Image, and Effect create operations return an asynchronous Task: store data.id, then poll the shared task endpoint. Polling GET /v1/tasks/{task_id} is not rate limited; wait poll_after_seconds between polls.

For GPT model selection, request formats, and streaming examples, see the GPT guide.

Get task status

GET /v1/tasks/{task_id}

ParameterLocationTypeRequiredRules
task_idPathstringYesUse data.id from a create response

Status values

StatusMeaningClient action
queuedAccepted and waitingContinue polling
processingGeneration is runningContinue polling
storyboard_readyMusic Video storyboard is availableAuto flow may continue; inspect if needed
requires_actionMusic Video manual review is waitingEdit or compose shots
editingMusic Video shot edit is runningContinue polling
composingMusic Video composition is runningContinue polling
succeededHosted output is readyRead data.output and stop polling
failedTask ended with an error; the answer is still HTTP 200Read error (code, message, retryable), then stop polling

Image and video tasks only use queued, processing, succeeded and failed. The other statuses belong to Music Video.

Status names in other APIs

If you are porting a client written for another API, map its statuses like this. BeatAPI has no cancelled status and no endpoint to cancel a task: once accepted, a task runs to succeeded or failed, and a failed task is refunded.

Other APIs often sayBeatAPI saysNotes
pending, submitted, queuedqueuedAccepted and waiting
processing, running, in_progressprocessingKeep polling
completed, success, succeededsucceededRead data.output
failed, errorfailedRead error (or the flat error_code, error_message, retryable)
cancelled, cancelednoneNot supported

Normalized Task fields

FieldTypePresentMeaning
idstringAlwaysStable task ID
objectstringAlwaystask
task_kindstringAlwaysworkflow, effect, image, video, or data
capability_idstringAlwaysStable workflow, Effect, or generation model ID
capability_versionintegerAlwaysAlways 1
workflowstringWorkflow tasksmusic-video or ecommerce-video
effect_idstringEffect tasksStable effect ID
effect_versionintegerEffect tasksImmutable selected effect version
media_typestringImage/video tasksimage or video
modelstringImage/video tasksStable model alias
statusstringAlwaysCurrent lifecycle status
stagestringAlwaysRepeats status; kept for compatibility
storyboardobjectMusic VideoShot metadata when available
created_atintegerAlwaysUnix timestamp
updated_atintegerAlwaysUnix timestamp
completed_atinteger or nullAlwaysTerminal Unix timestamp
poll_after_secondsintegerWhile the task runsSeconds to wait before the next poll: 5 for image, 8 for video and effect, 10 for data and workflows
typical_secondsobjectWhile the task runs, and only with enough historyp50, p90, samples and window: how long this model recently took. Past p90 the task is running long.
outputobject or nullAlwaysnull until success
usageobjectAlwaysCredits and billable duration
request_idstringAlwaysSupport/debug correlation ID of the create call; see Errors for the format
error_codestring or nullAlwaysMachine-readable task failure
error_messagestring or nullAlwaysHuman-readable task failure
retryablebooleanFailed tasks onlyWhether submitting the task again could succeed
errorobjectFailed tasks onlycode, message and retryable in one object, the same values as the three flat fields above, which stay

Usage and output fields

Public response names such as credits_reserved are retained for API compatibility. All credit and balance values are decimal USD ledger amounts: 1 Credit = 1USD.TheDashboarddisplaysthesamevalueswitha‘1 USD. The Dashboard displays the same values with a `` symbol.

FieldTypeMeaning
usage.credits_reservednumberUSD amount reserved for the operation
usage.credits_chargednumberUSD amount charged; 0 on a failed task
usage.billable_duration_secondsinteger, optionalDuration used for USD calculation
usage.credits_settlednumberUSD amount finalized after successful work; 0 on a failed task
usage.credits_refundednumberUSD amount returned after a failed task
output.mediaobject[]Hosted result files
output.media[].typestringimage or video
output.media[].urlstringResult URL. Download and store any result you need to keep.
output.media[].mime_typestringResult MIME type
output.urlstringThe primary result: the first video, or the first image when there is no video
output.r2_urlstringThe same value as output.url, kept for older clients. Read output.url.
output of a data taskobjectA data capability run as a task (such as web.research) has no media: output is the capability’s own result object, the one its synchronous call returns, for example object, status, research_notes and sources

How long things are kept

WhatHow long
Result files (output.media[].url)At least 72 hours after the task finishes. Download and store what you need to keep within that time; the link stops working afterwards.
Files you upload with POST /v1/filesAt least 72 hours after the upload. Upload again if you need the file later.
A task record (GET /v1/tasks/{task_id})Kept separately from the files, so it can still answer after the files are gone, with links that no longer open. Store the ID, status and usage in your own system.
Stored capability results (operation: "result")1 hour
An unfinished task (processing window)At most 24 hours. After that the task fails with processing_timeout and its reservation is refunded; some models use a shorter window.
Idempotency keys24 hours

On a failed task, usage.credits_reserved is the amount held at create, usage.credits_charged and usage.credits_settled are 0, and usage.credits_refunded is the amount returned. An accepted task fails with one of six codes: content_policy_violation and bad_request (not retryable), and processing_unavailable, processing_timeout, processing_failed and result_transfer_failed (retryable). See Errors.

List tasks

GET /v1/tasks

Lists your account’s tasks, newest first. Each item is the task object GET /v1/tasks/{task_id} returns, so one parser reads both.

curl "https://api.beatapi.io/v1/tasks?status=failed&limit=20" \
-H "Authorization: Bearer $BEATAPI_API_KEY"
ParameterTypeRules
statusstringqueued, processing, succeeded or failed. Repeat the parameter or separate values with commas to take several.
modelstringThe model ID you sent, matched exactly. An ID this gateway does not serve is 400 bad_request
created_afterstringUnix seconds or an RFC 3339 time; tasks created at that moment or later
created_beforestringUnix seconds or an RFC 3339 time; tasks created before that moment, so adjacent ranges neither overlap nor leave a gap
limitinteger1 to 100, default 20
cursorstringThe next_cursor of the previous page
api_key_idintegerThe numeric id of one of your API keys, from GET /v1/account/keys; only tasks submitted with that key. Any other value is 400 bad_request

An unknown parameter is 400 bad_request. The answer is {"data": {"object": "list", "data": [task, …], "has_more": true, "next_cursor": "…"}}; the last page has no next_cursor.

  • The cursor is opaque. Pass next_cursor back as cursor and do not build or edit one. It works only for the account that read that page; any other value is 400 bad_request.
  • Status filters follow the lifecycle. status filters by queued, processing, succeeded and failed. processing also matches a Music Video task that is at a stage such as storyboard_ready.
  • Synchronous calls are not listed. Social data, web and SEO calls answer in the response; they are not tasks, so they never appear here and GET /v1/tasks/{task_id} answers 404 for them.
  • A filtered page can be short, even empty. With model or api_key_id, one page reads at most the 2,000 most recent tasks after the cursor and returns the matches among them, so it can hold fewer than limit items or none while has_more is true. Keep following next_cursor until has_more is false; a short or empty page is not the end of the list.
  • Rate limit. GET /v1/tasks allows 60 requests per minute for the account, however many API keys it has; past that it answers 429 rate_limit_exceeded with Retry-After. To follow one task, poll GET /v1/tasks/{task_id}, which has no such limit.

Upload an input file

POST /v1/files

Use file upload when an input is local instead of already available at a public HTTPS URL. Every upload must include an exact Content-Length; normal curl, browser, and SDK uploads set it automatically. Chunked uploads without a declared length are rejected before the body is buffered.

Multipart fields

FieldTypeRequiredDefaultRules
filebinaryYes—One supported file; video up to 100 MB, other types up to 50 MB. A multipart part over 100 MB is refused outright
purposestringNoinputIgnored; the response always says input
curl https://api.beatapi.io/v1/files \
-X POST \
-H "Authorization: Bearer $BEATAPI_API_KEY" \
-F "file=@./song.mp3" \
-F "purpose=input"

You may also send the raw file body with its asset Content-Type.

AssetAccepted extensionsAccepted MIME typesAdditional rule
ImagePNG, JPG/JPEG, WebPimage/png, image/jpeg, image/webpMaximum 50 MB
AudioMP3, WAV, AAC, M4Aaudio/mpeg, audio/wav, audio/aac, audio/mp4Maximum 50 MB
SubtitleSRTapplication/x-subrip; text/plain only in a multipart upload whose filename ends in .srtMaximum 50 MB
VideoMP4, MOVvideo/mp4, video/quicktimeMaximum 100 MB

Some common aliases are accepted and stored under the canonical type, for example image/jpg as image/jpeg, audio/mp3 as audio/mpeg, and text/plain (with a .srt filename) as application/x-subrip. PDF, generic text, octet-stream, unsupported video containers, and ZIP uploads are refused with 400 bad_request. The gateway trusts the declared Content-Type; when the filename has an extension, it must agree with that type. It does not inspect the file contents and does not read duration or dimensions. A file accepted by the upload can still be refused by the model or workflow that uses it, for example for duration or size rules, when you create the task. Workflow input URLs cannot be localhost, private-network, or data URLs.

Upload refusals are 400 bad_request with one of these messages:

MessageCause
Content-Length is required for file uploads.No declared length.
Content-Length must be a positive integer.Invalid declared length.
File exceeds the declared upload limit.Declared length is over the upload limit.
No file provided. Use multipart "file" field or a raw body.No file in the request.
The uploaded file is empty.Zero bytes.
Unsupported file type. Supported uploads are png, jpg, jpeg, webp, mp3, wav, aac, m4a, mp4, mov, and srt.Type or extension not accepted.
File exceeds the 50 MB limit.Over 50 MB (File exceeds the 100 MB limit. for video).
File exceeds the 100 MB upload limit.A multipart part over 100 MB.
Could not read the uploaded file.The file body could not be read.
Could not read the multipart upload.The multipart form could not be parsed.

If the file cannot be stored, the upload answers 503 with processing_unavailable (“File storage is temporarily unavailable. Retry later; nothing was stored.”) or result_transfer_failed (“The file could not be stored on our side. Retry; nothing was stored.”). Retry with backoff.

File response

{
"data": {
"id": "file_6f1c2b9e-4d0a-4c58-9a57-2f0a8f3d7b11",
"object": "file",
"url": "https://files.beatapi.io/u/6f1c2b9e4d0a4c589a572f0a8f3d7b11.mp3",
"key": "u/6f1c2b9e4d0a4c589a572f0a8f3d7b11.mp3",
"mime_type": "audio/mpeg",
"size_bytes": 1048576,
"purpose": "input",
"created_at": 1782210000
}
}
FieldTypePresentMeaning
idstringAlwaysFile ID, file_<uuid>
objectstringAlwaysfile
urlstringAlwaysHTTPS input URL
keystringAlwaysStorage key, u/<random>.<ext>
mime_typestringAlwaysThe canonical MIME type the file is stored and served under (for example image/jpg is reported as image/jpeg)
size_bytesintegerAlwaysUploaded byte size
purposestringAlwaysinput
created_atintegerAlwaysUnix timestamp

Use data.url in the model or workflow request. The model or workflow checks its own limits when you create the task; for example, Standard Music Video accepts 10–180 seconds of audio and Premium accepts 10–300.

Check usage and limits

GET /v1/usage

Send an API key or your account’s personal access token; both return the same account-wide summary.

The one optional query parameter, period, sets the window the counts and breakdowns cover, ending now: 24h, 7d, 30d or all (the default, the whole account history). credit_balance and concurrency are always current. Any other parameter, or another period value, is refused with 400.

curl "https://api.beatapi.io/v1/usage?period=7d" \
-H "Authorization: Bearer $BEATAPI_API_KEY"
FieldTypeMeaning
objectstringusage
periodstring24h, 7d, 30d or all
since, untilinteger, optionalWindow bounds in unix seconds; absent for all
account_namestring, optionalAccount display name
credit_balancenumberCurrent USD balance; it may be negative
total_tasksintegerAccount task count
credits_settlednumberSettled USD amount
credits_refundednumberRefunded USD amount
concurrencyobjectProcessing-task capacity summary
concurrency.limitintegerAccount cap on tasks in flight. 0 means no cap: BeatAPI limits request rate, not concurrent tasks
concurrency.activeintegerTasks currently consuming processing capacity
realtimeobject, optionalRealtime Session usage summary
realtime.sessionsintegerTotal Realtime Sessions
realtime.creditsnumberRealtime settled USD amount
realtime.activeintegerSessions in ready, connecting, or active
by_workflow[]object[]Workflow compatibility breakdown
by_capability[]object[]All task kinds by stable capability
by_model[]object[]Image/video tasks by model alias
by_api_key[]object[]Task/credit totals by API key

Breakdown item fields:

ArrayRequired item fields
by_workflowworkflow, tasks, credits_settled
by_capabilitytask_kind, capability_id, tasks, credits_settled
by_modelmedia_type, model, tasks, credits_settled
by_api_keyapi_key_id, title, key_prefix, tasks, credits_settled

Music Video tasks paused at storyboard_ready or requires_action can have settled credits without counting as active processing work.

To see what each task or text request cost, read the per-request usage records with your account’s personal access token.

Errors and retry policy

{
"error": {
"code": "rate_limit_exceeded",
"message": "Rate limit exceeded: at most 10 successful requests per 1 minute(s). Retry after 60 seconds.",
"retryable": true,
"request_id": "202611260307541272151438268d9d6mNDNwzi9",
"retry_after_seconds": 60
}
}

Every error carries code, an English message that states the cause, and request_id (also sent in the X-BeatAPI-Request-Id response header; quote it when you contact support); only a 429 rate_limit_exceeded also carries retry_after_seconds and the Retry-After header; a 503 has no known wait, so retry it with backoff. retryable is present for every code in the table below. Branch on it: false means the same call will fail again until you change it.

Public error codes

BeatAPI exposes only the stable public codes below. BeatAPI never names the supplier behind a model and does not pass on raw upstream bodies. Errors lists which code each failure produces at create and on an accepted task, and how the text endpoints fail before the model is called (this envelope) and during the call (the SDK’s native error shape, with BeatAPI codes for our own refusals and rewritten codes for failures on the model’s side). These values appear in response error.code. Terminal asynchronous failures may also return the applicable value in task error_code.

CodeMeaningClient action
bad_requestMalformed JSON, or request fields, combinations, formats, URLs, or limits are invalid — at create, or on an accepted task whose parameter or input the model refused. The message names the fieldCorrect the request before retrying
missing_api_keyNo API key was sentSend Authorization: Bearer <key>
invalid_api_keyThe key is wrong, expired, disabled, or has used up its own quota; the message says whichCheck the active key in the dashboard
unauthorizedLegacy name for a 401, replaced by missing_api_key and invalid_api_key on 2026-09-29; it may still appearTreat it like invalid_api_key
forbiddenThe key or account cannot perform the operation, for example a model not on the free-tier list, the key’s IP allowlist, or the key’s groupRead the message; a top-up unlocks every model for free-credit accounts
not_foundAn unknown model on the text endpoints, an unknown capability, or a task or resource that does not exist or is not owned by this API key’s account. An uncatalogued model on the image and video task endpoints is 400 bad_request insteadCheck the ID and API-key ownership
method_not_allowedThe path exists but not under this method; the Allow header lists the methods it acceptsUse a method from Allow
insufficient_creditsInsufficient balance: the account balance is zero or below the price of this request, or the key still has quota but less than the priceTop up (or raise the key’s quota) before sending another paid request
idempotency_conflictThe idempotency key was already used with a different request bodyReuse the key only for the same logical request, or use a new key
rate_limit_exceededThe API key exceeded a request-rate limit, including the free-model limitsHonor Retry-After or retry_after_seconds
content_policy_violationThe prompt, input media, or result was refused by content moderationRevise the prompt or media before submitting a new request
processing_unavailableThe model is temporarily unavailable or at capacity (not your rate limit)Retry later with backoff; continue polling an already accepted task
processing_failedProcessing failed for a reason on our sideStop polling, inspect error_message and refund fields, then retry with backoff
processing_timeoutProcessing did not finish within the processing window (at most 24 hours)Stop polling, inspect refund fields, and submit a new request if needed
result_transfer_failedBeatAPI could not persist the generated result to first-party storageStop polling, inspect refund fields, and retry the operation if needed
result_expiredPOST /v1/capabilities/run with operation: "result" found no stored result; results are kept for one hour (404)Run the capability again
not_implementedThe endpoint is published but this gateway does not serve it yet (501)Do not retry
realtime_disabledRealtime Video is not enabled on this deploymentRealtime Video is not enabled on this deployment; there is no self-service action, so contact support
realtime_capacity_unavailableRealtime capacity is temporarily unavailableRetry shortly with backoff; no delay is indicated
realtime_session_expiredThe Realtime Session can no longer be usedCreate a new Session and client secret
origin_not_allowedThe browser origin is not allowed for the Realtime SessionUse an exact configured HTTPS origin
invalid_client_secretThe Realtime client secret is invalid or no longer usableCreate a new Session and use its new client secret
transport_not_allowedThe requested Realtime transport is not allowedUse a transport documented by the Realtime API
internal_errorBeatAPI encountered an unexpected internal errorRetain request_id; retry only when safe or contact support
HTTPCoderetryableClient action
400bad_request, content_policy_violationfalseCorrect fields, combinations, formats, URLs, limits, or the input
401missing_api_key, invalid_api_keyfalseSend or replace the Bearer key
402insufficient_creditsfalseTop up before a new paid request
403forbidden or Realtime origin errorfalseCheck permission or exact browser origin
404not_found, result_expiredfalseCheck the model, reference, or ID and API-key ownership
405method_not_allowedfalseUse a method from the Allow header
409idempotency_conflictfalseReuse a key only with the same logical request body
429rate_limit_exceededtrueHonor Retry-After or retry_after_seconds
500internal_errortruePreserve request_id; retry once, then contact support
501not_implementedfalseDo not retry
503processing_unavailable, processing_timeout, processing_failed, result_transfer_failedtrueRetry with backoff

BeatAPI does not answer 502 or 504; one you still see came from the network edge, has no JSON body, and is retried like a 503.

Idempotency:

  • Send the key in the Idempotency-Key request header. Workflow, Image, Video, and Effect task creation accept an optional key, and so does POST /v1/capabilities/run. Realtime Session create requires it (up to 255 characters).
  • A key is remembered for 24 hours. A key longer than 255 characters is 400 bad_request.
  • The same key with a different body or path is 409 idempotency_conflict. So is the same key while the first request is still running.
  • Repeating the identical request returns the stored response with the header Idempotent-Replayed: true.
  • Only 2xx responses are stored, so after a 400 or 402 you can retry with the same key.

Production checklist

  • Use the exact origin: https://api.beatapi.io for image, video, effect, workflow and capability calls, https://direct.beatapi.io for text calls.
  • Keep permanent API keys on trusted servers.
  • Validate required/optional fields, enums, limits, and conditional rules from the selected API page.
  • Store task/Session IDs and request_id before starting background work.
  • Poll every poll_after_seconds and stop at the documented terminal or action state.
  • Download and store the results you need to keep within 72 hours of completion.
  • Honor status codes, Retry-After, and retry_after_seconds.
  • Verify webhook signatures against raw bytes before JSON parsing. Webhooks send only task.succeeded and task.failed, with 3 attempts (retries after 1 minute and 5 minutes). A task that times out sends task.failed too, but keep a slow poll as the source of truth.
  • Record credit reservations, settlements, refunds, errors, and final output URLs.
  • Review the Privacy Policy and Terms of Service before processing cameras, faces, voices, or reference assets.