API docs › Recipes

Audio to video

Upload a voice-over or podcast clip; the visuals and captions follow the speech.

  1. Upload the audio:

    curl -X POST https://photonsphere.ai/api/audio -H "Authorization: Bearer nok_YOUR_KEY" -F "file=@voice.mp3"
    # → {"id":"AUDIO_ID",…}
  2. Write the scenes from what is said:

    curl -X POST https://photonsphere.ai/api/ideas -H "Authorization: Bearer nok_YOUR_KEY" -H "Content-Type: application/json" -d '{"kind":"audio","audioId":"AUDIO_ID","language":"auto"}'
  3. Create the project using your audio as the voice, then run it (add "trimPauses":true to the settings to cut the silences between words):

    curl -X POST https://photonsphere.ai/api/projects -H "Authorization: Bearer nok_YOUR_KEY" -H "Content-Type: application/json" -d '{"name":"Podcast clip","script":"…","settings":{"ttsProvider":"upload","audioFile":"AUDIO_ID"}}'
  4. Start the render (credits are charged now and refunded if it fails):

    curl -X POST https://photonsphere.ai/api/projects/PROJECT_ID/run -H "Authorization: Bearer nok_YOUR_KEY"
  5. Poll until status is ready (or error), then download the MP4:

    curl https://photonsphere.ai/api/projects/PROJECT_ID -H "Authorization: Bearer nok_YOUR_KEY"
    curl -o video.mp4 https://photonsphere.ai/api/projects/PROJECT_ID/file/video -H "Authorization: Bearer nok_YOUR_KEY"

All calls need Authorization: Bearer nok_… (see Authentication). Prices are the same as in the app.