ars0n API
Generate UGC video ads programmatically: an AI creator presents your app, product, service, food, or apparel on camera. Pick a creator, upload your product images or clips, review the script and its exact price, and get a finished video back. Or make TikTok/Instagram slideshows: hook, slides, caption and an MP4, styled like the most-saved viral posts. Same engine as the dashboard, fully accessible via REST.
Getting Started
Create an account
Sign up at /signup, then log in to the dashboard
Create an API key
Dashboard → Settings → API → Create Key
Set env variables
ARS0N_API_BASE_URL + ARS0N_API_KEY
Make your first call
POST to /api/v1/ugc/plan (free)
Environment Setup
# Add to your .env file:
ARS0N_API_BASE_URL=https://ars0n.ai
ARS0N_API_KEY=sk_live_... # from Dashboard → Settings → APIThe Pipeline
ars0n makes UGC video ads: an AI creator (identity-locked, speaking in their own cloned voice) presents your app, product, service, food, or apparel to camera, with optional b-roll cutaways, a floating product card, and phone-in-hand app demos. You pick the creator, get the script and its exact price, start the generation, and poll until the video is ready.
UGC Ad Pipeline
The first four steps are your API calls; the rest run on our side while you poll. A plain 15-second talking-head ad costs 51 credits, and the exact price of any configuration comes back from POST /api/v1/ugc/plan before anything is charged.
Quick Start
Generate a UGC ad in 5 API calls:
Step 1: Check your balance
curl $ARS0N_API_BASE_URL/api/v1/credits \
-H "Authorization: Bearer $ARS0N_API_KEY"
# → { "balance": 1100, "tier": "starter", "activeGenerations": 0, ... }Step 2: Pick a creator
curl "$ARS0N_API_BASE_URL/api/v1/actors?limit=20" \
-H "Authorization: Bearer $ARS0N_API_KEY"
# → { "avatars": [{ "avatarId": "jake", "name": "Jake", "settingCount": 70,
# "portraits": [{ "actorId": "3f6c1a52-...", "setting": "kitchen", "portraitUrl": "https://..." }] }],
# "total": 116, "limit": 20, "offset": 0, "hasMore": true }Step 3: Get the script and the exact price (no credits)
curl -X POST $ARS0N_API_BASE_URL/api/v1/ugc/plan \
-H "Authorization: Bearer $ARS0N_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"description": "Habit tracker for runners: streaks, training plans, race countdowns",
"ugcType": "app",
"actorId": "3f6c1a52-...",
"layout": "talking_head",
"durationSeconds": 15,
"companyName": "StrideLog"
}'
# → { "plan": { "beats": [...], ... }, "estimatedCredits": 51, "duration": 15, "engine": "lipsync" }Edit any beat's dialogue or caption if you like, then POST the same body plus plan back to this endpoint for a fresh, free quote of the edited script.
Step 4: Generate with the plan and the quoted price
curl -X POST $ARS0N_API_BASE_URL/api/v1/ugc/generate \
-H "Authorization: Bearer $ARS0N_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"description": "Habit tracker for runners: streaks, training plans, race countdowns",
"ugcType": "app",
"actorId": "3f6c1a52-...",
"layout": "talking_head",
"durationSeconds": 15,
"companyName": "StrideLog",
"plan": { ...the plan from step 3... },
"quotedCredits": 51,
"idempotencyKey": "stridelog-launch-001"
}'
# → { "projectId": "...", "versionId": "9b2e7c40-...", "totalCredits": 51, "jobCount": 3, ... }
# If the price moved since your quote, nothing is charged and you get:
# 409 { "error": "...", "code": "PRICE_CHANGED", "newTotal": 54 }
# Re-send the same body with "quotedCredits": 54 to accept the new price.Step 5: Poll until done (required)
# Poll every 10 seconds. This also drives the pipeline forward!
# Without polling, jobs stay in "pending" forever.
curl $ARS0N_API_BASE_URL/api/v1/jobs/9b2e7c40-... \
-H "Authorization: Bearer $ARS0N_API_KEY"
# → { "status": "completed", "progress": 100, "videoUrl": "https://ars0n.ai/api/v1/video?id=..." }Important: Polling is required
The /jobs/{versionId} endpoint doesn't just report status: it actively drives the pipeline forward. You must poll every 10 seconds until the status reaches "completed" or "failed". Without polling, jobs will remain in "pending" indefinitely.
Base URL: All endpoints are prefixed with /api/v1. API credits are deducted upfront when you call /ugc/generate. If a step fails, its credits are automatically refunded. Use /ugc/plan to see the exact cost before committing.
Input Limits
durationSeconds 10-60·imageAssetIds up to 6 images·brollAssetIds up to 3 video clips (90s max each)
Authentication
Every request requires a Bearer token. Keys use the sk_live_ prefix and are scoped to your organization.
Required Environment Variables
ARS0N_API_BASE_URL— Your Arson instance URL (e.g.https://ars0n.ai)ARS0N_API_KEY— Your API key (sk_live_...)
# Set both env vars, then use them in requests:
export ARS0N_API_BASE_URL="https://ars0n.ai"
export ARS0N_API_KEY="sk_live_<your-api-key>"
curl $ARS0N_API_BASE_URL/api/v1/credits \
-H "Authorization: Bearer $ARS0N_API_KEY"
# Every language works the same way:
# Just set the Authorization header to "Bearer <your-key>"import os, requests
BASE = os.environ["ARS0N_API_BASE_URL"]
API_KEY = os.environ["ARS0N_API_KEY"]
resp = requests.get(
f"{BASE}/api/v1/credits",
headers={"Authorization": f"Bearer {API_KEY}"},
)
print(resp.json())const BASE = process.env.ARS0N_API_BASE_URL!;
const API_KEY = process.env.ARS0N_API_KEY!;
const res = await fetch(
`${BASE}/api/v1/credits`,
{
headers: {
Authorization: `Bearer ${API_KEY}`,
},
}
);
console.log(await res.json());Creating Keys
Go to Settings → API
Click "Create Key" and name it (e.g. "Production", "Staging")
Copy the key immediately
The full key is shown only once. We store a SHA-256 hash — the plain key cannot be recovered.
Store as an environment variable
ARS0N_API_KEY=sk_live_... — never hardcode keys in source.
Key Properties
| Format | sk_live_ + 64 hex chars |
| Scope | Organization-level — all members share keys |
| Limit | Unlimited keys per org (use one per environment) |
| Revoke | Instant — revoked keys return 401 immediately |
Security
- Never commit keys to git or include in client-side code
- Rotate periodically — create new, deploy, revoke old
- Use separate keys for dev / staging / production
- Monitor "last used" in the dashboard, revoke idle keys
Endpoints
All endpoints require Bearer authentication. Base path: /api/v1
Real estate, classic commercial and radio ads were retired on 2026-10-14, and the endpoints that made them now answer 410 Gone. See Retired endpoints for their replacements.
versionId vs jobId
A versionId identifies the entire generation (returned by /ugc/generate). A jobId identifies a single step within that generation (e.g. the voiceover or one b-roll clip). Use versionId for /jobs/{versionId} (status polling) and /jobs/{versionId}/cancel. Use jobId for /jobs/{jobId}/retry and /jobs/{jobId}/regenerate.
Pipeline Job Types
UGC ads (via /ugc/generate) create a DAG of jobs: voiceover (the creator's lines in their cloned voice, or your voiceId; a second voiceover carries the lines spoken over a b-roll cutaway) and, for layouts that put your product in the shot, image_composition (composites your product or app screen into the creator's portrait) → talking_head (the lip-synced, actor-locked on-camera performance).
A generated b-roll cutaway adds image_composition (the cutaway's keyframe) → video_synthesis (the b-roll clip). Your own clips in brollAssetIds are used as-is instead. Everything ends in one compositing job that assembles the talking head, b-roll, captions and CTA banner into the final video.
actor_portrait (generating a brand-new creator portrait that every talking head is conditioned on) only appears when a run creates a fresh creator; generations from a library actorId never include it. Versions of retired ad kinds (classic commercials, real estate, radio) may still show other job types in their history, such as audio_compositing or processing.
UGC Ads (AI Actors)
UGC ads are creator-style talking-head videos: a library AI actor (identity-locked, with their own cloned voice) presents your app, product, service, food, or apparel to camera, with optional b-roll, a floating product card, and phone-in-hand app demos. This is the same pipeline the dashboard assistant uses.
Workflow
1. GET /v1/actors: pick an avatar + background (each portrait has its own actorId). 2. POST /v1/ugc/plan: get the editable script and the exact price (nothing charged). 3. POST /v1/ugc/generate: pass the (optionally edited) plan plus quotedCredits to start; a 409 PRICE_CHANGED means the price moved, so re-send with its newTotal. 4. Poll GET /v1/jobs/{versionId} every 10 seconds until completed (polling drives the pipeline).
/api/v1/actorsList the actor library: system avatars (available to every account) plus any custom actors on your organization. Avatars are grouped by identity with one portrait per background/setting; use the portrait's actorId in the UGC endpoints. Each avatar has a default cloned voice, so voiceId is optional.
The library holds over a hundred creators in dozens of settings each, so the default response is a paged cover list: one cover portrait per avatar plus its settingCount. Fetch every setting of one creator with ?avatarId=.
Query Parameters (all optional)
limit: avatars per page, 1-500 (default 100)offset: default 0avatarId: every portrait of one creator, returned as{ avatar, total }(404 for an unknown avatar). Takes precedence over the othersall:truereturns every avatar with every portrait in one (large) responsesigned:falseskips signing and returnsportraitUrl: null, for picking an actorId from the catalogue without images (e.g.all=true&signed=false)
Response
// GET /api/v1/actors?limit=20 (cover list: one portrait per avatar)
{
"avatars": [
{
"avatarId": "jake",
"name": "Jake",
"gender": "male",
"ageRange": "20s",
"ethnicity": "white",
"defaultVoiceId": "O4MibTBw7Z25BKBEb5N0",
"portraits": [
{ "actorId": "a1b2c3d4-...", "setting": "kitchen", "portraitUrl": "https://..." }
],
"settingCount": 70
}
],
"total": 116, // avatars, not portraits
"limit": 20,
"offset": 0,
"hasMore": true
}
// GET /api/v1/actors?avatarId=jake (every setting of one creator)
{
"avatar": {
"avatarId": "jake",
"name": "Jake",
...,
"portraits": [
{ "actorId": "a1b2c3d4-...", "setting": "kitchen", "portraitUrl": "https://..." },
{ "actorId": "e5f6a7b8-...", "setting": "car", "portraitUrl": "https://..." }
]
},
"total": 70
}/api/v1/ugc/planNo credits deductedGenerate the editable ad script (beats with dialogue, captions, b-roll prompts) and the exact credit price for the run. This is also the way to estimate a cost: nothing is charged. If you edit the returned plan, POST it back here as plan (with the same other fields) to re-price the edited script for free, then pass it to /ugc/generate with quotedCredits set to the latest estimatedCredits; edits that move a price bucket otherwise 409.
Request Body
| Field | Type | Req | Description |
|---|---|---|---|
| description | string | Required | What you're advertising and the angle (1-2000 chars) |
| ugcType | string | Required | "app" | "product" | "service" | "food" | "apparel" | "otherugc" |
| actorId | string | Required | A portrait's actorId from /v1/actors (picks avatar + background) |
| voiceId | string | Optional | Voice ID. Defaults to the avatar's own cloned voice (recommended: keeps lip-sync + identity consistent). Override with a voice_id from /v1/voices |
| durationSeconds | number | Optional | 10-60. Default 15 (30 when b-roll clips are attached). 10s is the cheapest "hook" SKU. Longer scripts move the talking-head price bucket (see Credits) |
| layout | string | Optional | Ad format: "talking_head" (default, pure talking head) | "handheld_demo" (talk → first-person phone-in-hand demo) | "holding_phone" (beta) | "phone_demo" (creator collapses to a corner bubble; your screens/recording play in a big phone mockup) | "app_bg_corner" (same family, screens/recording fill the frame) | "pointing_up" | "product_in_hand" | "wearing". Unknown or unreleased layouts are rejected with 400. Layouts are also validated against ugcType: talking_head and pointing_up fit every topic; handheld_demo/holding_phone/phone_demo/app_bg_corner are app-only; product_in_hand is for product/food/apparel/otherugc; wearing is for apparel/product/otherugc; service accepts only talking_head and pointing_up. A mismatch is rejected with 400 { code: "LAYOUT_TOPIC_MISMATCH" } naming the allowed layouts. Every layout except "talking_head" renders your product on screen and therefore requires imageAssetIds. NOTE: omitting layout is not identical to sending "talking_head": with an image attached, the default composites the product into the talking shot; explicit "talking_head" never composites. |
| imageAssetIds | string[] | Optional | Up to 6 product/app IMAGE assets from /v1/assets. REQUIRED for every layout except "talking_head" and the screen layouts: the others composite, mock up or cut away to your image, so omitting it is rejected with 400 { code: "IMAGE_REQUIRED" } before any credits are deducted. Ids referencing audio/video assets are rejected with the same code. Screen layouts (app_bg_corner, phone_demo) cycle the images as full-frame screens and need at least 2 (3-5 look best) OR a screen-recording clip in brollAssetIds (a clip alone fully satisfies them, playing as the screen content), otherwise 400 { code: "MORE_IMAGES_REQUIRED" }. A plan whose beats carry no spoken dialogue at all is rejected with 400 { code: "SCRIPT_EMPTY" }, and an actor whose portrait is no longer available with 400 { code: "ACTOR_UNAVAILABLE" }, all before any charge |
| brollAssetIds | string[] | Optional | Up to 3 of your own VIDEO clips (upload via /v1/assets; non-video ids are rejected with 400 { code: "BROLL_NOT_VIDEO" }). How the FIRST clip is used depends on the layout: handheld_demo/holding_phone play it inside a phone mockup as the demo beat; app_bg_corner/phone_demo play it as the screen content; product_in_hand/talking_head cut away to it full-frame. pointing_up never uses clips. Clips beyond the first are currently unused. |
| includeBroll | boolean | Optional | Controls the b-roll cutaway. Omitted: the ad cuts away only when you attach an image or clip (to that image or clip). true: also cuts away when nothing is attached, using a text-to-video shot generated from the script, which will not show your actual product. false: a pure talking-head ad with no cutaway. Ignored by corner-card/screen layouts (pointing_up, app_bg_corner, phone_demo), which never use b-roll, and by "handheld_demo", where the cutaway IS the layout's second beat, so false is ignored rather than silently producing a plain talking head under that layout's name. |
| cornerCardPosition | string | Optional | Where the floating product card pops in: "top-left" | "top-right" (default) | "top-center" | "middle-left" | "middle-right" | "bottom-left" | "bottom-right" | "bottom-center". For pointing_up the card is always coerced to a TOP placement (the creator physically points at it); for product_in_hand the card only appears when a SECOND image is attached (imageAssetIds[1]; the first is composited into the creator's hand). |
| cornerCardTilt | boolean | Optional | Slight polaroid tilt on the product card. Default true; false = straight |
| aspectRatio | string | Optional | "9:16" (default, TikTok/Reels) or "16:9" (YouTube) |
| quality | string | Optional | "standard" (default) | "premium". Applies to generated b-roll: premium renders at higher fidelity and costs more credits. |
| companyName | string | Optional | Brand/product name for the script and CTA (max 100) |
| wearableKind | string | Optional | Apparel only. Where the item is worn: "clothing" | "hat" | "glasses" | "jewelry" | "shoes" | "watch" | "bag". Strongly recommended for ugcType "apparel": it decides placement (hat on the head, shoes on the feet). Omitted = the model infers it. |
| ctaText | string | Optional | CTA end-card text, e.g. "Link in bio" (max 80) |
| ctaSubtext | string | Optional | CTA banner subtext under the headline (max 80). Default "Link in bio" |
| ctaUrl | string | Optional | Destination link: your App Store page or site (https, max 300). Rendered ON the video as a scannable QR code in the final seconds, so viewers can act on the ad |
| ctaLinkStyle | string | Optional | How the link appears on the video: "qr" (scannable code, the default) or "link" (the URL written out) |
Response
{
"plan": {
"actor": { "description": "...", "setting": "kitchen", "voice_style": "...", ... },
"beats": [
{ "type": "talking_head", "dialogue": "I was today years old when...", "caption": "...", "duration_seconds": 6 },
{ "type": "product_broll", "broll_prompt": "...", "caption": "...", "duration_seconds": 8 },
{ "type": "cta", "dialogue": "...", "caption": "Link in bio", "duration_seconds": 4 }
],
"hook_variations": [ { "id": "...", "hook_dialogue": "...", "angle": "curiosity" } ],
"music_mood": "..."
},
"estimatedCredits": 90, // exact price; pass it to /ugc/generate as quotedCredits
"duration": 30,
"engine": "lipsync"
}/api/v1/ugc/generateDeducts API creditsStart the UGC generation. Takes the exact same fields as /ugc/plan plus the fields below. Omit plan to let the AI script it in one call (a fresh script, so the price is only known from the response). Returns a versionId: poll GET /v1/jobs/{versionId} until it completes. Credits for failed steps are refunded automatically.
Additional Fields
| Field | Type | Req | Description |
|---|---|---|---|
| plan | object | Optional | The (optionally edited) plan from /v1/ugc/plan. All text in a client-supplied plan is screened against our content policy: a violating plan is rejected with a 400. To re-quote an EDITED plan without charging, pass it back to /v1/ugc/plan (which also accepts plan) and use the fresh estimatedCredits as quotedCredits |
| idempotencyKey | string | Optional | 8-128 chars, your own unique value per intended generation. Retrying a timed-out request with the SAME key returns the original run ({ versionId, replayed: true, status }) instead of charging and generating twice. If that original run FAILED, replays return it with status: "failed"; use a NEW key to generate again. Strongly recommended for SDK/queue callers with automatic retries |
| quotedCredits | number | Optional | The estimatedCredits you were shown. Required whenever a plan is submitted (400 without it). If script edits move the price above this, the request returns 409 PRICE_CHANGED with the new total instead of silently charging more |
| ctaAccentColor | string | Optional | CTA banner accent color as a 6-digit hex, e.g. "#7C5CFF". Defaults to the house red. Also accepted by /ugc/plan |
| workspaceId | string | Optional | A workspace id from GET /v1/workspaces. The new project is filed into that workspace. A workspace that is not your organization's returns 404 { "error": "Workspace not found" } before any credits are charged. The voiceover also applies the workspace's saved pronunciations |
Response
{
"projectId": "proj_abc123",
"versionId": "ver_def456", // Poll GET /v1/jobs/{versionId}
"totalCredits": 90,
"jobCount": 5,
"duration": 30,
"engine": "lipsync"
}
// 409 when an edited plan changed the price:
// { "error": "...", "code": "PRICE_CHANGED", "newTotal": 147 }
// 503 when talking-head video is temporarily unavailable (nothing charged;
// also returned by /ugc/plan). Wait Retry-After seconds and send it again:
// { "error": "...", "code": "provider_capacity", "retryAfterSeconds": 300 }Full Example
# 1. Pick an avatar
curl $ARS0N_API_BASE_URL/api/v1/actors \
-H "Authorization: Bearer $ARS0N_API_KEY"
# 2. Script + price (nothing charged)
curl -X POST $ARS0N_API_BASE_URL/api/v1/ugc/plan \
-H "Authorization: Bearer $ARS0N_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"description": "FORGE pre-workout: clean energy, no crash, mixes instantly",
"ugcType": "product",
"actorId": "<actorId from /v1/actors>",
"layout": "product_in_hand",
"imageAssetIds": ["<assetId from /v1/assets>"],
"durationSeconds": 30,
"cornerCardPosition": "top-right",
"ctaText": "Link in bio"
}'
# → { "plan": {...}, "estimatedCredits": 90, ... }
# 3. Generate (same body + plan + quotedCredits)
curl -X POST $ARS0N_API_BASE_URL/api/v1/ugc/generate \
-H "Authorization: Bearer $ARS0N_API_KEY" \
-H "Content-Type: application/json" \
-d '{ ...same fields..., "plan": <edited plan>, "quotedCredits": 90 }'
# → { "versionId": "ver_...", "totalCredits": 90, ... }
# → or 409 { "code": "PRICE_CHANGED", "newTotal": 97 }: re-send with "quotedCredits": 97
# 4. Poll until completed (polling drives the pipeline)
curl $ARS0N_API_BASE_URL/api/v1/jobs/ver_... \
-H "Authorization: Bearer $ARS0N_API_KEY"
# → { "status": "completed", "videoUrl": "https://..." }Slideshows (TikTok photo posts, Instagram carousels)
A slideshow is 4 to 10 JPEG slides styled exactly like the most-saved viral slideshows (TikTok Sans and Source Serif at the in-app sizes, the six measured text styles, platform safe zones), with a story-style caption, up to 5 hashtags and a 9:16 MP4 of the same slides for YouTube Shorts. We write the hook and the slides, generate a realistic lifestyle photo for each one, and put your product in the second half of the post with its App Store or shop card and “link in bio”. Your product is the only one a slideshow names: other brands, apps, books or people never appear unless your brief names them.
Workflow
1. POST /v1/slideshows with a brief (and your App Store, Etsy or website link): credits are deducted and you get 202 with a slideshowId. 2. Poll GET /v1/slideshows/{id} every 10 to 30 seconds; polling drives the work. A 6-slide post is usually ready in 2 to 4 minutes. 3. When status is ready, download each imageUrl and the videoUrl. 4. Optional: POST /v1/slideshows/{id}/edit to change text or the style and re-render.
/api/v1/slideshowsStart a slideshow. Requires a paid API tier. Answers 202 { data: { slideshowId, status: "queued" } }. A workspace outside your organization is a 404 before anything is charged. Sending the same idempotencyKey again returns the original slideshow instead of charging twice.
| Field | Type | Required | Description |
|---|---|---|---|
| workspaceId | uuid | Optional | File the slideshow and its files into this workspace (GET /v1/workspaces). |
| brief | string (1-2000) | Required | What the product is, who it is for, and the angle. |
| structure | enum | Optional | listicle (default), howto, recommendations, pov, problem_solution. |
| styleId | enum | Optional | tt-classic-plain, tt-small-left, tt-outline, tt-white-box, tt-dark-box, serif-card. Defaults per structure (recommendations use serif-card, POV tt-outline). |
| aspect | "9:16" | "4:5" | Optional | Default 9:16 (1080x1920). 4:5 is 1080x1350 for Instagram; its MP4 is still 9:16. |
| slideCount | integer 4-10 | Optional | Default 6, the median of posts over 100K views. |
| productAssetIds | uuid[] (max 6) | Optional | Your uploaded product photos (POST /v1/assets). Physical products appear in the reveal photo; real app screens appear in a phone frame on POV reveal slides. |
| appStoreUrl | string | Optional | Your App Store listing: its icon, name, subtitle and rating make the App Store card. |
| productUrl | string | Optional | Etsy shop or listing, or website: the shop or site card (and product photos when the page allows it). |
| imageMode | "auto" | "real" | Optional | Default auto. real: every item slide shows one of your productAssetIds (app screens in a phone frame, product photos full screen), and each slide's text is written for the image it shows. Generated photos are used only for the hook and pure mood slides, never for your product. |
| hook | string (3-140) | Optional | Slide 1's words, used as given (only the casing follows the text style). The rest of the post is written to follow it. Without it, ars0n writes its own hook. |
| idempotencyKey | string (8-128) | Optional | Replay guard for retries. |
curl -X POST "$ARS0N_API_BASE_URL/api/v1/slideshows" \
-H "Authorization: Bearer $ARS0N_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"workspaceId": "11111111-2222-4333-8444-555555555555",
"brief": "AI weight tracker: say what you ate and it logs it. For people who quit calorie counting.",
"structure": "listicle",
"appStoreUrl": "https://apps.apple.com/us/app/id6757830772",
"idempotencyKey": "post-2026-10-14-001"
}'
# 202
{ "data": { "slideshowId": "8d6c2f1e-4b1a-4c55-9f0e-2a7d1b3c4e5f", "status": "queued" } }Errors: 400 validation, content policy (CONTENT_POLICY) or an App Store link that matches no app (APP_NOT_FOUND, checked before anything is charged), 402 not enough API credits (required, available), 403 free tier, project limit or product images that are not yours, 404 workspace, 429 rate limit or CONCURRENCY_LIMIT (an in-flight slideshow counts as one active generation), 503 moderation unavailable (retry).
/api/v1/slideshows/{id}Status, slides and video. Polling also advances processing. status is queued, rendering, ready or failed. imageUrl and videoUrl are absolute ars0n URLs that redirect (with your API key) to signed downloads valid for 2 hours; slides are JPEG, the video a 9:16 H.264 MP4 without audio (each slide on screen long enough to read: words / 2.5 per second + 1.5 s, at least 3.5 s, the hook at least 3 s, at most 9 s, crossfaded, 60 s at most). imageUrl is null until a slide is rendered and videoUrl until the slideshow is ready. Each slide's text separates the heading from the body with a blank line. On failed, credits for the steps that did not run are refunded and error says what happened. If only the MP4 fails, the slideshow is ready with videoUrl: null and the video credit is refunded. Another organization's id is a 404.
{
"data": {
"id": "8d6c2f1e-4b1a-4c55-9f0e-2a7d1b3c4e5f",
"status": "ready",
"aspect": "9:16",
"styleId": "tt-classic-plain",
"structure": "listicle",
"caption": "here are 5 lazy habits that actually stuck after years of dieting...",
"hashtags": ["healthyhabits", "intuitiveeating", "glowup"],
"slides": [
{
"index": 0,
"text": "5 lazy habits that ACTUALLY helped me\n\n(from someone who quit tracking macros 4 times)",
"imageUrl": "https://ars0n.ai/api/v1/video?id=1f0c...",
"width": 1080,
"height": 1920
}
],
"videoUrl": "https://ars0n.ai/api/v1/video?id=9a2b...",
"error": null,
"progress": 100,
"projectId": "c3e1...",
"createdAt": "2026-10-14T09:12:00.000Z"
}
}/api/v1/slideshows/{id}/editChange slide text and/or switch the style, then every slide and the MP4 are re-rendered on the same photos. Answers 202 { data: { slideshowId, status: "rendering" } }; poll as above. Costs the render and video credits (2 by default). New text is moderated. 409 SLIDESHOW_BUSY while it is still rendering. Same gates as creating one: a paid API tier (403), another organization's id is a 404 before anything is charged, the re-render counts against your concurrency (429 CONCURRENCY_LIMIT), and 402 when credits are short.
| Field | Type | Required | Description |
|---|---|---|---|
| slides | [{ index, text }] (max 10) | Optional | Zero-based slide index and its full new text (blank line between heading and body). |
| styleId | enum | Optional | Any of the six style ids. |
curl -X POST "$ARS0N_API_BASE_URL/api/v1/slideshows/$SLIDESHOW_ID/edit" \
-H "Authorization: Bearer $ARS0N_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "slides": [{ "index": 0, "text": "5 habits that ACTUALLY stuck\n\n(from a serial quitter)" }], "styleId": "tt-white-box" }'/api/v1/slideshows/{id}/videoRebuild only the MP4 of a finished slideshow from its rendered slides, with the current per-slide timing. The slides themselves do not change. No body; answers 202 and you poll as above. Internal organizations only (403 NOT_AVAILABLE otherwise); 409 while it is rendering.
/api/v1/jobs/{versionId}Critical: Polling drives the pipeline
This endpoint doesn't just report status: it actively advances pending jobs. Without polling, API-created jobs will sit in "pending" forever. You must poll every 10 seconds until the version reaches a terminal state.
Poll generation progress. Call every 10 seconds until status is "completed" or "failed". When completed, videoUrl holds the final video.
videoUrl is an absolute URL pointing at GET /api/v1/video, which requires your Authorization: Bearer header, so putting it directly in a browser <video src> tag returns a 401. Fetch the URL from your backend with the header set: the endpoint answers with a 302 redirect to a short-lived signed URL (valid 2 hours), which you can follow server-side or hand to your client player.
{
"versionId": "9b2e7c40-...",
"adFormat": "video", // always "video" for UGC ads
"status": "generating", // "generating" | "completed" | "failed"
"progress": 33, // 0-100
"videoUrl": null, // the final video once completed
"audioUrl": null, // always null for UGC ads
"totalCredits": 51,
"jobs": {
"total": 3,
"completed": 1,
"failed": 0,
"details": [
{
"id": "c1d2e3f4-...",
"type": "voiceover",
"status": "completed", // "waiting" | "pending" | "processing" | "polling" | "completed" | "failed"
"error_message": null, // string when failed, null otherwise
"output_asset_id": "a9b8c7d6-...",
"params": { "text": "Okay, I finally found a running app that...", "voice_id": "O4MibTBw7Z25BKBEb5N0" },
"depends_on": [],
"credit_cost": 4, // present when the row carries it (queued jobs too)
"assetUrl": "https://ars0n.ai/api/v1/video?id=a9b8c7d6-..."
},
{
"id": "f5e6d7c8-...",
"type": "talking_head",
"status": "waiting", // waiting for its dependencies to complete
"error_message": null,
"output_asset_id": null,
"params": { "aspect_ratio": "9:16", "duration": 15 },
"depends_on": ["c1d2e3f4-..."],
"credit_cost": 38,
"assetUrl": null
}
]
}
}Job statuses: waiting: waiting for its dependencies to complete before it can start. pending: ready to be picked up on the next poll. processing: actively running. polling: submitted to an external provider, awaiting result. completed / failed: terminal states.
Legacy radio versions: radio ads were retired on 2026-10-14, but radio versions you generated before then can still be polled here. They report adFormat: "radio", carry the finished audio in audioUrl, and have videoUrl: null. A legacy version of any retired kind that was still generating is stopped when polled, and its unfinished steps are refunded.
/api/v1/creditsCheck your API credit balance, current tier, and active generation count.
Partner accounts with unlimited API credits receive balance: null and unlimited: true.
{
"balance": 450, // null when unlimited is true
"unlimited": false, // true for partner accounts with unlimited API credits
"tier": "starter",
"activeGenerations": 1, // distinct in-flight pipelines
"limits": {
"maxConcurrentGenerations": 1,
"rateLimitRpm": 60
}
}/api/v1/assetsUpload images, audio, or video clips as multipart form data. Use the returned assetId of an image in imageAssetIds and of a video clip in brollAssetIds on the UGC endpoints (audio uploads are stored, but no UGC field uses them). Images and video frames are screened against our content policy before they are stored: a violating upload is rejected with a 400 and nothing is saved.
Images
PNG, JPEG, WebP, max 10MB
Audio
MP3, WAV, OGG, AAC, M4A, max 15MB
Video
MP4, WebM, MOV, max 100MB
Form Fields
filerequired: the file to uploadcategoryoptional: "product_image" | "logo" | "music" | "clip", a label shown in your asset library (inferred from MIME type if omitted; any other value is rejected with a 400)workspaceIdoptional: files the asset into one of your workspaces (see GET /v1/workspaces). A workspace outside your organization returns 404 before anything is uploaded
{
"assetId": "asset_abc123", // Use in imageAssetIds (images) or brollAssetIds (clips)
"type": "image", // "image", "audio", or "video"
"url": "https://...",
"durationSeconds": null // Set for video clips (post-transcode duration)
}Video Clip Processing
Uploaded video clips are automatically transcoded server-side to 720p H.264 at 30fps with audio stripped. This ensures compatibility with the compositing pipeline. Pass the returned assetId in brollAssetIds when calling /api/v1/ugc/plan and /api/v1/ugc/generate. Maximum clip duration: 90 seconds. Maximum file size: 100MB.
/api/v1/voicesBrowse the voice library. Every creator already speaks in their own cloned voice; to override it, pass a voice_id from the response as voiceId to /ugc/plan and /ugc/generate. Also use it with /preview-voice.
Query Parameters (all optional)
gender: "male", "female"accent: "american", "british", "australian", etc.age: "young", "middle_aged", "old"q: free-text search across name and description
{
"voices": [
{
"voice_id": "pNInz6obpgDQGcFmaJgB",
"name": "Adam",
"gender": "male",
"accent": "american",
"age": "middle_aged",
"description": "Deep, warm, authoritative voice",
"preview_url": "https://ars0n.ai/api/voice-sample?voiceId=pNInz6obpgDQGcFmaJgB",
"use_case": "narration",
"category": "premade"
}
]
}/api/v1/preview-voiceDeducts 3 creditsGenerate a TTS voice preview, for example of a line from your UGC script. Returns a temporary audio URL (1hr expiry) and its duration. Costs 3 credits per preview.
Request Body
| Field | Type | Req | Description |
|---|---|---|---|
| text | string | Required | Text to synthesize (max 1500 chars) |
| voiceId | string | Required | A voice_id from /v1/voices, or a creator's defaultVoiceId from /v1/actors (hear how a script line sounds in that creator's voice) |
Response
{
"audioUrl": "https://...",
"durationSeconds": 12.4
}/api/v1/jobs/{jobId}/retryRetry a failed job. Resets it to pending so it will be re-processed on the next poll. Only works on jobs with status: "failed". Each job has a configurable retry limit (default 2); returns 400 if exhausted. Retrying a job in a failed version re-deducts that job's credit cost plus the cost of its downstream jobs when the earlier attempt was refunded or was cancelled while already running (an in-flight cancellation is never refunded, so its re-run is a new charge), and returns 402 if your balance is insufficient.
Jobs of a retired ad kind (real estate, classic commercial or radio) cannot be retried: the request answers 410 with code: "AD_KIND_RETIRED" before anything is charged. Generate a new UGC ad instead.
{
"job": {
"id": "job_abc123",
"type": "video_synthesis",
"status": "pending",
"retry_count": 2
}
}/api/v1/jobs/{jobId}/regenerateDeducts API creditsRe-roll a generated b-roll cutaway in a UGC ad. Resets that clip's image_composition keyframe (when it has one), its video_synthesis job and the final compositing job, and deducts only those. Only works on video_synthesis jobs with status: "completed" that were created through the API (any other job type is a 400; a dashboard-created clip is a 409). Much cheaper than a full re-generation. Poll GET /jobs/{versionId} again afterwards.
Jobs of a retired ad kind answer 410 with code: "AD_KIND_RETIRED" before any charge.
{
"cost": 105, // API credits deducted (keyframe 10 + 8s b-roll clip 86 + compositing 9)
"jobsReset": [ // Jobs that were reset to pending
"nb_job_id",
"video_job_id",
"comp_job_id"
]
}/api/v1/video?id={assetId}Retrieve a video, audio, or image asset. Returns a 302 redirect to a signed URL valid for 2 hours; it never streams bytes itself. The assetUrl from job details already points here.
Like every v1 endpoint, the request must carry your Authorization: Bearer header, so this URL cannot be used as a bare <video src> in a browser (it would 401). Call it from your backend and either follow the redirect there or pass the signed URL to your player. The signed URL is served by the storage host, which handles Range requests for seeking. Assets are scoped to your organization: you cannot access other orgs' assets.
/api/v1/projectsList your API-created projects with their latest version status. Paginated. Each project includes its most recent version with current status, output URLs, and credit cost.
Query Parameters
limit: 1-100 (default 20)offset: default 0
Response
{
"projects": [
{
"id": "proj_abc123",
"name": "Habit tracker for runners: streaks, training plans, race countdowns",
"thumbnailUrl": null,
"createdAt": "2026-03-24T15:51:01Z",
"latestVersion": {
"id": "ver_def456",
"status": "completed", // "generating" | "completed" | "failed"
"adFormat": "video", // "radio" only on legacy radio versions
"videoUrl": "https://...", // Set when the ad completes
"audioUrl": null, // Set only on legacy radio versions
"totalCredits": 140
}
}
],
"pagination": {
"limit": 20,
"offset": 0,
"count": 5
}
}/api/v1/workspacesList your organization's workspaces: per-brand or per-app folders for uploads and generated videos. Each includes its saved video defaults (reusable creative inputs: website, company name, description, CTA, and pronunciations: how the voiceover should say a brand spelling, such as { "Trayce": "trace" }; captions keep the written spelling) and content counts. assetCount counts uploaded assets; videoCount counts projects filed into the workspace. Pass a workspace id as workspaceId to POST /v1/ugc/generate to file the new video there.
Response
{
"data": {
"workspaces": [
{
"id": "8f0c…",
"name": "My App",
"description": "Habit tracker for runners",
"accentColor": "#f97316",
"videoDefaults": {
"sourceUrl": "https://myapp.com/",
"companyName": "My App",
"ctaText": "Download free",
"pronunciations": { "MyApp": "my app" }
},
"assetCount": 12,
"videoCount": 30
}
]
}
}/api/v1/workspaces/{workspaceId}One workspace plus its uploaded assets (newest 100). Asset ids can be passed straight to imageAssetIds / brollAssetIds; each url is a GET /v1/video link (send your API key; it redirects to a 2-hour signed URL). Returns 404 for a workspace that is not your organization's.
Response
{
"data": {
"workspace": { ...same fields as the list... },
"assets": [
{
"id": "3b1d…",
"type": "image", // "image" | "video" | "audio"
"name": "app-screenshot.png",
"mimeType": "image/png",
"durationSeconds": null, // set for video/audio
"url": "https://<your-ars0n-host>/api/v1/video?id=3b1d…"
}
]
}
}/api/v1/usageReturns aggregate API credit usage for your organization. Excludes failed generations. Useful for billing reconciliation.
Query Parameters
| Field | Type | Req | Description |
|---|---|---|---|
| from | string | Optional | ISO 8601 start date. Default: 30 days ago. |
| to | string | Optional | ISO 8601 end date. Default: now. |
Response
{
"period": {
"from": "2026-02-21T00:00:00Z",
"to": "2026-03-23T00:00:00Z"
},
"tier": "starter", // current API tier
"cost_cents": 1312, // total USD spent (in cents) during period
"rate_per_credit": 0.0354545455, // USD per credit at your tier
"credits": {
"used": 370,
"purchased": 2000,
"refunded": 10
},
"generations": {
"total": 5,
"completed": 4,
"generating": 1,
"projects": 3
}
}/api/v1/jobs/{versionId}/cancelPartial credit refundCancel an in-progress generation. Marks all pending and processing jobs as failed, and refunds credits for jobs that hadn't started yet. Only works on versions with status: "generating".
{
"cancelled": true,
"jobsCancelled": 4,
"creditsRefunded": 72
}/api/v1/projects/{projectId}Delete a project and all its versions and jobs. Cannot delete a project with active ("generating") versions: cancel them first. The id may be either the projectId or a versionId from the /ugc/generate response; a version id resolves to its parent project.
{ "deleted": true }/api/v1/assets/{assetId}Delete an uploaded asset. Removes the file from storage and the database record. Cannot delete assets referenced by active (pending/processing) generation jobs.
{ "deleted": true }Retired endpoints
Real estate listing tours, classic multi-scene commercials and radio (audio-only) ads were retired on 2026-10-14. The endpoints that created or edited them no longer do any work: each one answers 410 Gone naming its replacement, without reading the request or charging anything.
| Retired | Use instead |
|---|---|
| POST /api/v1/generate | POST /api/v1/ugc/generate |
| POST /api/v1/plan | POST /api/v1/ugc/plan |
| POST /api/v1/estimate | POST /api/v1/ugc/plan (it returns the exact credit cost and charges nothing) |
| POST /api/v1/versions/{id}/edit | POST /api/v1/ugc/plan then POST /api/v1/ugc/generate (a new version) |
Response (410)
{
"error": "This endpoint was removed on 2026-10-14 together with real estate, commercial and radio ads. ars0n now makes UGC video ads: use POST /api/v1/ugc/generate instead.",
"code": "ENDPOINT_RETIRED",
"replacement": "POST /api/v1/ugc/generate",
"docs": "https://ars0n.ai/docs"
}Ads you already made with a retired kind still exist: GET /jobs/{versionId}, GET /projects and GET /video keep serving them. Re-running any of their jobs is refused instead: POST /jobs/{jobId}/retry and POST /jobs/{jobId}/regenerate answer 410 before any charge:
{
"error": "Real estate, commercial and radio ads have been retired. Existing ads can still be played and downloaded, but they can no longer be retried, edited or regenerated. Create a UGC ad instead.",
"code": "AD_KIND_RETIRED"
}Credits
API calls consume API credits, a separate balance from your dashboard credits.
A credit is a fixed unit of provider cost, so each operation is priced in proportion to what it actually consumes: a second of lip-sync is cheap, a second of generated b-roll video is not. Short ads are therefore substantially cheaper, and a balance goes further the shorter your ads are.
Check Your Balance
curl $ARS0N_API_BASE_URL/api/v1/credits \
-H "Authorization: Bearer $ARS0N_API_KEY"
# → {
# "balance": 1100,
# "tier": "starter",
# "activeGenerations": 1,
# "limits": { "maxConcurrentGenerations": 1, "rateLimitRpm": 60 }
# }Estimate Before You Generate
POST /api/v1/ugc/plan returns the exact credit cost of the ad you describe, as estimatedCredits, together with its script. No credits are deducted. Treat this as the source of truth: the tables below are illustrative. Pass the number to /ugc/generate as quotedCredits so you are never charged more than you were quoted.
curl -X POST $ARS0N_API_BASE_URL/api/v1/ugc/plan \
-H "Authorization: Bearer $ARS0N_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"description": "Habit tracker for runners: streaks, training plans, race countdowns",
"ugcType": "app",
"actorId": "<actorId from /v1/actors>",
"layout": "talking_head",
"durationSeconds": 15
}'
# → { "plan": {...}, "estimatedCredits": 51, "duration": 15, "engine": "lipsync" }Cost Per Operation
Credits are deducted upfront when you call /ugc/generate. The response tells you exactly what was charged (totalCredits), and credits for any step that fails are refunded automatically.
| Step | Credits | Per |
|---|---|---|
| UGC talking head (10s) | 25 | Per ad: lip-synced actor speech |
| UGC talking head (15s) | 38 | Per ad |
| UGC talking head (30s) | 76 | Per ad |
| UGC talking head (60s) | 151 | Per ad |
| Voiceover | 4 / 5 / 10 | Per ad: 15s / 30s / 60s |
| Video compositing | 9-27 | Scales with length: 30s=9 / 60s=15 / 90s=21 / 120s=27 |
| Image editing (1 variant) | 10 | Per b-roll keyframe |
| Image editing (2 variants) | 19 | Per product composite into the talking shot (scored, best picked) |
| B-roll video: standard | 43 / 65 / 86 | Per generated clip: 4s / 6s / 8s |
| B-roll video: premium | 115 / 173 / 230 | Per generated clip: 4s / 6s / 8s |
| AI creator portrait | 10 | One-time per custom avatar |
| Slideshow script | 3 | Per slideshow: hook, slides, caption, hashtags |
| Slideshow photo | 10 | Per generated photo (unused photos are refunded) |
| Slideshow render + video | 1 + 1 | Per slideshow, and per edit re-render |
UGC ad: talking_head[duration] + voiceover[duration] + compositing + Σ(b-roll) + Σ(product composites)
The exact price always comes back from POST /api/v1/ugc/plan as estimatedCredits, and /ugc/generate accepts a quotedCredits guard that returns 409 PRICE_CHANGED rather than charging a price you did not agree to.
Worked Examples
| Ad | Breakdown | Credits |
|---|---|---|
| UGC 10s hook | 25 talking head + 4 voiceover + 9 compositing | 38 |
| UGC 15s ad | 38 + 4 + 9 | 51 |
| UGC 30s ad | 76 + 5 + 9 | 90 |
| UGC 15s + b-roll cutaway | 51 + 10 image edit + 86 generated 8s clip | 147 |
| UGC 15s + your own b-roll clip | 51 (your clip is not generated, so it adds nothing) | 51 |
| Slideshow, 6 slides | 3 script + 6 x 10 photos + 1 render + 1 video | 65 |
| Slideshow, 10 slides | 3 + 10 x 10 + 1 + 1 | 105 |
| Slideshow edit | re-render the slides + video on the same photos | 2 |
Costs vary with duration, layout, b-roll and quality (premium b-roll costs more). Use POST /api/v1/ugc/plan for exact costs.
Voice Preview
Each voice preview via POST /api/v1/preview-voice costs 3 credits. This generates a real audio file so you can hear and verify the voiceover before committing to full generation.
Your Own B-roll Clips
Video clips you upload and pass in brollAssetIds are not generated, so they skip image and video generation entirely and only the usual compositing applies. This is the cheapest way to add b-roll to a UGC ad: a generated cutaway adds about 96 credits (10 keyframe + 86 for an 8s clip). The phone layouts (handheld_demo, holding_phone) may still generate a short handheld intro shot before your recording plays in the phone.
Credit Expiry
One-time credit packs never expire, API and dashboard packs alike, whether bought on the web or in the iOS app, and neither do bonus credits granted by support. Plan credits expire: a new web subscription's first credits last 30 days, and the credits each renewal grants last until 3 days after the end of that billing period, whether the plan was bought on the web or in the iOS app. Free signup credits are valid for 1 month. Spending always draws from the credits closest to expiring first, so expiring credits are used before ones that last longer.
Rate Limits & Concurrency
Two types of limits protect the system: rate limits (requests per minute) and concurrency limits (parallel video jobs). Both scale with your tier.
Your Limits
Limits depend on your account's API tier. GET /api/v1/credits returns yours as limits.rateLimitRpm and limits.maxConcurrentGenerations, and every response carries the rate limit headers below.
Rate Limit Details
- Window type: Fixed 60-second window per API key (bucket resets each minute)
- Per-key limits: Each API key has its own rate limit counter based on your tier
- Per-org aggregate: Your organization is also limited to 3x your tier RPM across all keys combined (e.g. 60 RPM per key allows 180 RPM across all keys)
- Fail-closed: If the rate limiter is unavailable, requests are denied (not allowed)
Response Headers
Every API response includes rate limit headers. Use them to throttle your client and avoid hitting limits.
# Headers included on every response:
X-RateLimit-Limit: 60 # Your max requests per window
X-RateLimit-Remaining: 42 # Requests left in this window
X-RateLimit-Reset: 1711234567 # Unix timestamp when window resets
X-Request-Id: a1b2c3d4-... # Unique ID for debuggingHandling 429 — Rate Limited
Two scenarios return 429:
Too many requests
Wait until X-RateLimit-Reset before retrying.
{ "error": "Rate limit exceeded. Try again later." }Too many concurrent generations
Wait for an active generation to finish. The response tells you the current count. One in-flight pipeline counts as one generation, regardless of how many jobs it spawns.
{
"error": "Concurrency limit reached. Wait for active generations to complete.",
"active": 3,
"max": 3
}Python retry with backoff
import time
def api_call_with_retry(fn, max_retries=3):
for attempt in range(max_retries):
resp = fn()
if resp.status_code != 429:
return resp
reset_at = int(resp.headers.get("X-RateLimit-Reset", 0))
wait = max(reset_at - time.time(), 1)
print(f"Rate limited. Waiting {wait:.0f}s...")
time.sleep(wait)
raise Exception("Max retries exceeded")Errors
All errors follow the same shape. Use the HTTP status code for control flow and the error field for user-facing messages.
{
"error": "Insufficient credits: 100 required but only 45 available",
"details": { ... }, // Present on validation errors (400)
"code": "..." // A stable machine code, e.g. "PRICE_CHANGED", "ENDPOINT_RETIRED", or "provider_unavailable" on 500s
}Status Codes
| Code | When | Fix |
|---|---|---|
| 200 | Success | Process the response |
| 201 | Resource created (asset upload) | Use the returned assetId |
| 400 | Invalid request body or params, including cancelling a version whose status is not "generating" | Check details for field errors |
| 401 | Missing, invalid, or revoked key | Check your Authorization header |
| 402 | Insufficient API credits | Check your balance with GET /v1/credits |
| 403 | Asset not owned by your org, or not available to your account | Verify asset ownership |
| 404 | Resource not found | Check the version / project ID |
| 409 | Conflict: the price changed since your UGC quote (PRICE_CHANGED), or a concurrent cancel already transitioned the version out of "generating" while your cancel was in flight (cancelling a version that was already in a non-generating state returns 400 instead), or a second POST /v1/jobs/:id/retry for the same failed job arrived while the first was resetting it (charged once; the first retry is the one that runs) | Re-confirm with the returned newTotal, or check the current status before retrying |
| 410 | Gone: a retired endpoint (ENDPOINT_RETIRED), or a retry/regenerate of a job from a retired ad kind (AD_KIND_RETIRED) | Move to the replacement named in the body (see Retired endpoints), or create a new UGC ad |
| 429 | Rate or concurrency limit hit | Wait for X-RateLimit-Reset |
| 500 | Server error. Carries a stable code (e.g. provider_unavailable); branch on that, not on the message text | Retry with backoff. Include X-Request-Id in support requests. |
| 503 | Platform at capacity (returned by /v1/ugc/generate), or talking-head video temporarily unavailable (code: "provider_capacity", see below). Nothing is charged | Retry after the Retry-After header (seconds) |
Insufficient Credits (402)
When your API credit balance is too low for the requested generation:
{
"error": "Insufficient API credits",
"required": 140,
"available": 45,
"message": "This generation requires 140 API credits but you only have 45."
}Error Codes
Machine-readable codes returned in the code field alongside error:
| Code | Status | Description |
|---|---|---|
| SCRIPT_TOO_LONG | 400 | Returned by /v1/ugc/plan and /v1/ugc/generate when a script exceeds the 60-second speech budget (~210 words, 2000 characters max). The script is rejected before any credits are charged; it is never silently truncated. The error message states the limit and your script's actual length; shorten the script and retry |
| LAYOUT_TOPIC_MISMATCH, IMAGE_REQUIRED, MORE_IMAGES_REQUIRED, BROLL_NOT_VIDEO, SCRIPT_EMPTY, ACTOR_UNAVAILABLE | 400 | UGC input checks on /v1/ugc/plan and /v1/ugc/generate, all before any charge. See the layout, imageAssetIds and brollAssetIds fields under UGC Ads for when each applies |
| PRICE_CHANGED | 409 | Returned by POST /v1/ugc/generate when the recomputed price is higher than your quotedCredits (your edited plan moved a price bucket, or prices changed). Nothing is charged. The response body includes error, code: "PRICE_CHANGED", and newTotal; re-send with quotedCredits set to the new total to proceed |
| provider_capacity | 503 | Talking-head (lip-sync) video is temporarily unavailable. Returned by POST /v1/ugc/plan, POST /v1/ugc/generate and POST /v1/jobs/:id/retry BEFORE any credit is charged or any work starts. The body is { error, code: "provider_capacity", retryAfterSeconds } with a Retry-After header: wait and send the same request again. A generation that was already queued and cannot finish for the same reason fails with a "temporarily unavailable" job error and its unused credits are refunded automatically |
| ENDPOINT_RETIRED | 410 | Returned by the four endpoints removed on 2026-10-14 (POST /v1/generate, /v1/plan, /v1/estimate, /v1/versions/:id/edit). The body also carries replacement (the endpoint to use instead) and docs (a link to this page) |
| AD_KIND_RETIRED | 410 | Returned by POST /v1/jobs/:id/retry and POST /v1/jobs/:id/regenerate when the job belongs to a real estate, classic commercial or radio version. Nothing is charged. Those ads can still be polled and downloaded; create a UGC ad to make a new one |
Validation Errors (400)
When request validation fails, the details field contains field-level errors:
{
"error": "Validation failed",
"details": {
"fieldErrors": {
"description": ["Description is required"],
"actorId": ["actorId must be an actor UUID from GET /api/v1/actors"]
},
"formErrors": []
}
}Request IDs
Successful and expected-error responses include X-Request-Id. Log it: when something goes wrong, include it in support tickets for instant lookup. Authentication failures and unexpected internal errors may lack the header; include the timestamp and endpoint instead.
resp = requests.post(f"{BASE_URL}/ugc/generate", headers=headers, json=payload)
if not resp.ok:
request_id = resp.headers.get("X-Request-Id")
print(f"Failed: {resp.status_code}, Request ID: {request_id}")
print(resp.json())Full Examples
Complete end-to-end workflows: upload your product, pick a creator, get the script and its price, generate the UGC ad, and download the result; or start a TikTok/Instagram slideshow and download its slides and MP4.
Python: Full UGC Workflow
Upload a product photo, pick a creator and a setting, get the script and its exact price, edit a line and re-quote it, generate with the quoted price (handling a price change), then poll and download.
import os, time, uuid
import requests
API_KEY = os.environ["ARS0N_API_KEY"]
BASE = os.environ["ARS0N_API_BASE_URL"] + "/api/v1"
HEADERS = {"Authorization": f"Bearer {API_KEY}"}
# ── 1. Upload a product photo ────────────────────────────────
with open("product.png", "rb") as f:
resp = requests.post(
f"{BASE}/assets",
headers=HEADERS,
files={"file": ("product.png", f, "image/png")},
data={"category": "product_image"},
)
resp.raise_for_status()
image_id = resp.json()["assetId"]
# ── 2. Pick a creator, then one of their settings ────────────
resp = requests.get(f"{BASE}/actors", headers=HEADERS, params={"limit": 20})
resp.raise_for_status()
avatar = resp.json()["avatars"][0]
resp = requests.get(f"{BASE}/actors", headers=HEADERS,
params={"avatarId": avatar["avatarId"]})
resp.raise_for_status()
portraits = resp.json()["avatar"]["portraits"]
actor_id = next((p["actorId"] for p in portraits if p["setting"] == "kitchen"),
portraits[0]["actorId"])
print(f"Creator: {avatar['name']} ({len(portraits)} settings)")
# ── 3. Script + exact price (nothing charged) ────────────────
ad = {
"description": "FORGE pre-workout: clean energy, no crash, mixes instantly",
"ugcType": "product",
"actorId": actor_id,
"layout": "product_in_hand",
"imageAssetIds": [image_id],
"durationSeconds": 15,
"companyName": "FORGE",
"ctaText": "Try FORGE today",
"ctaUrl": "https://forge.example.com",
}
resp = requests.post(f"{BASE}/ugc/plan", headers=HEADERS, json=ad)
resp.raise_for_status()
quote = resp.json()
print(f"Quoted {quote['estimatedCredits']} credits for {quote['duration']}s")
# ── 4. (Optional) Edit a line, then re-quote for free ────────
plan = quote["plan"]
plan["beats"][0]["dialogue"] = "Okay, this is the only pre-workout I actually finish."
resp = requests.post(f"{BASE}/ugc/plan", headers=HEADERS, json={**ad, "plan": plan})
resp.raise_for_status()
quote = resp.json()
# ── 5. Generate with the plan and the quoted price ───────────
body = {
**ad,
"plan": quote["plan"],
"quotedCredits": quote["estimatedCredits"], # required with a plan
"idempotencyKey": str(uuid.uuid4()), # safe to retry on timeouts
}
resp = requests.post(f"{BASE}/ugc/generate", headers=HEADERS, json=body)
if resp.status_code == 409 and resp.json().get("code") == "PRICE_CHANGED":
# Nothing was charged. Accept the new price (or stop here).
body["quotedCredits"] = resp.json()["newTotal"]
resp = requests.post(f"{BASE}/ugc/generate", headers=HEADERS, json=body)
resp.raise_for_status()
version_id = resp.json()["versionId"]
print(f"Started {version_id}")
# ── 6. Poll every 10s (polling drives the pipeline) ──────────
while True:
resp = requests.get(f"{BASE}/jobs/{version_id}", headers=HEADERS)
resp.raise_for_status()
status = resp.json()
jobs = status["jobs"]
print(f" {status['status']} {status['progress']}% "
f"({jobs['completed']}/{jobs['total']} jobs)")
if status["status"] == "completed":
break
if status["status"] == "failed":
for j in jobs["details"]:
if j["status"] == "failed":
print(f" {j['type']}: {j['error_message']}")
raise SystemExit("Generation failed (failed steps are refunded)")
time.sleep(10)
# ── 7. Download (videoUrl needs your key; it 302s to a signed URL)
video = requests.get(status["videoUrl"], headers=HEADERS)
video.raise_for_status()
with open("forge-ugc.mp4", "wb") as f:
f.write(video.content)
print("Saved forge-ugc.mp4")TypeScript: Full UGC Workflow
The same workflow in Node.js 20+ (built-in fetch and crypto), for an app ad with two screenshots cycling full-frame behind the creator.
import fs from "node:fs";
const API_KEY = process.env.ARS0N_API_KEY!;
const BASE = process.env.ARS0N_API_BASE_URL + "/api/v1";
const headers = { Authorization: `Bearer ${API_KEY}` };
const jsonHeaders = { ...headers, "Content-Type": "application/json" };
interface Quote {
plan: Record<string, unknown>;
estimatedCredits: number;
duration: number;
}
interface VersionStatus {
status: "generating" | "completed" | "failed";
progress: number;
videoUrl: string | null;
}
// ── Helper: upload a file ────────────────────────────────────
async function uploadAsset(filePath: string): Promise<string> {
const form = new FormData();
form.append("file", new Blob([fs.readFileSync(filePath)]), filePath.split("/").pop()!);
const res = await fetch(`${BASE}/assets`, { method: "POST", headers, body: form });
if (!res.ok) throw new Error(`Upload failed: ${await res.text()}`);
return (await res.json()).assetId;
}
// ── Helper: poll until done ──────────────────────────────────
async function pollUntilDone(versionId: string): Promise<VersionStatus> {
while (true) {
const res = await fetch(`${BASE}/jobs/${versionId}`, { headers });
if (!res.ok) throw new Error(await res.text());
const data: VersionStatus = await res.json();
console.log(` ${data.status} ${data.progress}%`);
if (data.status !== "generating") return data;
await new Promise((r) => setTimeout(r, 10_000));
}
}
async function main(): Promise<void> {
// 1. Upload two app screenshots
const screens = [
await uploadAsset("./screen-home.png"),
await uploadAsset("./screen-stats.png"),
];
// 2. Pick a creator (cover list: one portrait per creator)
const actorsRes = await fetch(`${BASE}/actors?limit=20`, { headers });
const { avatars } = await actorsRes.json();
const actorId: string = avatars[0].portraits[0].actorId;
// 3. Script + exact price (nothing charged)
const ad = {
description: "Habit tracker for runners: streaks, training plans, race countdowns",
ugcType: "app",
actorId,
layout: "app_bg_corner", // screens fill the frame, creator in a corner bubble
imageAssetIds: screens,
durationSeconds: 15,
companyName: "StrideLog",
ctaText: "Download free",
};
const planRes = await fetch(`${BASE}/ugc/plan`, {
method: "POST", headers: jsonHeaders, body: JSON.stringify(ad),
});
if (!planRes.ok) throw new Error(await planRes.text());
const quote: Quote = await planRes.json();
console.log(`Quoted ${quote.estimatedCredits} credits`);
// 4. Generate with the quoted price; accept one price change
const body = {
...ad,
plan: quote.plan,
quotedCredits: quote.estimatedCredits,
idempotencyKey: crypto.randomUUID(),
};
let genRes = await fetch(`${BASE}/ugc/generate`, {
method: "POST", headers: jsonHeaders, body: JSON.stringify(body),
});
if (genRes.status === 409) {
const conflict = await genRes.json();
if (conflict.code !== "PRICE_CHANGED") throw new Error(conflict.error);
body.quotedCredits = conflict.newTotal;
genRes = await fetch(`${BASE}/ugc/generate`, {
method: "POST", headers: jsonHeaders, body: JSON.stringify(body),
});
}
if (!genRes.ok) throw new Error(await genRes.text());
const { versionId, totalCredits } = await genRes.json();
console.log(`Started ${versionId} (${totalCredits} credits)`);
// 5. Poll, then download through your backend (the URL needs your key)
const result = await pollUntilDone(versionId);
if (result.status !== "completed" || !result.videoUrl) throw new Error("Generation failed");
const video = await fetch(result.videoUrl, { headers });
fs.writeFileSync("./stridelog-ugc.mp4", Buffer.from(await video.arrayBuffer()));
}
main().catch(console.error);Python: Slideshow for TikTok and Instagram
Start a 6-slide listicle for an App Store app, poll until it is ready, then save the JPEG slides, the MP4 and the caption. The download links are ars0n URLs that redirect to signed storage, so send the API key to ars0n only and let the redirect drop it.
import os, time, uuid
import requests
API_KEY = os.environ["ARS0N_API_KEY"]
BASE = os.environ["ARS0N_API_BASE_URL"] + "/api/v1"
HEADERS = {"Authorization": f"Bearer {API_KEY}"}
resp = requests.post(f"{BASE}/slideshows", headers=HEADERS, json={
"brief": "AI weight tracker: say what you ate and it logs it. "
"For people who quit calorie counting because typing was tedious.",
"structure": "listicle", # howto | recommendations | pov | problem_solution
"appStoreUrl": "https://apps.apple.com/us/app/id6757830772",
"aspect": "9:16", # or "4:5" for Instagram
"slideCount": 6,
"idempotencyKey": str(uuid.uuid4()),
})
resp.raise_for_status() # 202
slideshow_id = resp.json()["data"]["slideshowId"]
while True: # polling drives the work
s = requests.get(f"{BASE}/slideshows/{slideshow_id}", headers=HEADERS).json()["data"]
print(s["status"], s["progress"])
if s["status"] in ("ready", "failed"):
break
time.sleep(15)
if s["status"] == "failed":
raise SystemExit(s["error"])
for slide in s["slides"]:
jpg = requests.get(slide["imageUrl"], headers=HEADERS) # 302 -> signed URL
jpg.raise_for_status()
with open(f"slide-{slide['index'] + 1:02d}.jpg", "wb") as f:
f.write(jpg.content)
if s["videoUrl"]:
with open("slideshow.mp4", "wb") as f:
f.write(requests.get(s["videoUrl"], headers=HEADERS).content)
print(s["caption"], " ".join("#" + h for h in s["hashtags"]))cURL: Full UGC Workflow
Upload a screen recording and use it as the b-roll in an app ad.
# 1. Upload a screen recording (transcoded to 720p, audio stripped, 90s max)
curl -X POST $ARS0N_API_BASE_URL/api/v1/assets \
-H "Authorization: Bearer $ARS0N_API_KEY" \
-F "file=@app-demo.mp4" \
-F "category=clip"
# → { "assetId": "7d1e...", "type": "video", "url": "https://...", "durationSeconds": 12.5 }
# 2. Pick a creator
curl "$ARS0N_API_BASE_URL/api/v1/actors?limit=20" \
-H "Authorization: Bearer $ARS0N_API_KEY"
# → { "avatars": [{ "avatarId": "jake", "portraits": [{ "actorId": "3f6c...", ... }], ... }], ... }
# 3. Script + exact price (nothing charged)
curl -X POST $ARS0N_API_BASE_URL/api/v1/ugc/plan \
-H "Authorization: Bearer $ARS0N_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"description": "StrideLog: the running app that plans your training around race day",
"ugcType": "app",
"actorId": "3f6c...",
"layout": "phone_demo",
"brollAssetIds": ["7d1e..."],
"durationSeconds": 20,
"ctaText": "Download free"
}'
# → { "plan": {...}, "estimatedCredits": ..., "duration": 20, "engine": "lipsync" }
# 4. Generate: same body + "plan" + "quotedCredits"
curl -X POST $ARS0N_API_BASE_URL/api/v1/ugc/generate \
-H "Authorization: Bearer $ARS0N_API_KEY" \
-H "Content-Type: application/json" \
-d @generate-body.json
# → { "projectId": "...", "versionId": "9b2e...", "totalCredits": ..., "jobCount": ... }
# → or 409 { "code": "PRICE_CHANGED", "newTotal": ... }: re-send with that quotedCredits
# 5. Poll every 10 seconds until "completed"
curl $ARS0N_API_BASE_URL/api/v1/jobs/9b2e... \
-H "Authorization: Bearer $ARS0N_API_KEY"
# 6. Download: -L follows the 302 to the signed URL
curl -L -o ad.mp4 "<videoUrl from step 5>" \
-H "Authorization: Bearer $ARS0N_API_KEY"cURL: One-Call Generate
Skip the quote: omit plan and /ugc/generate writes the script itself. You see the price only in the response, so prefer the plan step when cost matters.
curl -X POST $ARS0N_API_BASE_URL/api/v1/ugc/generate \
-H "Authorization: Bearer $ARS0N_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"description": "Neighborhood dog walking, insured walkers, GPS-tracked walks",
"ugcType": "service",
"actorId": "<actorId from /v1/actors>",
"layout": "talking_head",
"durationSeconds": 15,
"aspectRatio": "9:16",
"companyName": "Walkies",
"idempotencyKey": "walkies-launch-001"
}'
# → { "versionId": "...", "totalCredits": 51, "jobCount": 3, "duration": 15, "engine": "lipsync" }cURL: Upload Assets
Upload a product image or app screenshot (for imageAssetIds)
curl -X POST $ARS0N_API_BASE_URL/api/v1/assets \
-H "Authorization: Bearer $ARS0N_API_KEY" \
-F "file=@product-photo.png" \
-F "category=product_image"
# → { "assetId": "abc-123", "type": "image", "url": "https://...", "durationSeconds": null }Upload a video clip into a workspace (for brollAssetIds)
curl -X POST $ARS0N_API_BASE_URL/api/v1/assets \
-H "Authorization: Bearer $ARS0N_API_KEY" \
-F "file=@unboxing.mov" \
-F "category=clip" \
-F "workspaceId=<id from GET /v1/workspaces>"
# → { "assetId": "def-456", "type": "video", "url": "https://...", "durationSeconds": 18 }cURL: Browse Voices
Creators speak in their own cloned voice by default. To use a different voice, pass a voice_id as voiceId to both /ugc/plan and /ugc/generate.
# List all voices
curl $ARS0N_API_BASE_URL/api/v1/voices \
-H "Authorization: Bearer $ARS0N_API_KEY"
# Filter by gender + accent
curl "$ARS0N_API_BASE_URL/api/v1/voices?gender=female&accent=british" \
-H "Authorization: Bearer $ARS0N_API_KEY"
# Search by name or description
curl "$ARS0N_API_BASE_URL/api/v1/voices?q=narrator" \
-H "Authorization: Bearer $ARS0N_API_KEY"
# → { "voices": [{ "voice_id": "abc...", "name": "Charlotte", ... }] }
# Hear a script line in that voice first (3 credits)
curl -X POST $ARS0N_API_BASE_URL/api/v1/preview-voice \
-H "Authorization: Bearer $ARS0N_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "text": "Okay, this is the only pre-workout I actually finish.", "voiceId": "abc..." }'
# → { "audioUrl": "https://...", "durationSeconds": 3.2 }