Skip to content
New account priceyour first 5 videos are just HK$1 eachthen HK$30 eachSee pricing
Axiom Lab
Developer docs

Guide

Quickstart

Get a key, upload material, create a plan, confirm it and download the film: your first video in five steps.

View Markdown

Go from an API key to your first submitted video in about five minutes: upload material, create a plan, start production, confirm the length, wait, and download the film.

Plan first, then produce#

A plan is free: it checks your request and freezes it. Only starting production from a plan uses your account balance.

So every film takes two calls. First POST /v1/plans and check that the plan is ready. When you are happy with it, POST /v1/videos to start production. Once your material has been read, the video stops and asks you to confirm the film length; production proper starts after you confirm.

Step 1: Get an API key#

  1. Sign in at https://axiomlab.online/login (self-serve sign-up is open via Google or e-mail verification code; no invite code required).
  2. Open Developers → Overview → API keys and create a key. It is shown only once, so copy it straight away.
  3. Put it in an environment variable. Every example below uses it:
export AZIMO_API_KEY="your-api-key"

Send it on every request as Authorization: Bearer $AZIMO_API_KEY. Keep it out of your source code and your repository.

Step 2: Walk through it with curl#

Upload a file (required). Except for the person card, every video needs at least one file: PDF, PPTX, DOCX, PNG, JPG, JPEG, WEBP, MP4 or MOV. A plan takes at most 10 files, each up to 50 MB and 200 MB in total.

curl -s https://axiomlab.online/v1/assets \
  -H "Authorization: Bearer $AZIMO_API_KEY" \
  -H "Idempotency-Key: upload-brief-001" \
  -F "file=@brief.pdf"

The id in the response is the asset id, for example "id": "744c8c43aa494843".

Create a plan. In the prompt, say what the film is about, who will watch it and what they should do afterwards. Films are 16:9 landscape (1920×1080) and 30–180 seconds long.

curl -s https://axiomlab.online/v1/plans \
  -H "Authorization: Bearer $AZIMO_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: kettle-plan-001" \
  -d '{
    "prompt": "A 30-second product film for people who travel for work and stay in hotels: the Pliva Fold Kettle folds flat into a laptop bag, boils two cups at a time, and viewers should search for it in the official store.",
    "assets": ["744c8c43aa494843"],
    "options": {"workflow": "explainer", "duration_max": 30}
  }'

duration_max is only checked against the supported range when you plan; the final length is decided in the confirmation step below.

Check the plan. You can only produce a plan whose data.status is ready. If it is needs_input, data.requirements explains what is missing or unsupported (for example materials_required means there is no file, unsupported_aspect_ratio means the format is not supported); fix the request and create a new plan.

{"id": "0bb27ba1d9d84b1a", "data": {"status": "ready", "requirements": [], "request": {"prompt": "…", "options": {"…": "…"}}}}

Start production. Send only the plan id. This is the step that uses your balance. It returns 202 and a video id.

curl -s https://axiomlab.online/v1/videos \
  -H "Authorization: Bearer $AZIMO_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: kettle-video-001" \
  -d '{"plan_id": "0bb27ba1d9d84b1a"}'

Wait, then confirm the length. Check every 10 seconds or so:

curl -s https://axiomlab.online/v1/videos/b6bf4689035d474f \
  -H "Authorization: Bearer $AZIMO_API_KEY"

Once your material has been read (usually a few minutes), the video stops at needs_input and result.input_required suggests a length:

{"code": "confirm_duration", "suggested_duration_sec": 45, "min_duration_sec": 30, "max_duration_sec": 180, "expires_at": "…"}

Answer with the suggested length, or any whole number of seconds in the range:

curl -s https://axiomlab.online/v1/videos/b6bf4689035d474f/resume \
  -H "Authorization: Bearer $AZIMO_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: kettle-length-001" \
  -d '{"duration_sec": 45}'

Confirm before expires_at (about 7 days): a video left unconfirmed is cancelled automatically (cancelled); if the analysis has already expired when you confirm, the video ends as failed. Neither costs anything. After you confirm, the video goes back to queued and running; keep checking until it settles on one of these:

StatusMeaningWhat to do
completeThe film has been deliveredDownload it
needs_inputWaiting for your length confirmation, or pausedRead result.input_required.code; see Advanced usage
failed / cancelledProduction failed or was cancelled; neither is chargedRead error

Download. Once the video is complete, result.files holds signed download links: film is the MP4 (subtitles are usually burned in) and cover is a still image. The links work without your key:

curl -L -o film.mp4 "<the link in result.files.film>"

Links expire. If one has expired, fetch the video again to get fresh links.

Two good habits#

  • Send an idempotency key on every write, and keep it. Put your own value in the Idempotency-Key header. If a request times out, retry with the same key and you get the original result instead of a second film. A plan starts one production only: submitting the same plan again, with any key, returns the original video. Create a new plan for another film.
  • A timeout is not a failure. Check the video's status before you submit anything again.

Pricing and balance#

Production uses your account balance, kept in HKD. Plans and material analysis are free, and each video is charged only once it is delivered: a video that fails or is cancelled costs nothing, and production never asks you to pay more along the way. See Pricing for current self-serve rates and top-up options (or contact sales@axiomlab.online for enterprise volume).

Next steps#