Troubleshooting
Common problems and how to fix them.
"Job stuck in queuing or generating"
Check first:
curl -s "https://nokai.studio/api/v1/jobs/recordInfo?taskId=YOUR_TASK_ID" \
-H "Authorization: Bearer $NOKAI_KEY" \
| jq '{state: .data.state, progress: .data.progress, failCode: .data.failCode}'Common causes:
- Generation service is busy. Video generation can take 15-120 seconds. Wait and keep polling.
- Job will eventually reach
fail. IffailCodeappears, see the failure code table in Errors.
"402 Insufficient credits"
Your balance is too low to reserve credits for the job.
- Check balance:
GET /api/v1/balance - Top up at the dashboard (Billing -> Add credits).
- Retry the job.
The job was not queued -- no credits were charged.
"429 Too many requests"
Honor the Retry-After header. Do not retry sooner:
if (res.status === 429) {
const wait = Number(res.headers.get('Retry-After') ?? 1) * 1000;
await sleep(wait);
}Check current headroom with GET /v1/limits before fanning out requests.
"Webhook never arrives"
Walk this checklist:
- Is the endpoint URL publicly reachable?
localhostand RFC1918 IPs are rejected. Use a tunnel (ngrok, cloudflared) for local dev. - Is your endpoint returning 2xx? Check
GET /v1/webhook-deliveries?status=failed--last_errorandlast_response_statustell you what we saw. - Did the retry budget expire? Failed deliveries past attempt 6 are not retried automatically.
- Are you subscribed to the right event? If you registered
events: ["job.completed"], you will not receivejob.failed.
"Webhook signature does not verify"
Top culprits:
- You are verifying against a parsed/re-serialized body. The signature is over the raw bytes. In Express:
verify: (req, res, buf) => { req.rawBody = buf }on the JSON parser. - Clock drift. The server enforces a 5-minute timestamp tolerance. Run NTP.
- Wrong secret. Each endpoint has its own signing secret. Check
has_custom_signing_secreton the endpoint.
"resultJson parsing fails"
resultJson is a JSON-encoded string, not an object. You must parse it twice:
// Wrong
const urls = recordInfo.data.resultJson.resultUrls;
// Correct
const result = JSON.parse(recordInfo.data.resultJson);
const urls = result.resultUrls;Where to get help
- Check
request_idin every error response and include it when opening a support ticket. - Open a ticket:
POST /v1/support/ticketsor use the dashboard. - Email:
hello@nokai.studio