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/meWho you are (checks the key).
GET/api/accountPlan, credits and limits.
GET/api/account/usage?days=30Credits spent per feature and per day.
POST/api/ideasAI: ideas for a niche, or a script from a topic, link, text or audio.
POST/api/estimatePrice in credits of a project before running it.
GET / POST/api/projectsList your videos / create a project (name, script, settings).
GET/api/projects/{id}Status and details of a video.
POST/api/projects/{id}/runRender the video (charges credits).
GET/api/projects/{id}/file/videoDownload the MP4 (also /file/cover).
POST/api/audioUpload an audio file (voice-over or song).
POST/api/music-videoPlan a music video: upload, lyrics or jingle.
POST/api/toolsUpload an input for a tool (multipart field file).
PUT/api/toolsRun a tool on an input: {input, tool, params}.
GET/api/tools/{job}Tool job status; ?download=1 downloads the result.
POST/api/longUpload a long video (raw stream, x-file-name header).
POST/api/long/{id}/findAI picks the best moments of a long video.
POST/api/motionMotion graphics or 3D animation in code.
POST/api/mcpMCP server (JSON-RPC) for AI assistants.
GET/api/projects/{id}/framesStill 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}/sharePublic link of a video (visibility).
GET / POST/api/publicationsYour posts / publish now or schedule on your connected accounts.
GET/api/accountsConnected social accounts and channels.
GET / POST/api/charactersConsistent characters: list / create.
GET/api/voices/libraryVoice library (search and preview).
GET/api/presetsVisual style presets.
GET/api/libraryMusic tracks and voice recordings.
GET / POST/api/seriesSeries: list / create; episodes under /api/series/{id}/episodes.
POST/api/topupBuy a credit pack now ({buy: packId}) or set auto top-up.
GET/api/openapi.jsonThis API as an OpenAPI 3.1 file.

Recipes

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.