Skip to main content
The Ninja API is currently in beta. Email hey@molin.ai to request access and receive your API key.
The Ninja API lets you submit prompts to Ninja, optionally define a structured output schema, and retrieve results — all over HTTP.

Base URL

Authentication

All requests require a Bearer token in the Authorization 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

  1. Create a taskPOST /v0/api/task — save the returned taskId.
  2. Poll for resultGET /v0/api/task/result?taskId=...&wait=1.
  3. If status is pending — the task hasn’t started yet. wait=1 has no effect for pending tasks. Wait a short moment and poll again.
  4. 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.
  5. When status is completed or failed — read the result or error field and stop polling.

Task statuses


Execution limits

Each task has a maximum execution time of 30 minutes. If the task does not complete within this window, it is automatically marked as failed with the error Task timed out.

Rate limits

Both endpoints share a limit of 10 requests per minute per user. Exceeding the rate limit returns 429 Too Many Requests.

Error responses