---
title: "Create any audio content with a user provided script"
method: POST
path: "/podcast/scripted"
tags: ["Podcasts"]
---

# Create any audio content with a user provided script

`POST /podcast/scripted`

Starts a background job to produce an audio file with the provided script segments. The response
    contains a `job_id` that can be used to query with the `/podcast/{job_id}` to query for status.
    Requires a valid `X-API-TOKEN` header.

    Throws:
    - 429 if the user has too many jobs in flight.
    - 400 if any voice_id or music_id provided is invalid

## Request body

- GenerateUserScriptedEpisodeRequest — A request to start a job to generate audio content with a provided script.
  - `script` ScriptSegment[], required — The segments forming the script for the episode
    - `text` string, required — The text to be spoken for this part of the dialogue
    - `voice_id` string, required — A unique identifier for the voice copied from the Wondercraft Platform to use for the speaker of this segment.
  - `music_spec` MusicTrackSpec — A music track to add to the generated audio. Note that the music will always be added at the very beginning of the generated podcast and will be automatically trimmed to match the content length.
    - `music_id` string, required — The ID of the music track to used in the background. This can be copied from theWondercraft platform
    - `fade_in_ms` integer — The number of milliseconds to fade in from the start of the music track
    - `fade_out_ms` integer — The number of milliseconds to fade out from the end of the music track
    - `playback_start` integer — A millisecond into the music track at which we start playing. Equivalent to trimming thebeginning of the music track. Defaults to 0 (i.e. no trimming)
    - `playback_end` integer, nullable — How many milliseconds into the music should we playback. Equivalent to trimming up to this numberof milliseconds from the music track. Defaults to the entire music track.
    - `volume` number — The volume to apply to the music track. Defaults to 0.05. Must be between 0.0 and 1.0
    - `loop` boolean — Whether to loop the music track. Defaults to False.

## Response `200`

Successful Response

- GenerateEpisodeResponse
  - `job_id` string, uuid, required — The job ID for the episode generation. The status of this job can be queried using the`/podcast/{job_id}` endpoint.

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/wondercraft/apis/wondercraft-public-api.md) · [All operations](https://skmtc.net/wondercraft/apis/wondercraft-public-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/wondercraft/wondercraft-public-api/versions/046fc4202fa8/schema)
