Turn any idea into a video, from code
Generate narrated whiteboard explainer videos programmatically. Send a topic, script, PDF, or image and get back an MP4 with AI voiceover and captions — in 13 languages, landscape or vertical. Billing is credit-based: 1 credit = 1 minute, 2-credit minimum.
Overview
The Ankon AI API is a small, predictable REST interface. You create a job, poll it until it finishes, then download the rendered video and supplementary files (captions, storyboard). Everything is credit-metered, so you only pay for the minutes you render.
Authentication
Two methods are supported. OAuth 2.1 is the easiest path for Claude-native clients; API keys cover everything else.
OAuth 2.1 (Claude Code, Claude.ai, Claude Desktop)
These clients are pre-registered, so no API key is required — the user authorizes Ankon AI and calls the API on their behalf.
API key (all other clients)
Send your key as a bearer token. Cursor, GitHub Copilot, and standalone scripts currently use API keys:
Authorization: Bearer <ANKON_API_KEY>Quickstart
Three steps: create a job, poll until it completes, then download the files.
- 1
POST /api/jobs/with your payload. - 2Poll the job status until it reports complete.
- 3Download the MP4 and captions from the returned URLs.
import os, requests
API = "https://ankonai.com/api"
KEY = os.environ["ANKON_API_KEY"]
# 1. Create a video job
job = requests.post(
f"{API}/jobs/",
headers={"Authorization": f"Bearer {KEY}"},
json={
"topic_or_script": "How compound interest quietly builds wealth",
"duration_minutes": 2,
"language": "en",
"orientation": "landscape",
},
).json()
job_id = job["id"]
# 2. Poll until the job finishes
while True:
status = requests.get(
f"{API}/jobs/{job_id}",
headers={"Authorization": f"Bearer {KEY}"},
).json()
if status["state"] in ("complete", "failed"):
break
time.sleep(5)
# 3. Download the MP4 + captions
print(status["video_url"], status["captions_url"])import { Ankon } from "ankonai";
const ankon = new Ankon({ apiKey: process.env.ANKON_API_KEY });
// 1. Create a video job
const job = await ankon.jobs.create({
topicOrScript: "How compound interest quietly builds wealth",
durationMinutes: 2,
language: "en",
orientation: "landscape",
});
// 2. Wait for completion (built-in polling)
const result = await ankon.jobs.wait(job.id);
// 3. Download the MP4 + captions
console.log(result.videoUrl, result.captionsUrl);Payload reference
| Field | Type | Description |
|---|---|---|
| topic_or_script | string | A topic to research or a full script to animate. Required. |
| duration_minutes | int | Target length: 1, 2, 3, or 5 minutes. Minimum 2 credits. |
| language | string | ISO code — en, es, fr, de, it, pt, hi, ja, zh, ko, ar, nl. |
| voice | string | Optional voice id. Defaults to a neutral voice for the language. |
| orientation | string | landscape (16:9) or vertical (9:16). Defaults to landscape. |
| render_mode | string | ink (default whiteboard) or sketch for a lighter style. |
| fact_check | bool | Optional. Surcharge applies; verifies claims before scripting. |
| scene_enhance | bool | Optional. Surcharge applies; richer illustrations per scene. |
Voices & languages
13 languages ship with multiple voices each, and custom voice cloning works cross-lingually — record once and speak in any supported language.
Endpoints
| Method | Path | Description |
|---|---|---|
| POST | /api/jobs/ | Create a video generation job. |
| GET | /api/jobs/{id} | Retrieve a job and its current status. |
| GET | /api/jobs/ | List recent jobs for the authenticated key. |
| POST | /api/estimate | Estimate credit cost for a payload. |
| GET / POST | /api/keys/ | List or rotate API keys. |
| POST | /api/media | Upload a PDF, doc, or reference image. |
Pricing & refunds
Each credit renders one minute of video. Enhanced features (fact-checking, scene enhancement) add a per-job surcharge. If a finished video comes in under the requested length by more than a grace margin, the difference is refunded automatically.
Errors
| Status | Name | When |
|---|---|---|
| 401 | Unauthorized | Missing or invalid API key / expired OAuth token. |
| 402 | Payment required | Insufficient credits for the requested length or surcharges. |
| 422 | Unprocessable | Invalid payload — check duration, language, or render_mode. |
| 429 | Too many requests | Rate limit exceeded; back off and retry. |
| 404 | Not found | Job id does not exist or belongs to another key. |
| 409 | Conflict | Job already finalized; no further updates accepted. |