API overview

A dedicated HTTP surface so your own systems can create videos, publish posts and read stats without a browser.

What the API covers

Anything you do in the web app can be driven by code: render videos from a script, publish to connected channels, set up news sources that scan on a schedule, run campaigns, upload media, and read performance stats.

The API shares data with your web account. A video created over the API shows up in your video library immediately, and the other way around.

Base URL

Base URL

…/api/v1/public

This path is separate from the endpoints the web app uses. That separation is what keeps your contract stable: a field exposed here was deliberately chosen to be public.

Every path in these pages is relative to that base: GET /videos means GET …/api/v1/public/videos.

Three steps to your first call

  1. 1

    Create an API key

    Go to Settings → API keys, name it and tick the scopes you need. The full key string is shown exactly once.

  2. 2

    Call a read-only endpoint

    curl …/api/v1/public/credits \
      -H "X-Api-Key: viai_sk_..."
  3. 3

    Create your first video

    Get a channel id from GET /channels, then call POST /videos with an idempotency header. See Videos and generation jobs.

Endpoint map

GroupPathUsed for
Videos/videosCreate, render, publish, cancel and read videos
Generation jobs/jobsAsk the model for a script or a storyboard
News sources/sourcesFeeds scanned on a schedule to build videos automatically
Campaigns/campaignsRender and publish on a recurring schedule
Channels/channelsConnected channels and their token health
Media/mediaUpload, list and delete files
Templates/templatesBrand templates to pass when creating a video
Credits/creditsAvailable balance and the part currently held
Analytics/analyticsViews, engagement and a per-video leaderboard

How billing works

  • The API is not a separate paid add-on. Any account with credits can call it.
  • Each operation costs exactly what it costs in the web app — see How credits are calculated.
  • Read-only endpoints are free. Creating videos, queueing generation jobs and running campaigns are not.
  • Channel and storage limits still apply: with no channel slots left, creating a video that targets a new channel is rejected.

What the API deliberately leaves out

A few things stay in the web app on purpose

  • Connecting a social channel. That goes through the platform's own consent screen; there is no way to do it in code.
  • Background music from TikTok's library. Only selectable through TikTok's picker embedded in the web app.
  • Buying plans and topping up credits. These go through the payment and invoicing flow.