Your first generation
1. Enable automation
Section titled “1. Enable automation”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.
export INFINITY_FLOW_API_KEY='YOUR_PRIVATE_KEY'export INFINITY_FLOW_API_BASE='https://infinityflow.stream/api/v1'2. Check your account
Section titled “2. Check your account”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.
3. Save a request identity, then submit
Section titled “3. Save a request identity, then submit”Generate a new UUID for each new creation. Save the UUID and payload before sending. Replace the illustrative UUID below before your first request.
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.
4. Retrieve progress without resubmitting
Section titled “4. Retrieve progress without resubmitting”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.
5. Download privately
Section titled “5. Download privately”Request a temporary URL, then download it without forwarding your Infinity Flow Authorization header:
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.mp4Outputs 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.