API docs › Recipes

Music to video

Upload a song: sung lyrics become scenes and captions; instrumentals cut to the beat.

  1. Upload the song:

    curl -X POST https://photonsphere.ai/api/audio -H "Authorization: Bearer nok_YOUR_KEY" -F "file=@song.mp3"
  2. Plan the music video:

    curl -X POST https://photonsphere.ai/api/music-video -H "Authorization: Bearer nok_YOUR_KEY" -H "Content-Type: application/json" -d '{"mode":"upload","audioId":"AUDIO_ID","description":"dreamy synthwave night drive"}'
    # → {"script":"…","settings":{…}}
  3. Create the project with the returned script and settings, then run it.

    curl -X POST https://photonsphere.ai/api/projects -H "Authorization: Bearer nok_YOUR_KEY" -H "Content-Type: application/json" -d '{"name":"Night drive","script":"…","settings":{…returned settings…}}'
  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.