NOK API
Everything you can do in the app, from code: write scripts, render videos, run tools and download the results. The API uses the same credits as the app and refunds them when a generation fails.
Authentication
Create a key in Developers (your plan must include the API) and send it on every request:
curl https://photonsphere.ai/api/me -H "Authorization: Bearer nok_YOUR_KEY"
Keep the key secret: it acts as your account. Delete it in Developers to revoke it.
Responses and errors
Answers are JSON. Errors come as {"error":"message"} with an HTTP status: 400 (invalid request), 401 (missing or invalid key), 402/403 (not enough credits or not in your plan), 404 (not found), 429 (too many requests: wait and retry).
Endpoints
| GET | /api/me | Who you are (checks the key). |
| GET | /api/account | Plan, credits and limits. |
| GET | /api/account/usage?days=30 | Credits spent per feature and per day. |
| POST | /api/ideas | AI: ideas for a niche, or a script from a topic, link, text or audio. |
| POST | /api/estimate | Price in credits of a project before running it. |
| GET / POST | /api/projects | List your videos / create a project (name, script, settings). |
| GET | /api/projects/{id} | Status and details of a video. |
| POST | /api/projects/{id}/run | Render the video (charges credits). |
| GET | /api/projects/{id}/file/video | Download the MP4 (also /file/cover). |
| POST | /api/audio | Upload an audio file (voice-over or song). |
| POST | /api/music-video | Plan a music video: upload, lyrics or jingle. |
| POST | /api/tools | Upload an input for a tool (multipart field file). |
| PUT | /api/tools | Run a tool on an input: {input, tool, params}. |
| GET | /api/tools/{job} | Tool job status; ?download=1 downloads the result. |
| POST | /api/long | Upload a long video (raw stream, x-file-name header). |
| POST | /api/long/{id}/find | AI picks the best moments of a long video. |
| POST | /api/motion | Motion graphics or 3D animation in code. |
| POST | /api/mcp | MCP server (JSON-RPC) for AI assistants. |
| GET | /api/projects/{id}/frames | Still frames (JPEG, base64) of a finished video at chosen times: ?t=1.5,4,10. |
| PATCH / POST / DELETE | /api/projects/{id} | Rename ({name}), duplicate ({action:"duplicate"}) or delete a video. |
| GET / POST | /api/projects/{id}/share | Public link of a video (visibility). |
| GET / POST | /api/publications | Your posts / publish now or schedule on your connected accounts. |
| GET | /api/accounts | Connected social accounts and channels. |
| GET / POST | /api/characters | Consistent characters: list / create. |
| GET | /api/voices/library | Voice library (search and preview). |
| GET | /api/presets | Visual style presets. |
| GET | /api/library | Music tracks and voice recordings. |
| GET / POST | /api/series | Series: list / create; episodes under /api/series/{id}/episodes. |
| POST | /api/topup | Buy a credit pack now ({buy: packId}) or set auto top-up. |
| GET | /api/openapi.json | This API as an OpenAPI 3.1 file. |
Recipes
- Script to video — Send your own scene-by-scene script and get a narrated vertical video.
- Idea (prompt) to video — Let the AI write the script from a one-line idea, then render it.
- Article or link to video — Turn a web page or a pasted text into a short video.
- Audio to video — Upload a voice-over or podcast clip; the visuals and captions follow the speech.
- Music to video — Upload a song: sung lyrics become scenes and captions; instrumentals cut to the beat.
- Lyrics to song to video — Paste lyrics and a style: the AI composes a sung song and the video follows it.
- Singing ad (jingle) — Describe the product: jingle, sung song, an optional singer from a photo, product photos and an end card.
- UGC ad with an AI creator — A made-up creator talks about your product to a phone camera, with the product in hand: 1 to 3 clips of 8 seconds, with captions.
- Talking avatar — A stock AI avatar reads your text.
- Audio over a still image — MP3 to MP4 with a cover image or a sound wave (free, runs on PhotonSphere's servers).
- AI video with first frame, last frame and references — Generate a clip that starts and ends on your images, keeping up to 4 reference ingredients.
- Motion transfer — Make the subject of an image move like the person in a reference video.
- Animated character — Replace the main person in a video with a fictional, non-realistic character from your image (cartoon, 3D, anime, mascot). Realistic photos of people are refused and the credits are returned.
- Caption your video — Animated burned-in captions on your own video.
- Long video to Shorts — Upload a long video, let the AI find the best moments and render clips.
- Ad from a product page — A product page link becomes a short ad script and video.
- 3D animation and motion graphics — The AI animates in code (2D motion graphics or real 3D scenes), reviews its own frames, narrates and adds music.
Other ways in
MCP server for AI assistants, a command-line tool (nok.mjs, download in Developers) and a ready SKILL.md for coding agents.