Skip to content
会nokai.studio

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:

  1. Generation service is busy. Video generation can take 15-120 seconds. Wait and keep polling.
  2. Job will eventually reach fail. If failCode appears, see the failure code table in Errors.

"402 Insufficient credits"

Your balance is too low to reserve credits for the job.

  1. Check balance: GET /api/v1/balance
  2. Top up at the dashboard (Billing -> Add credits).
  3. 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:

  1. Is the endpoint URL publicly reachable? localhost and RFC1918 IPs are rejected. Use a tunnel (ngrok, cloudflared) for local dev.
  2. Is your endpoint returning 2xx? Check GET /v1/webhook-deliveries?status=failed -- last_error and last_response_status tell you what we saw.
  3. Did the retry budget expire? Failed deliveries past attempt 6 are not retried automatically.
  4. Are you subscribed to the right event? If you registered events: ["job.completed"], you will not receive job.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_secret on 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_id in every error response and include it when opening a support ticket.
  • Open a ticket: POST /v1/support/tickets or use the dashboard.
  • Email: hello@nokai.studio