Skip to content

Your first generation

Open Integrations using your subscription email. Enable API + MCP if needed, then create a key with account:read, generations:write, generations:read and media:read.

The complete key is shown once. Store it in your server’s secret manager. Never place it in browser code, Git, screenshots or URL parameters.

Janela do terminal
export INFINITY_FLOW_API_KEY='YOUR_PRIVATE_KEY'
export INFINITY_FLOW_API_BASE='https://infinityflow.stream/api/v1'
Janela do terminal
curl --fail-with-body "$INFINITY_FLOW_API_BASE/account" \
-H "Authorization: Bearer $INFINITY_FLOW_API_KEY"

The response includes account and entitlements: current plan, automation and limits. For 403 AUTOMATION_REQUIRED, check both the base plan and automation add-on.

Generate a new UUID for each new creation. Save the UUID and payload before sending. Replace the illustrative UUID below before your first request.

Janela do terminal
export INFINITY_FLOW_REQUEST_KEY='a2b2da8a-d14a-43ad-8846-91c741bb5301'
curl --fail-with-body "$INFINITY_FLOW_API_BASE/generations" \
-H "Authorization: Bearer $INFINITY_FLOW_API_KEY" \
-H 'Content-Type: application/json' \
-H "Idempotency-Key: $INFINITY_FLOW_REQUEST_KEY" \
--data '{"prompt":"A forest at sunrise, slow cinematic camera movement","mediaKind":"video","aspect":"16:9"}'

The 202 response contains generation.id, its initial state and a Location header. Save the ID. Acceptance does not mean the video is already ready.

Janela do terminal
curl --fail-with-body "$INFINITY_FLOW_API_BASE/generations/GENERATION_ID" \
-H "Authorization: Bearer $INFINITY_FLOW_API_KEY"

Start polling at five-second intervals and back off when needed. When the state becomes succeeded, inspect the output and expiry. attention_required means the saved request needs review; it is not permission to submit it again.

Request a temporary URL, then download it without forwarding your Infinity Flow Authorization header:

Janela do terminal
curl --fail-with-body "$INFINITY_FLOW_API_BASE/generations/GENERATION_ID/outputs/0/download-ticket" \
-H "Authorization: Bearer $INFINITY_FLOW_API_KEY"
# Read the returned url and download it in a separate request:
curl --fail-with-body 'RETURNED_TEMPORARY_URL' --output video.mp4

Outputs remain available for 24 hours from readiness. A temporary link normally lasts up to 90 seconds. Refreshing a link does not extend the 24-hour retention window.

Idempotency and retries · REST reference