Developer Documentation

ars0n API

Generate professional video and radio ads programmatically. Upload images, pick a voice, set your style — get a finished ad back. Same engine as the dashboard, fully accessible via REST.

Getting Started

1

Create an account

Sign up at /signup, then log in to the dashboard

2

Create an API key

Dashboard → Settings → API → Create Key

3

Set env variables

ARS0N_API_BASE_URL + ARS0N_API_KEY

4

Make your first call

POST to /api/v1/generate

Environment Setup

bash
# Add to your .env file:
ARS0N_API_BASE_URL=https://app.ars0n.ai
ARS0N_API_KEY=sk_live_...    # from Dashboard → Settings → API

The Pipeline

The API supports two ad formats. Each follows its own pipeline — you just submit and poll.

Video Ad Pipeline

Upload images
Pick a voice
Submit prompt
AI plans scenes
Image editing
Video generation
Voiceover
Final compositing

Radio Ad Pipeline (audio-only)

Pick a voice
Submit prompt
AI writes script
Voiceover
Audio compositing

Radio ads are audio-only — no images or video needed. Much faster and cheaper (4-8 credits vs ~140+ for video).

Quick Start

Generate a video in 4 API calls:

Step 1 — Check your balance

bash
curl $ARS0N_API_BASE_URL/api/v1/credits \
  -H "Authorization: Bearer $ARS0N_API_KEY"
# → { "balance": 500, "tier": "starter", "activeGenerations": 0 }

Step 2 — Find a voice

bash
curl "$ARS0N_API_BASE_URL/api/v1/voices?gender=male&accent=american" \
  -H "Authorization: Bearer $ARS0N_API_KEY"
# → { "voices": [{ "voice_id": "pNInz6obpgDQGcFmaJgB", "name": "Adam", ... }] }

Step 3 — Generate

bash
curl -X POST $ARS0N_API_BASE_URL/api/v1/generate \
  -H "Authorization: Bearer $ARS0N_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "Premium wireless headphones — sleek, modern, lifestyle",
    "imageUrls": ["https://example.com/headphones.png"],
    "duration": 15,
    "voiceId": "pNInz6obpgDQGcFmaJgB",
    "aspectRatio": "9:16"
  }'
# → { "versionId": "abc-123", "totalCredits": 100, "jobCount": 5 }

Step 4 — Poll until done (required)

bash
# 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/abc-123 \
  -H "Authorization: Bearer $ARS0N_API_KEY"
# → { "status": "completed", "progress": 100, "videoUrl": "https://ars0n.ai/api/v1/video?id=..." }

Two-Step Plan Flow

For maximum control, use the two-step flow: generate a plan, preview and edit the script, then generate with your modified plan. This is the recommended approach for production integrations.

Step 1 — Generate a plan (no credits)

bash
curl -X POST $ARS0N_API_BASE_URL/api/v1/plan \
  -H "Authorization: Bearer $ARS0N_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "Premium wireless headphones — sleek, modern, lifestyle",
    "adFormat": "video",
    "duration": 30,
    "voiceId": "pNInz6obpgDQGcFmaJgB",
    "imageAssetIds": ["asset-1", "asset-2"]
  }'
# → { "plan": { "voiceover_script": "...", "scenes": [...] }, "estimatedCredits": 230 }

Step 2 — Preview the voice (optional)

bash
curl -X POST $ARS0N_API_BASE_URL/api/v1/preview-voice \
  -H "Authorization: Bearer $ARS0N_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "text": "Immerse yourself in pure sound.",
    "voiceId": "pNInz6obpgDQGcFmaJgB"
  }'
# → { "audioUrl": "https://...", "durationSeconds": 3.2 }

Step 3 — Edit the script + add custom clips

Modify plan.voiceover_segments, reorder scenes, or insert your own video clips between AI scenes. Upload clips via POST /api/v1/assets (MP4/WebM/MOV, max 100MB, max 30s). Clips are auto-transcoded to 720p with audio stripped. Use the returned assetId in customClips.

Step 4 — Generate with your modified plan

bash
curl -X POST $ARS0N_API_BASE_URL/api/v1/generate \
  -H "Authorization: Bearer $ARS0N_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "Premium wireless headphones",
    "adFormat": "video",
    "duration": 30,
    "voiceId": "pNInz6obpgDQGcFmaJgB",
    "imageAssetIds": ["asset-1", "asset-2"],
    "plan": { "...your edited plan..." },
    "customClips": [{ "position": 2, "asset_id": "clip-id", "voiceover_text": "See it in action.", "duration_seconds": 6 }]
  }'
# → { "versionId": "ver_xyz", "totalCredits": 180, "jobCount": 7 }

Step 5 — Poll until done

bash
curl $ARS0N_API_BASE_URL/api/v1/jobs/ver_xyz \
  -H "Authorization: Bearer $ARS0N_API_KEY"
# → { "status": "completed", "progress": 100, "videoUrl": "https://..." }

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 /generate. If generation fails, credits are automatically refunded. Use /estimate to preview costs before committing.

Image Limits by Duration

15s → max 3 images·30s → max 5 images·60s → max 9 images

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://app.ars0n.ai)
  • ARS0N_API_KEY — Your API key (sk_live_...)
bash
# Set both env vars, then use them in requests:
export ARS0N_API_BASE_URL="https://app.ars0n.ai"
export ARS0N_API_KEY="sk_live_a1b2c3d4e5f6..."

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>"
python
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())
typescript
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

1

Go to Settings → API

Click "Create Key" and name it (e.g. "Production", "Staging")

2

Copy the key immediately

The full key is shown only once. We store a SHA-256 hash — the plain key cannot be recovered.

