Enterprise plan required
REST API access is available on the Enterprise plan. Includes full API access, higher rate limits, and dedicated support.

Generate audio

Trigger audio generation for a post. When a new job is queued, the API responds with 202 Accepted and status: "pending" — generation runs asynchronously.

POST/v1/audio/generate
Queue audio generation for a post. Returns 202 when a new job is queued, or 200/202 when a job already exists (see Idempotency).
Headers
NameTypeRequiredDescription
X-API-KeystringRequiredYour Voicgen API key
Example: vg_live_xxxx
Content-TypestringRequiredapplication/json
Body parameters
NameTypeRequiredDescription
post_idstringRequiredYour unique identifier for this post. Used with language to load or create the audio row.
Example: article-001
contentstringRequiredHTML or plain text. Minimum 50 characters.
post_titlestringOptionalTitle of the post. Shown in the player.
Example: My article title
post_urlstringOptionalFull URL of the post. Used for analytics attribution.
Example: https://yourblog.com/post
languagestringOptionalISO 639-1 code; must be in the server-supported set. Defaults to "en".
Example: en
voice_idintegerOptionalVoicgen voice ID. Defaults to the site's default voice.
Example: 1

Response

202 Accepted (new job)
{
  "success": true,
  "message": "Audio generation queued",
  "data": {
    "id": 1,
    "post_id": "article-001",
    "status": "pending",
    "progress_percent": 0,
    "language": "en",
    ...
  }
}

Idempotency

For the same post_id and language:

  • If audio is already ready, the API returns 200 with message Audio already exists and does not start a new generation.
  • If status is generating, the API returns 202 with message Audio generation already in progress.
  • Otherwise a new job is queued and the API returns 202.

Error responses

HTTPTypical cause
401Missing or invalid API key, or subscription not allowed
403Monthly post limit reached for the plan (before queueing a new post in English)
422Validation error (e.g. content too short, invalid voice_id)
429Rate limit exceeded — see Rate limits
Content tipsSend HTML — processing strips tags for speech. Avoid sending only images, tables, or code blocks as the resulting audio will be very short. Minimum useful content is a few paragraphs of prose.