Quickstart
NanoAPI is an asynchronous API for AI video generation. Create a key, submit a task, get the video.
You submit a task, NanoAPI generates the video in the background (usually 10–20 minutes), and you get the result by webhook or by polling. The cost is frozen from your prepaid balance when the task is created, charged when it succeeds and returned in full when it fails.
https://api.nanoapi.ai/v1HTTPS and JSON only. API keys, top-ups and billing history are managed in the console, not through the API.
Get an API key
Create a key in Console → API keys. The full key is shown only once, so store it right away:
export NANOAPI_API_KEY="nf_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"Your available balance must cover the task's cost ($4.095 for a 15-second video at 720p). Top up in the console.
Create a task
Send a source video and a reference image as public URLs. This example uses Genjutsu motion transfer.
curl https://api.nanoapi.ai/v1/genjutsu \
-H "Authorization: Bearer $NANOAPI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "genjutsu-1.0",
"mode": "motion_control",
"image_urls": ["https://example.com/person.png"],
"video_url": "https://example.com/dance.mp4",
"resolution": "720p"
}'The response is 202 Accepted with a queued task; billing.frozen is the amount set aside.
Creating a task reads the source video first, so set your client timeout to 60 seconds or more.
Get the result
Poll GET /v1/tasks/{id} at most once every 15 seconds until status is succeeded or failed.
curl https://api.nanoapi.ai/v1/tasks/tk_01jb8z5q4w3e2r1t0y9u8i7o6p \
-H "Authorization: Bearer $NANOAPI_API_KEY"On success, outputs[0].url is the video. On failure, error.code says why (failure codes) and the frozen amount is back in your balance.
Use webhooks in production
Add a webhook_url when you create the task. NanoAPI posts a task.succeeded or task.failed event with the full task as soon as it finishes, so you don't need to poll. See Webhooks.