3

Store as an environment variable

ARS0N_API_KEY=sk_live_... — never hardcode keys in source.

Key Properties

Formatsk_live_ + 64 hex chars
ScopeOrganization-level — all members share keys
LimitUnlimited keys per org (use one per environment)
RevokeInstant — 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

versionId vs jobId

A versionId identifies the entire generation (returned by /generate). A jobIdidentifies a single step within that generation (e.g. one scene's image edit or video render). Use versionId for /jobs/{versionId} (status polling) and /jobs/{versionId}/cancel. Use jobId for /jobs/{jobId}/retry and /jobs/{jobId}/regenerate.

Pipeline Job Types

Video ads create a DAG of jobs: nanobanana_edit (AI image editing, 2 variants scored per scene) → video_generation (Veo image-to-video per scene) + voiceover (ElevenLabs TTS) → compositing (Remotion final assembly).

Radio ads (audio-only) create: voiceover (ElevenLabs TTS) → audio_compositing (mixes voiceover with optional background music — always included for radio ads).

POST/api/v1/generateDeducts API credits

Start a video or radio ad generation pipeline. Provide a prompt, a voice, and optional settings. Video ads also require product images.

Request Body

FieldTypeReqDescription
adFormatstringOptional"video" (default) or "radio". Radio ads are audio-only — no images or video needed.
promptstringRequiredCreative prompt describing your ad (1-2000 chars)
imageUrlsstring[]*Product image URLs. Server downloads them. Required for video ads. Max depends on duration: 3 for 15s, 5 for 30s, 9 for 60s. Not needed for radio ads.
imageAssetIdsstring[]*Pre-uploaded asset IDs from /v1/assets. Same limits as imageUrls. Not needed for radio ads.
durationnumberRequiredAd length: 15, 30, or 60 seconds (applies to both video and radio)
voiceIdstringRequiredVoice ID from /v1/voices
aspectRatiostringOptional"9:16" (default) or "16:9"
veoModelstringOptional"veo-3.1-fast-generate-001" (default) | "veo-3.1-generate-001". Non-fast models produce higher quality but cost more.
logoAssetIdstringOptionalLogo overlay — upload via /v1/assets first. Video ads only.
musicAssetIdstringOptionalBackground music — upload MP3/WAV via /v1/assets. For radio ads, mixed with voiceover during audio compositing.
musicVolumenumberOptionalBackground music volume (0.0-1.0, default 0.3). Applied during compositing for both video and radio.
companyNamestringOptionalCompany name shown in CTA end card (max 100)
ctaDesignstringOptional"minimal" | "bold" | "gradient" | "split" | "glass" | "neon" | "editorial" | "brutalist"
gradientColorstringOptionalHex color for gradient CTA (#FF5500)
voiceStylestringOptionalHint for AI voice direction (max 200). Applies to both video and radio ads.
musicMoodstringOptionalHint for AI music selection (max 200). Applies to both video and radio ads.
tonestringOptionalCreative tone — "luxury", "playful", "corporate" (max 200). Applies to both video and radio ads.
editStylestringOptionalImage editing direction applied to every scene (max 1000). Guides both the AI scene planner and image editor. E.g. "place all screenshots on realistic iPhone screens held by people in lifestyle settings"
emotionstringOptionalEmotion style for animation and voiceover (max 200). Applies to both video and radio ads.
qualityLoopVariants1 | 2 | 3OptionalImage edit variants per scene. Default 2. Use 3 for max quality. Cost per scene scales: 5 / 10 / 15 credits for 1 / 2 / 3 variants.
planobjectOptionalPre-generated plan from /v1/plan. Skips AI scene planning and uses your edited script and scenes directly. Backwards compatible — omit to let the AI plan automatically.
customClipsobject[]OptionalCustom video clips to insert between AI-generated scenes. Each clip: { position, asset_id, voiceover_text?, duration_seconds }. Max 10 clips. Upload videos via /v1/assets first.

* Either imageUrls or imageAssetIds is required for video ads (not both). Radio ads do not require images.

Response

json
{
  "projectId": "proj_abc123",
  "versionId": "ver_def456",   // Use this to poll status
  "totalCredits": 115,
  "jobCount": 6
}
GET/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".

Both videoUrl and audioUrl are always present in the response. For video ads, videoUrl contains the final video and audioUrl is null. For radio ads, audioUrl contains the final audio and videoUrl is null. Both are absolute URLs you can use directly in your app.

json
{
  "versionId": "ver_def456",
  "adFormat": "video",           // "video" or "radio"
  "status": "generating",       // "generating" | "completed" | "failed"
  "progress": 60,               // 0-100
  "videoUrl": null,              // Set for video ads when completed
  "audioUrl": null,              // Set for radio ads when completed
  "totalCredits": 115,
  "jobs": {
    "total": 6,
    "completed": 3,
    "failed": 0,
    "details": [
      {
        "id": "job_abc",
        "job_type": "nanobanana_edit",
        "status": "completed",  // "waiting" | "pending" | "processing" | "polling" | "completed" | "failed"
        "output_asset_id": "asset_123",
        "assetUrl": "https://ars0n.ai/api/v1/video?id=asset_123",
        "error_message": null,  // string when failed, null otherwise
        "input_params": { "scene_index": 0 },
        "depends_on": []
      },
      {
        "id": "job_def",
        "job_type": "video_generation",
        "status": "waiting",    // waiting for dependencies (job_abc) to complete
        "output_asset_id": null,
        "assetUrl": null,
        "error_message": null,
        "input_params": { "scene_index": 0 },
        "depends_on": ["job_abc"]
      }
    ]
  }
}

Job statuses: waiting — job is 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.

GET/api/v1/credits

Check your API credit balance, current tier, and active generation count.

Partner accounts with unlimited API credits receive balance: null and unlimited: true.

json
{
  "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
  }
}
POST/api/v1/assets

Upload images or audio as multipart form data. Use the returned assetId in generate calls.

Images

PNG, JPEG, WebP — max 10MB

Audio

MP3, WAV, OGG, AAC, M4A — max 15MB

Video

MP4, WebM, MOV — max 100MB

Form Fields

  • file required — The file to upload
  • category optional "product_image" | "logo" | "music" (inferred from MIME type if omitted)
json
{
  "assetId": "asset_abc123",    // Use in imageAssetIds, logoAssetId, etc.
  "type": "image",              // "image", "audio", or "video"
  "publicUrl": "https://..."
}

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 Remotion Lambda compositing pipeline. The returned assetId can be used in customClips when calling /api/v1/generate. Maximum clip duration: 30 seconds. Maximum file size: 100MB.

GET/api/v1/voices

Browse the voice library. Use the voice_id from the response as your voiceId in generate calls.

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
json
{
  "voices": [
    {
      "voice_id": "pNInz6obpgDQGcFmaJgB",
      "name": "Adam",
      "gender": "male",
      "accent": "american",
      "age": "middle_aged",
      "description": "Deep, warm, authoritative voice",
      "preview_url": "https://...",
      "use_case": "narration",
      "category": "premade"
    }
  ]
}
POST/api/v1/plan

Generate a creative plan without starting the pipeline. No credits deducted. Returns the plan, cost estimate, and breakdown.

Request Body

FieldTypeReqDescription
promptstringRequiredCreative prompt describing your ad (1-2000 chars)
adFormatstringOptional"video" (default) or "radio"
durationnumberOptionalAd length: 15, 30, or 60 seconds
voiceIdstringRequiredVoice ID from /v1/voices
aspectRatiostringOptional"9:16" (default) or "16:9"
veoModelstringOptionalVideo model. See /generate for valid values.
imageAssetIdsstring[]OptionalPre-uploaded asset IDs from /v1/assets
companyNamestringOptionalCompany name shown in CTA end card (max 100)
ctaDesignstringOptionalCTA design style. See /generate for valid values.
gradientColorstringOptionalHex color for gradient CTA (#FF5500)
editStylestringOptionalImage editing direction applied to every scene (max 1000)
musicAssetIdstringOptionalBackground music asset ID
musicVolumenumberOptionalBackground music volume (0.0-1.0, default 0.3)
logoAssetIdstringOptionalLogo overlay asset ID

Response

json
{
  "plan": {
    "voiceover_script": "Immerse yourself in pure sound...",
    "voiceover_segments": [
      { "text": "Immerse yourself in pure sound.", "scene_index": 0 }
    ],
    "scenes": [
      { "scene_index": 0, "description": "Product hero shot", "duration_seconds": 6 }
    ],
    "music_mood": "upbeat electronic",
    "voice_style": "energetic and confident"
  },
  "estimatedCredits": 230,
  "breakdown": [
    { "operation": "nanobanana_edit", "credits": 10 },
    { "operation": "video_generation", "credits": 35 },
    { "operation": "voiceover", "credits": 3 },
    { "operation": "compositing", "credits": 2 }
  ],
  "jobCount": 8,
  "sceneCount": 5,
  "estimatedDurationSeconds": 30
}
POST/api/v1/preview-voiceDeducts 3 credits

Generate a TTS voice preview. Returns a temporary audio URL (1hr expiry) and exact duration. Costs 3 credits per preview.

Request Body

FieldTypeReqDescription
textstringRequiredText to synthesize (max 5000 chars)
voiceIdstringRequiredVoice ID from /v1/voices

Response

json
{
  "audioUrl": "https://...",
  "durationSeconds": 12.4
}
POST/api/v1/jobs/{jobId}/retry

Retry 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. No additional credits are charged for retries.

json
{
  "job": {
    "id": "job_abc123",
    "job_type": "video_generation",
    "status": "pending",
    "retry_count": 2
  }
}
POST/api/v1/jobs/{jobId}/regenerateDeducts API credits

Regenerate a single completed scene. Resets the image edit, video generation, and compositing jobs for that scene. Only works on video_generation jobs with status: "completed". Much cheaper than a full re-generation.

json
{
  "cost": 47,                    // API credits deducted
  "jobsReset": [                 // Jobs that were reset to pending
    "nb_job_id",
    "veo_job_id",
    "comp_job_id"
  ]
}
POST/api/v1/versions/{versionId}/editDeducts API credits (only for re-generated jobs)

Edit an existing completed version. Creates a new version with smart regeneration — only changed components are re-processed. Unchanged Veo clips are reused at no cost.

Request Body

FieldTypeReqDescription
planobjectOptionalModified plan object. Only changed scenes and voiceover segments trigger re-generation.
customClipsobject[]OptionalCustom video clips: [{ position, asset_id, voiceover_text?, duration_seconds }]. Max 10 clips.

Response

json
{
  "projectId": "proj_abc123",
  "versionId": "ver_new789",
  "reusedJobs": ["job_veo_1", "job_veo_3"],
  "newJobs": ["job_voiceover", "job_compositing"],
  "estimatedCredits": 5
}
GET/api/v1/video?id={assetId}

Retrieve a video, audio, or image asset. Returns a 302 redirect to a signed URL valid for 2 hours. Use the assetUrl from job details directly — it already points here.

Supports Rangeheaders for video seeking. Assets are scoped to your organization — you cannot access other orgs' assets.

GET/api/v1/projects

List 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

json
{
  "projects": [
    {
      "id": "proj_abc123",
      "name": "Product launch video ad",
      "thumbnailUrl": null,
      "createdAt": "2026-03-24T15:51:01Z",
      "latestVersion": {
        "id": "ver_def456",
        "status": "completed",       // "generating" | "completed" | "failed"
        "adFormat": "video",          // "video" or "radio"
        "videoUrl": "https://...",    // Set when video ad completes
        "audioUrl": null,             // Set when radio ad completes
        "totalCredits": 140
      }
    }
  ],
  "pagination": {
    "limit": 20,
    "offset": 0,
    "count": 5
  }
}
GET/api/v1/packages

List available API credit packages and their prices. Use the id to purchase in the dashboard.

json
{
  "packages": [
    { "id": "...", "name": "API Starter", "credits": 500, "priceCents": 3900, "priceDisplay": "$39", "popular": false },
    { "id": "...", "name": "API Growth",  "credits": 2000, "priceCents": 11900, "priceDisplay": "$119", "popular": true },
    { "id": "...", "name": "API Scale",   "credits": 5500, "priceCents": 29900, "priceDisplay": "$299", "popular": false }
  ]
}
GET/api/v1/usage

Returns aggregate API credit usage for your organization. Excludes failed generations. Useful for billing reconciliation.

Query Parameters

FieldTypeReqDescription
fromstringOptionalISO 8601 start date. Default: 30 days ago.
tostringOptionalISO 8601 end date. Default: now.

Response

json
{
  "period": {
    "from": "2026-02-21T00:00:00Z",
    "to": "2026-03-23T00:00:00Z"
  },
  "tier": "starter",             // current API tier
  "cost_cents": 11900,           // total USD spent (in cents) during period
  "credits": {
    "used": 370,
    "purchased": 2000,
    "refunded": 10
  },
  "generations": {
    "total": 5,
    "completed": 4,
    "generating": 1,
    "projects": 3
  }
}
POST/api/v1/estimate

Estimate the credit cost of a generation before committing. No credits are deducted.

Request Body

FieldTypeReqDescription
adFormatstringOptional"video" (default) or "radio". Radio ads cost significantly less.
imageCountnumberOptionalNumber of product images (1-10). Required for video ads. Not needed for radio.
durationnumberRequiredAd length: 15, 30, or 60 seconds
aspectRatiostringOptional"9:16" (default) or "16:9". Video ads only.
veoModelstringOptionalVideo model (affects cost). See /generate for valid values. Video ads only.
qualityLoopVariants1 | 2 | 3OptionalImage edit variants per scene. Default 2. Video ads only. Cost scales: 5 / 10 / 15 credits per scene for 1 / 2 / 3 variants.
customClipsCountintegerOptionalNumber of custom video clips. Custom clips skip NanoBanana + Veo.
hasMusicbooleanOptionalWhether background music will be included (radio ads only). Does not affect the estimated cost — audio compositing is always included.

Video Estimate Example

json
// Request: { "adFormat": "video", "imageCount": 3, "duration": 15 }
// Response:
{
  "adFormat": "video",
  "estimatedCredits": 140,
  "breakdown": [
    { "operation": "nanobanana_edit", "credits": 10 },
    { "operation": "nanobanana_edit", "credits": 10 },
    { "operation": "nanobanana_edit", "credits": 10 },
    { "operation": "video_generation", "credits": 35 },
    { "operation": "video_generation", "credits": 35 },
    { "operation": "video_generation", "credits": 35 },
    { "operation": "voiceover", "credits": 3 },
    { "operation": "compositing", "credits": 2 }
  ],
  "jobCount": 8,
  "sceneCount": 3
}

Radio Estimate Example

json
// Request: { "adFormat": "radio", "duration": 30 }
// Response:
{
  "adFormat": "radio",
  "estimatedCredits": 5,
  "breakdown": [
    { "operation": "voiceover", "credits": 3 },
    { "operation": "audio_compositing", "credits": 2 }
  ],
  "jobCount": 2,
  "sceneCount": 0
}
POST/api/v1/jobs/{versionId}/cancelPartial credit refund

Cancel 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".

json
{
  "cancelled": true,
  "jobsCancelled": 4,
  "creditsRefunded": 72
}
DELETE/api/v1/projects/{projectId}

Delete a project and all its versions and jobs. Cannot delete a project with active ("generating") versions — cancel them first.

json
{ "deleted": true }
DELETE/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.

json
{ "deleted": true }

Credits & Pricing

API calls consume API credits — a separate balance from your dashboard credits. Purchase packages in Settings or view them at /pricing.

Check Your Balance

bash
curl $ARS0N_API_BASE_URL/api/v1/credits \
  -H "Authorization: Bearer $ARS0N_API_KEY"

# → {
#   "balance": 450,
#   "tier": "starter",
#   "activeGenerations": 1,
#   "limits": { "maxConcurrentGenerations": 1, "rateLimitRpm": 60 }
# }

Estimate Before You Generate

Use POST /api/v1/estimate to preview the exact credit cost before committing. No credits are deducted.

bash
# Video estimate
curl -X POST $ARS0N_API_BASE_URL/api/v1/estimate \
  -H "Authorization: Bearer $ARS0N_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "adFormat": "video", "imageCount": 3, "duration": 15 }'

# → { "adFormat": "video", "estimatedCredits": 140, "breakdown": [...], "jobCount": 8, "sceneCount": 3 }

# Radio estimate
curl -X POST $ARS0N_API_BASE_URL/api/v1/estimate \
  -H "Authorization: Bearer $ARS0N_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "adFormat": "radio", "duration": 30 }'

# → { "adFormat": "radio", "estimatedCredits": 5, "breakdown": [...], "jobCount": 2, "sceneCount": 0 }

Cost Per Operation

Credits are deducted upfront when you call /generate. The exact cost depends on scene count. The response tells you what was charged.

StepCreditsPer
Image editing (1 variant)5Per scene
Image editing (2 variants)10Per scene (default — scored, best picked)
Image editing (3 variants)15Per scene (max quality)
Video generation — Fast24 / 35 / 48Per clip — 4s / 6s / 8s (≈6 cr/s)
Video generation — Premium60 / 90 / 120Per clip — 4s / 6s / 8s (15 cr/s)
Voiceover (video 15s)3Per video ad
Voiceover (video 30s)5Per video ad
Voiceover (video 60s)8Per video ad
Voiceover (radio 15s)2Per radio ad
Voiceover (radio 30s)3Per radio ad
Voiceover (radio 60s)6Per radio ad
Video compositing2Per video ad
Audio compositing2Per radio ad

Video ad formula: Σ(editing[variants]) + Σ(video[model, clip_duration]) + voiceover[target_duration] + 2 compositing

Radio ad formula: voiceover (15s→2, 30s→3, 60s→6) + 2 audio compositing

Example: A 15-second video with 3 scenes costs roughly 140 credits (30 editing + 105 video + 3 voiceover + 2 compositing). A 30s radio ad costs 5 credits (3 voiceover + 2 audio compositing). 15s costs 4, 60s costs 8.

DurationMax ImagesTypical ScenesEstimated Credits
15 seconds33~140
30 seconds55~230
60 seconds99~410–455
Radio 15s4
Radio 30s5
Radio 60s8

Use POST /api/v1/estimate for exact costs. Costs may vary with veoModel and qualityLoopVariants settings.

Voice Preview

Each voice preview via POST /api/v1/preview-voice costs 3 credits. This generates a real ElevenLabs TTS audio file so you can hear and verify the voiceover before committing to full generation.

Custom Clips

User-uploaded video clips inserted between AI-generated scenes have no generation cost — they skip NanoBanana and Veo entirely. Only compositing costs apply. Voiceover cost may increase if narration is added for custom clips.

Editing Versions

When editing via POST /versions/{id}/edit, only re-generated jobs are charged. Unchanged Veo clips are reused at no cost. Typical edit cost: 3-5 credits (voiceover + recomposite).

List Packages

bash
curl $ARS0N_API_BASE_URL/api/v1/packages \
  -H "Authorization: Bearer $ARS0N_API_KEY"

# → { "packages": [
#     { "name": "API Starter", "credits": 500,  "priceCents": 3900  },
#     { "name": "API Growth",  "credits": 2000, "priceCents": 11900 },
#     { "name": "API Scale",   "credits": 5500, "priceCents": 29900 }
# ] }

See full pricing details and plan comparison at /pricing →

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.

Tiers

TierRequests/minConcurrent generationsBest For
Free301Testing & prototyping
Starter601Small apps & MVPs
Pro1202Production workloads
Enterprise3003High-volume pipelines

Rate Limit Details

  • Window type: Sliding window (60-second rolling window per API key)
  • 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. Starter: 180 total 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.

bash
# 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 debugging

Handling 429 — Rate Limited

Two scenarios return 429:

Too many requests

Wait until X-RateLimit-Reset before retrying.

json
{ "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.

json
{
  "error": "Concurrency limit reached. Wait for active generations to complete.",
  "active": 3,
  "max": 3
}

Python retry with backoff

python
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.

json
{
  "error": "Insufficient credits: 100 required but only 45 available",
  "details": { ... }  // Present on validation errors (400)
}

Status Codes

CodeWhenFix
200SuccessProcess the response
201Resource created (asset upload)Use the returned assetId
400Invalid request body or paramsCheck details for field errors
401Missing, invalid, or revoked keyCheck your Authorization header
402Insufficient API creditsPurchase more credits at /settings/billing
403Asset not owned by your org, or plan too lowVerify asset ownership or upgrade your plan
404Resource not foundCheck the version / project ID
409Conflict (e.g., cancelling a version that is no longer generating)Check the current status before retrying
429Rate or concurrency limit hitWait for X-RateLimit-Reset
500Server errorRetry with backoff. Include X-Request-Id in support requests.

Insufficient Credits (402)

When your API credit balance is too low for the requested generation:

json
{
  "error": "Insufficient API credits",
  "required": 140,
  "available": 45,
  "message": "This generation requires 140 API credits but you only have 45. Purchase API credits at /settings/billing."
}

Error Codes

Specific error codes returned in the error field for common failure scenarios:

CodeStatusDescription
PLAN_EXPIRED400Plan submitted to generate references stale or missing asset IDs
CLIP_TOO_LONG400Uploaded video clip exceeds 30-second maximum duration
TOO_MANY_CLIPS400More than 10 custom clips in a single video
CLIP_FORMAT_UNSUPPORTED400Video format not supported. Use MP4, WebM, or MOV
CLIP_TOO_LARGE400Video file exceeds 100MB maximum size
VERSION_NOT_EDITABLE409Cannot edit a version that is still generating

Validation Errors (400)

When request validation fails, the details field contains field-level errors:

json
{
  "error": "Validation failed",
  "details": {
    "fieldErrors": {
      "duration": ["Duration must be 15, 30, or 60"],
      "voiceId": ["Required"]
    },
    "formErrors": []
  }
}

Request IDs

Every response includes X-Request-Id. Log it — when something goes wrong, include it in support tickets for instant lookup.

python
resp = requests.post(f"{BASE_URL}/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 assets, find a voice, generate a video, and download the result.

Python — Full Workflow

Upload a product image, pick a voice, generate a video with all customization options, and poll until complete.

python
import requests, time, os

API_KEY = os.environ["ARS0N_API_KEY"]
BASE    = os.environ["ARS0N_API_BASE_URL"] + "/api/v1"
HEADERS = {"Authorization": f"Bearer {API_KEY}"}


# ── 1. Upload product image ──────────────────────────────────
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"]
    print(f"Uploaded image: {image_id}")


# ── 2. Upload logo ───────────────────────────────────────────
with open("logo.png", "rb") as f:
    resp = requests.post(
        f"{BASE}/assets",
        headers=HEADERS,
        files={"file": ("logo.png", f, "image/png")},
        data={"category": "logo"},
    )
    resp.raise_for_status()
    logo_id = resp.json()["assetId"]


# ── 3. Upload background music ───────────────────────────────
with open("bg-music.mp3", "rb") as f:
    resp = requests.post(
        f"{BASE}/assets",
        headers=HEADERS,
        files={"file": ("bg-music.mp3", f, "audio/mpeg")},
        data={"category": "music"},
    )
    resp.raise_for_status()
    music_id = resp.json()["assetId"]


# ── 4. Find a voice ──────────────────────────────────────────
resp = requests.get(
    f"{BASE}/voices",
    headers=HEADERS,
    params={"gender": "female", "accent": "american"},
)
resp.raise_for_status()
voices = resp.json()["voices"]
voice_id = voices[0]["voice_id"]
print(f"Using voice: {voices[0]['name']} ({voice_id})")


# ── 5. Generate video with full options ───────────────────────
resp = requests.post(f"{BASE}/generate", headers={
    **HEADERS, "Content-Type": "application/json",
}, json={
    # Required
    "prompt": "Premium noise-canceling headphones. Sleek design, deep bass.",
    "imageAssetIds": [image_id],
    "duration": 30,
    "voiceId": voice_id,

    # Style
    "aspectRatio": "9:16",
    "ctaDesign": "gradient",
    "gradientColor": "#FF5500",
    "companyName": "SoundWave Audio",
    "logoAssetId": logo_id,
    "musicAssetId": music_id,

    # Creative direction
    "voiceStyle": "energetic and confident",
    "musicMood": "upbeat electronic",
    "tone": "premium luxury tech",
    "emotion": "excitement",
    "editStyle": "Product floating in mid-air with dramatic studio lighting, reflections on glossy surface, cinematic depth of field",

    # Pipeline tuning
    "qualityLoopVariants": 3,  # Max quality — 3 variants per scene (15 credits/scene vs 10 for default 2)
})
resp.raise_for_status()
data = resp.json()
version_id = data["versionId"]
print(f"Generation started: {version_id}")
print(f"Credits charged: {data['totalCredits']}")
print(f"Jobs queued: {data['jobCount']}")


# ── 6. Poll for completion ────────────────────────────────────
while True:
    resp = requests.get(f"{BASE}/jobs/{version_id}", headers=HEADERS)
    resp.raise_for_status()
    status = resp.json()

    pct = status["progress"]
    jobs = status["jobs"]
    print(f"  {status['status']} — {pct}% "
          f"({jobs['completed']}/{jobs['total']} jobs)")

    if status["status"] == "completed":
        print(f"\nVideo ready: {status['videoUrl']}")
        break
    elif status["status"] == "failed":
        print(f"\nFailed. Check job details:")
        for j in jobs["details"]:
            if j["status"] == "failed":
                print(f"  {j['job_type']}: {j['error_message']}")
        break

    time.sleep(10)

TypeScript — Full Workflow

Same workflow in Node.js with proper error handling and typed responses.

typescript
import fs from "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}` };


// ── Helper: upload a file ────────────────────────────────────
async function uploadAsset(
  filePath: string,
  category: string,
): Promise<string> {
  const file = fs.readFileSync(filePath);
  const form = new FormData();
  form.append("file", new Blob([file]), filePath.split("/").pop()!);
  form.append("category", category);

  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<{
  status: string;
  videoUrl: string | null;
}> {
  while (true) {
    const res = await fetch(`${BASE}/jobs/${versionId}`, { headers });
    const data = await res.json();
    console.log(`  ${data.status} — ${data.progress}%`);

    if (data.status === "completed" || data.status === "failed") {
      return data;
    }
    await new Promise((r) => setTimeout(r, 10_000));
  }
}


// ── Main ─────────────────────────────────────────────────────
async function main() {
  // 1. Upload assets
  const imageId = await uploadAsset("./product.png", "product_image");
  const logoId  = await uploadAsset("./logo.png", "logo");
  const musicId = await uploadAsset("./music.mp3", "music");
  console.log("Assets uploaded");

  // 2. Find a voice
  const voicesRes = await fetch(
    `${BASE}/voices?gender=male&q=narrator`,
    { headers },
  );
  const { voices } = await voicesRes.json();
  const voiceId = voices[0].voice_id;
  console.log(`Using voice: ${voices[0].name}`);

  // 3. Generate
  const genRes = await fetch(`${BASE}/generate`, {
    method: "POST",
    headers: { ...headers, "Content-Type": "application/json" },
    body: JSON.stringify({
      prompt: "Premium headphones — immersive sound, modern design",
      imageAssetIds: [imageId],
      duration: 15,
      voiceId,
      aspectRatio: "9:16",
      logoAssetId: logoId,
      musicAssetId: musicId,
      companyName: "SoundWave",
      ctaDesign: "bold",
      tone: "premium tech",
    }),
  });

  if (!genRes.ok) throw new Error(await genRes.text());
  const { versionId, totalCredits } = await genRes.json();
  console.log(`Started (${totalCredits} credits)`);

  // 4. Poll
  const result = await pollUntilDone(versionId);
  if (result.videoUrl) {
    console.log(`Video: ${result.videoUrl}`);
  }
}

main().catch(console.error);

Python — Radio Ad (Audio-Only)

Generate an audio-only radio ad — no images or video needed. Much faster and cheaper than video ads.

python
import requests, time, os

API_KEY = os.environ["ARS0N_API_KEY"]
BASE    = os.environ["ARS0N_API_BASE_URL"] + "/api/v1"
HEADERS = {"Authorization": f"Bearer {API_KEY}"}


# ── 1. Find a voice ──────────────────────────────────────────
resp = requests.get(
    f"{BASE}/voices",
    headers=HEADERS,
    params={"gender": "male", "accent": "american"},
)
resp.raise_for_status()
voice_id = resp.json()["voices"][0]["voice_id"]


# ── 2. (Optional) Upload background music ────────────────────
with open("bg-music.mp3", "rb") as f:
    resp = requests.post(
        f"{BASE}/assets",
        headers=HEADERS,
        files={"file": ("bg-music.mp3", f, "audio/mpeg")},
        data={"category": "music"},
    )
    resp.raise_for_status()
    music_id = resp.json()["assetId"]


# ── 3. Generate radio ad ─────────────────────────────────────
resp = requests.post(f"{BASE}/generate", headers={
    **HEADERS, "Content-Type": "application/json",
}, json={
    "adFormat": "radio",          # Audio-only — no images needed
    "prompt": "Premium noise-canceling headphones. Deep bass, sleek design.",
    "duration": 30,
    "voiceId": voice_id,
    "musicAssetId": music_id,     # Optional background music

    # Creative direction
    "voiceStyle": "warm and authoritative",
    "tone": "premium tech",
})
resp.raise_for_status()
data = resp.json()
version_id = data["versionId"]
print(f"Radio ad started: {version_id} ({data['totalCredits']} credits)")


# ── 4. Poll for completion ────────────────────────────────────
while True:
    resp = requests.get(f"{BASE}/jobs/{version_id}", headers=HEADERS)
    status = resp.json()
    print(f"  {status['status']} — {status['progress']}%")

    if status["status"] == "completed":
        print(f"\nAudio ready: {status['audioUrl']}")
        break
    elif status["status"] == "failed":
        print("\nFailed.")
        break

    time.sleep(5)  # Radio ads are faster — poll every 5s

TypeScript — Radio Ad (Audio-Only)

Generate a radio ad in TypeScript — same polling pattern, just fewer parameters and an audio result.

typescript
const API_KEY = process.env.ARS0N_API_KEY!;
const BASE = process.env.ARS0N_API_BASE_URL + "/api/v1";
const headers = { Authorization: `Bearer ${API_KEY}` };

// 1. Find a voice
const voicesRes = await fetch(`${BASE}/voices?gender=female`, { headers });
const { voices } = await voicesRes.json();
const voiceId = voices[0].voice_id;

// 2. Generate radio ad (no images needed)
const genRes = await fetch(`${BASE}/generate`, {
  method: "POST",
  headers: { ...headers, "Content-Type": "application/json" },
  body: JSON.stringify({
    adFormat: "radio",
    prompt: "Premium noise-canceling headphones — deep bass, sleek design",
    duration: 30,
    voiceId,
    tone: "premium tech",
  }),
});
const { versionId, totalCredits } = await genRes.json();
console.log(`Radio ad started (${totalCredits} credits)`);

// 3. Poll until done
while (true) {
  const res = await fetch(`${BASE}/jobs/${versionId}`, { headers });
  const data = await res.json();
  console.log(`  ${data.status} — ${data.progress}%`);

  if (data.status === "completed") {
    console.log(`Audio: ${data.audioUrl}`);
    break;
  } else if (data.status === "failed") {
    console.log("Failed");
    break;
  }
  await new Promise((r) => setTimeout(r, 5_000));
}

cURL — Quick Generate

Minimal example using image URLs (no pre-upload needed).

bash
# Generate with image URLs — server downloads them for you
curl -X POST $ARS0N_API_BASE_URL/api/v1/generate \
  -H "Authorization: Bearer $ARS0N_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "Luxury skincare product — clean, minimal, elegant",
    "imageUrls": [
      "https://example.com/product-front.png",
      "https://example.com/product-side.png"
    ],
    "duration": 15,
    "voiceId": "pNInz6obpgDQGcFmaJgB",
    "aspectRatio": "16:9",
    "companyName": "Glow Labs",
    "ctaDesign": "minimal"
  }'

cURL — Quick Radio Ad

Generate an audio-only ad with a single command — no images needed.

bash
curl -X POST $ARS0N_API_BASE_URL/api/v1/generate \
  -H "Authorization: Bearer $ARS0N_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "adFormat": "radio",
    "prompt": "Organic cold-pressed juice — fresh, healthy, delicious",
    "duration": 15,
    "voiceId": "pNInz6obpgDQGcFmaJgB",
    "voiceStyle": "energetic and friendly",
    "tone": "health-conscious lifestyle"
  }'

cURL — Estimate Costs

Preview credit costs before committing. Works for both video and radio ads.

bash
# Video estimate
curl -X POST $ARS0N_API_BASE_URL/api/v1/estimate \
  -H "Authorization: Bearer $ARS0N_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "adFormat": "video", "imageCount": 3, "duration": 15 }'

# → { "adFormat": "video", "estimatedCredits": 140, "breakdown": [...], "jobCount": 8 }

# Radio estimate
curl -X POST $ARS0N_API_BASE_URL/api/v1/estimate \
  -H "Authorization: Bearer $ARS0N_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "adFormat": "radio", "duration": 30 }'

# → { "adFormat": "radio", "estimatedCredits": 5, "breakdown": [...], "jobCount": 2 }

Python — Estimate Costs

python
import requests, os

API_KEY = os.environ["ARS0N_API_KEY"]
BASE    = os.environ["ARS0N_API_BASE_URL"] + "/api/v1"
HEADERS = {"Authorization": f"Bearer {API_KEY}", "Content-Type": "application/json"}

# Video estimate
resp = requests.post(f"{BASE}/estimate", headers=HEADERS, json={
    "adFormat": "video",
    "imageCount": 3,
    "duration": 15,
})
resp.raise_for_status()
video_est = resp.json()
print(f"Video: {video_est['estimatedCredits']} credits, {video_est['jobCount']} jobs")

# Radio estimate
resp = requests.post(f"{BASE}/estimate", headers=HEADERS, json={
    "adFormat": "radio",
    "duration": 30,
})
resp.raise_for_status()
radio_est = resp.json()
print(f"Radio: {radio_est['estimatedCredits']} credits, {radio_est['jobCount']} jobs")

TypeScript — Estimate Costs

typescript
const API_KEY = process.env.ARS0N_API_KEY!;
const BASE = process.env.ARS0N_API_BASE_URL + "/api/v1";
const headers = {
  Authorization: `Bearer ${API_KEY}`,
  "Content-Type": "application/json",
};

// Video estimate
const videoRes = await fetch(`${BASE}/estimate`, {
  method: "POST",
  headers,
  body: JSON.stringify({ adFormat: "video", imageCount: 3, duration: 15 }),
});
const videoEst = await videoRes.json();
console.log(`Video: ${videoEst.estimatedCredits} credits, ${videoEst.jobCount} jobs`);

// Radio estimate
const radioRes = await fetch(`${BASE}/estimate`, {
  method: "POST",
  headers,
  body: JSON.stringify({ adFormat: "radio", duration: 30 }),
});
const radioEst = await radioRes.json();
console.log(`Radio: ${radioEst.estimatedCredits} credits, ${radioEst.jobCount} jobs`);

cURL — Upload Assets

Upload a product image

bash
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", "publicUrl": "https://..." }

Upload background music

bash
curl -X POST $ARS0N_API_BASE_URL/api/v1/assets \
  -H "Authorization: Bearer $ARS0N_API_KEY" \
  -F "file=@background.mp3" \
  -F "category=music"

# → { "assetId": "def-456", "type": "audio", "publicUrl": "https://..." }

Python — Two-Step Plan Flow

Generate a plan, edit the script, preview the voice, then generate with your modified plan.

python
import requests

BASE = "https://ars0n.ai"
headers = {"Authorization": "Bearer sk_live_YOUR_KEY"}

# 1. Generate plan
plan_res = requests.post(f"{BASE}/api/v1/plan", headers=headers, json={
    "prompt": "Premium skincare serum with vitamin C",
    "adFormat": "video",
    "duration": 30,
    "voiceId": "voice_id",
    "imageAssetIds": ["asset-1", "asset-2"]
})
plan_data = plan_res.json()

# 2. Edit the script
plan = plan_data["plan"]
plan["voiceover_segments"][0]["text"] = "Discover radiant skin."
plan["voiceover_script"] = " ".join(s["text"] for s in plan["voiceover_segments"])

# 3. Preview voice
preview = requests.post(f"{BASE}/api/v1/preview-voice", headers=headers, json={
    "text": plan["voiceover_script"],
    "voiceId": "voice_id"
})
print(f"Duration: {preview.json()['durationSeconds']}s")

# 4. Generate with modified plan
gen = requests.post(f"{BASE}/api/v1/generate", headers=headers, json={
    "prompt": "Premium skincare serum",
    "adFormat": "video",
    "duration": 30,
    "voiceId": "voice_id",
    "imageAssetIds": ["asset-1", "asset-2"],
    "plan": plan
})
version_id = gen.json()["versionId"]

TypeScript — Two-Step Plan Flow

Same two-step flow in TypeScript, including a custom clip insertion.

typescript
const BASE = "https://ars0n.ai";
const headers = { Authorization: "Bearer sk_live_YOUR_KEY", "Content-Type": "application/json" };

// 1. Generate plan
const planRes = await fetch(`${BASE}/api/v1/plan`, {
  method: "POST", headers,
  body: JSON.stringify({ prompt: "Premium skincare", adFormat: "video", duration: 30, voiceId: "voice_id", imageAssetIds: ["asset-1"] })
});
const { plan } = await planRes.json();

// 2. Edit script
plan.voiceover_segments[0].text = "Discover radiant skin.";
plan.voiceover_script = plan.voiceover_segments.map(s => s.text).join(" ");

// 3. Generate with modified plan + custom clip
const genRes = await fetch(`${BASE}/api/v1/generate`, {
  method: "POST", headers,
  body: JSON.stringify({
    prompt: "Premium skincare", adFormat: "video", duration: 30,
    voiceId: "voice_id", imageAssetIds: ["asset-1"],
    plan,
    customClips: [{ position: 1, asset_id: "clip-asset-id", voiceover_text: "See results.", duration_seconds: 8 }]
  })
});

cURL — Browse Voices

bash
# 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"

# Each voice has a voice_id — use it in the generate call:
# → { "voices": [{ "voice_id": "abc...", "name": "Charlotte", ... }] }