API docs › Recipes
Talking avatar
A stock AI avatar reads your text.
List avatars and voices:
curl "https://photonsphere.ai/api/tools/options?kind=avatars" -H "Authorization: Bearer nok_YOUR_KEY" curl "https://photonsphere.ai/api/tools/options?kind=avatarVoices" -H "Authorization: Bearer nok_YOUR_KEY"
Run the tool (credits shown in the app are charged now and refunded if it fails):
curl -X PUT https://photonsphere.ai/api/tools -H "Authorization: Bearer nok_YOUR_KEY" -H "Content-Type: application/json" \ -d '{"input":"","tool":"avatar","params":{"text":"Hi! Here are three tips…","avatarId":"AVATAR_ID","voiceId":"VOICE_ID","ratio":"9:16"}}' # → {"id":"JOB_ID"}Poll the job, then download the result:
curl https://photonsphere.ai/api/tools/JOB_ID -H "Authorization: Bearer nok_YOUR_KEY" # {"state":"running"|"ready"|"error","progress":0-100} curl -o result.mp4 "https://photonsphere.ai/api/tools/JOB_ID?download=1" -H "Authorization: Bearer nok_YOUR_KEY"
All calls need Authorization: Bearer nok_… (see Authentication). Prices are the same as in the app.