The Ninja API is currently in beta. Email hey@molin.ai to request access and receive your API key.
Base URL
Authentication
All requests require a Bearer token in theAuthorization header. API keys are prefixed with nsk_.
Endpoints
Create a task
POST /v0/api/task — submit a prompt and start execution.Get task result
GET /v0/api/task/result — retrieve status and result.Typical usage pattern
- Create a task —
POST /v0/api/task— save the returnedtaskId. - Poll for result —
GET /v0/api/task/result?taskId=...&wait=1. - If status is
pending— the task hasn’t started yet.wait=1has no effect forpendingtasks. Wait a short moment and poll again. - If status is
in_progress— the long-poll is active and the request will block until the task completes. Poll again if the request times out. - When status is
completedorfailed— read theresultorerrorfield and stop polling.
Task statuses
| Status | Description |
|---|---|
pending | Task created, hasn’t started yet. |
in_progress | Task is currently executing. |
completed | Task finished successfully. result is available. |
failed | Task encountered an error. error contains the message. |
cancelled | Task was cancelled. |
paused | Task is paused, waiting for user input. |
stopped | Task was stopped. |
impossible | Task cannot be completed. |
out_of_credits | User ran out of credits during execution. |
Rate limits
Both endpoints share a limit of 10 requests per minute per user. Exceeding the rate limit returns429 Too Many Requests.
Error responses
| Status code | Description |
|---|---|
400 | Invalid request body or query parameters (e.g. prompt too long, invalid resultSchema, malformed taskId). |
401 | Missing or invalid API key. |
404 | Task not found or not owned by the authenticated user. |
429 | Rate limit exceeded (10 req/min) or free-plan task quota exhausted. |