The Nightshift API
Make videos for your channels, follow each one, cross-post it and download it — from your own code or an AI assistant. Every call passes the same checks as the site: your organization’s channels only, the publish check and its approvals, private YouTube uploads.
Quick start
Get a key
In the Command Center open Developers. An admin presses Activate API once and accepts the Terms. Then top up the API balance (at least $5.00) and create a key under API keys. The key is shown once — store it like a password.
Make a request
Send the key as a bearer token. This call lists your channels.
Read the result
You get JSON back. Use a channel’s id to start a video. Amounts of money are whole US cents.
export NIGHTSHIFT_API_KEY="<your API key>"
curl https://nightshift-ai.studio/api/v1/channels \
-H "Authorization: Bearer $NIGHTSHIFT_API_KEY"{
"channels": [
{
"id": "my-channel",
"name": "My channel",
"niche": "history",
"active": true,
"youtube_connected": true,
"target_duration_seconds": 180
}
]
}Keys, balance and limits live under the Terms. The API opens to an organization that has bought a credit pack, or that has API access switched on for it.
Next: start a videoAuthentication
Every call carries your key in the Authorization header. There is nothing else to sign.
Authorization: Bearer nsk_live_…- A key acts as the admin who created it, inside your organization only. If that person leaves or stops being an admin, their keys stop working: create a new one.
- Keep keys on a server. Never put one in a browser or in an app you ship — anyone holding it can spend your balance.
- You can have 10 active keys. Revoke one any time under Developers.
Each key has scopes, chosen when it is created. A call outside them is refused, and the answer names the scope it needed; nothing is made or charged. Give a key only what its program needs: a key that only reads status cannot spend anything.
| account:read | Balance, channels and publish targets |
| videos:read | List videos, read a video, a job or a download |
| videos:write | Start a video, cross-post it, order a download |
| creative:quote | Ask the price of a generation |
| creative:create | Start a generation (spends credits) |
| creative:read | Read a generation this key started |
GET /me works with any valid key and lists that key’s scopes. Keys made before generations existed hold only account:read, videos:read, videos:write. A key can also carry its own requests-per-minute limit (1–300; it can only lower your tier’s) and a monthly credit ceiling for generations.
Endpoints
Base URL https://nightshift-ai.studio/api/v1. JSON in, JSON out. Amounts of money are whole US cents. Every response carries an x-request-id header — quote it if you contact support.
| GET | /me | Your organization, usage tier and limits |
| GET | /balance | Prepaid balance, reserved amount and this month’s spend |
| GET | /channels | Your channels — what POST /videos takes |
| GET | /accounts | Where you can publish: YouTube channels, Instagram and TikTok accounts |
| POST | /videos | Start a video (queued; charged when it succeeds) |
| GET | /videos | List videos (?channel_id, ?limit up to 100, ?offset) |
| GET | /videos/{id} | One video, with its publish requests |
| POST | /videos/{id}/publish | Cross-post a finished video (free) |
| POST | /videos/{id}/downloads | Order a 720p or 1080p download |
| GET | /downloads/{id} | A download’s status (file_url when ready) |
| GET | /downloads/{id}/file | The MP4 of a ready download |
| GET | /jobs/{id} | A video job’s status and charge |
| POST | /creative/quote | The price of one generation, in credits (nothing is charged) |
| POST | /creative/jobs | Start a generation (Idempotency-Key and max_credits required) |
| GET | /creative/jobs/{id} | A generation this key started: status, charge, result |
Start a video
curl -X POST https://nightshift-ai.studio/api/v1/videos \
-H "Authorization: Bearer $NIGHTSHIFT_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{"channel_id": "my-channel", "topic": "The lost city of Z", "duration": 180}'
# 201 {"job_id": 42, "channel_id": "my-channel", "status": "queued", "price_cents": <the amount held>}Only channel_id is required. Optional fields: topic, niche, duration (30–3600 seconds), language, visual_style. Unknown fields are refused. Every POST accepts an Idempotency-Key header (see Retries and price limits). The video is rendered private and follows the channel’s own publish rules.
Follow the job, then find the video
curl https://nightshift-ai.studio/api/v1/jobs/42 -H "Authorization: Bearer $NIGHTSHIFT_API_KEY"
curl "https://nightshift-ai.studio/api/v1/videos?channel_id=my-channel&limit=5" -H "Authorization: Bearer $NIGHTSHIFT_API_KEY"The job’s status moves from queued to running to succeeded — or to failed, and then nothing is charged. Poll every few seconds.
Publish to platforms
curl -X POST https://nightshift-ai.studio/api/v1/videos/VIDEO_ID/publish \
-H "Authorization: Bearer $NIGHTSHIFT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"account_ids": ["<instagram or tiktok account id>"], "channel_ids": ["my-second-channel"]}'One request per target, each with its own answer. A video that has not passed the publish check and its approvals is recorded as refused with a reason, exactly as on the site. Targets come from GET /accounts.
Download in HD
curl -X POST https://nightshift-ai.studio/api/v1/videos/VIDEO_ID/downloads -H "Authorization: Bearer $NIGHTSHIFT_API_KEY" \
-H "Content-Type: application/json" -d '{"quality": "1080p"}'
curl https://nightshift-ai.studio/api/v1/downloads/7 -H "Authorization: Bearer $NIGHTSHIFT_API_KEY" # until status = ready
curl -o video.mp4 https://nightshift-ai.studio/api/v1/downloads/7/file -H "Authorization: Bearer $NIGHTSHIFT_API_KEY"Order a quality, poll until the status is ready, then fetch the file. A failed download costs nothing, and the same quality of the same video is free again for 7 days.
Generations
Pictures, clips and voice-overs with the same models, prices and checks as the Studio. Unlike videos, a generation is paid in your organization’s credits, not the API balance, and only when it completes: a failed one costs nothing. Ask for the price first, then start with the price you accept.
curl -X POST https://nightshift-ai.studio/api/v1/creative/quote \
-H "Authorization: Bearer $NIGHTSHIFT_API_KEY" -H "Content-Type: application/json" \
-d '{"capability": "t2i", "model": "MODEL_ID", "params": {"prompt": "a lighthouse at dawn"}}'
# 200 {"quote": {"credits": <price in credits>, "model": "MODEL_ID", "capability": "t2i", …}}
curl -X POST https://nightshift-ai.studio/api/v1/creative/jobs \
-H "Authorization: Bearer $NIGHTSHIFT_API_KEY" -H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{"capability": "t2i", "model": "MODEL_ID", "params": {"prompt": "a lighthouse at dawn"}, "max_credits": QUOTED_CREDITS}'
# 201 {"id": "…", "status": "queued", "quoted_credits": <the quote>, "charged_credits": null, …}
curl https://nightshift-ai.studio/api/v1/creative/jobs/JOB_ID -H "Authorization: Bearer $NIGHTSHIFT_API_KEY" # until status = completed- Send max_credits, the most you accept to pay, and an Idempotency-Key with every start — see Retries and price limits.
- Input pictures (source_asset_id) come from your organization’s media library.
- A generation ends completed (charged) or failed (nothing charged). The results land in your media library.
Retries and price limits
Retry without paying twice
Networks fail. Every POST accepts an Idempotency-Key header: if a request times out, send it again with the same key and the same body, and you get the first answer back (the response says idempotent-replayed: true) — nothing is made or charged twice. A key is remembered for 24 hours and belongs to the API key that sent it. The same key with a different body is refused, so use a new key for a new request.
KEY=$(uuidgen)
BODY='{"channel_id": "my-channel", "topic": "The lost city of Z", "duration": 180}'
curl -X POST https://nightshift-ai.studio/api/v1/videos -H "Authorization: Bearer $NIGHTSHIFT_API_KEY" -H "Content-Type: application/json" -H "Idempotency-Key: $KEY" -d "$BODY"
# timed out? send the identical request again:
curl -X POST https://nightshift-ai.studio/api/v1/videos -H "Authorization: Bearer $NIGHTSHIFT_API_KEY" -H "Content-Type: application/json" -H "Idempotency-Key: $KEY" -d "$BODY"
# → the first answer again, with the header idempotent-replayed: trueSay the most you will pay
For a generation, max_credits is the most you agree to pay. Ask for the price, then start with that number. If the price has risen above it by then, the start is refused and nothing is charged — ask for the price again. You are never charged more than the price you were quoted.
Pricing and limits
From the live price list, prepaid, in US dollars:
| Video | $1.20 a minute of requested length, at least $0.60 a video |
|---|---|
| Publish to platforms | Free |
| HD download (720p / 1080p) | The site’s download price in credits × 1.5¢ |
How it is charged. Starting a video reserves max(⌈seconds × 120¢ / 60⌉, 60¢) of your available balance, and the answer shows it as price_cents. When the video is made you are charged that amount; if the job fails or is cancelled, you are charged nothing. The length is your duration, or the channel’s target length. A download is charged when the file is ready.
Usage tiers
Your tier rises by itself with what you have paid in top-ups (net of refunds):
| Tier | Paid top-ups | Requests / min | Videos at once | Monthly spend cap |
|---|---|---|---|---|
| 0 | activated | 10 | 1 | $0.00 |
| 1 | ≥ $5.00 | 30 | 2 | $100.00 |
| 2 | ≥ $50.00 | 60 | 3 | $500.00 |
| 3 | ≥ $250.00 | 120 | 5 | $2,000.00 |
| 4 | ≥ $1,000.00 | 300 | 10 | $10,000.00 |
Your organization can set a lower monthly limit, and each key its own. Spend this month counts what you have been charged plus what is reserved for videos in progress. Rate limits are per key per minute; every response carries x-ratelimit-limit, x-ratelimit-remaining and x-ratelimit-reset (seconds). If you send too many requests, the answer carries Retry-After: the seconds to wait.
Prefer to talk to it?
The same key, the same prices and the same approval rules work from an AI assistant over MCP.