> ## Knowledge Base Index
> Fetch the complete knowledge base index at: https://help.aituber.app/sitemap.xml
> Use this file to discover available pages before exploring further.
> Pure-Markdown content can be obtained by appending a '.md' suffix to the content URLs listed in the sitemap (without the trailing slash).

# API quickstart

The AITuber API lets your code create, export, and publish videos. The base URL is `https://app.aituber.app/api/v1`. Full interactive docs with every endpoint live in the [API documentation](https://aituber.app/api).

## How do I authenticate?

Create a key on the [API keys page](https://app.aituber.app/dashboard/api-keys) and send it on every request:

```
Authorization: Bearer ak_your_key_here
```

[Create and manage API keys](https://help.aituber.app/en/article/create-and-manage-api-keys-fs45a0/).

## The core loop: create, poll, export, download

**1. Create a video.** Send a topic (`inputType: "idea"`) or your exact narration text (`inputType: "script"`):

```bash
curl -X POST "https://app.aituber.app/api/v1/videos/generate" \
  -H "Authorization: Bearer $AITUBER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "script": "5 facts about black holes", "inputType": "idea", "expectedDurationSeconds": 60 }'
```

The response contains a `videoId`. Generation spends credits, the same amounts as in the dashboard.

**2. Poll until it is done.** Call `GET /videos/{id}` every 30 seconds or so, until `status` is `completed`.

**3. Export to MP4.** Call `POST /exports` with the `videoId`. Export is free, but your workspace needs to have had a paid plan at least once. Rendering usually takes 30 seconds to 5 minutes.

**4. Download.** Poll `GET /videos/{id}` until `exportStatus` is `completed`, then call `GET /exports/download?videoId={id}`. The response contains a signed download URL. The URL expires in 2 minutes, so start the download right away.

## What else can the API do?

Everything the dashboard does: list 1,300+ voices, generate music videos, create standalone AI clips, save elements, and publish finished videos to your connected YouTube, TikTok, Instagram, Facebook, Threads, and X channels. Browse all endpoints in the [API documentation](https://aituber.app/api).

## Is there a rate limit or extra cost?

API calls use the same credits as the dashboard. There is no separate API fee. Check your balance any time with `GET /subscription`.

## Related

- [Create and manage API keys](https://help.aituber.app/en/article/create-and-manage-api-keys-fs45a0/)
- [Use AITuber from Claude and other AI tools](https://help.aituber.app/en/article/use-aituber-from-claude-and-other-ai-tools-mcp-tot4l0/)
- [How credits work](https://help.aituber.app/en/article/how-credits-work-1fj61db/)
