Ninja API
Create a task
Submit a prompt to Ninja and start execution in the background.
POST
Creates a new task and starts execution in the background. Returns immediately with a
taskId and pending status.
Request parameters
The task prompt. Must be between 1 and 16,000 characters.
The LLM model to use.
| Value | Description |
|---|---|
fast | Fastest and cheapest. Best for simple tasks. |
smart | Balanced speed and quality. (default) |
super-smart | Most capable. Best for complex reasoning. |
Optional JSON Schema for structured output. When provided, the
result field in the response will be a JSON object conforming to this schema. Must follow the supported schema
format. Maximum 5 KB when serialized.Response fields
UUID of the created task. Use this to poll for results via the get task result endpoint.
Always
pending for newly created tasks.Result schema format
TheresultSchema field must be a valid JSON Schema. The following features are not supported:
oneOf,anyOf,not,if/then/else- Numerical constraints (
minimum,maximum,multipleOf) - String length constraints (
minLength,maxLength) - Array length constraints (
minItems,maxItems) - Type arrays (e.g.
"type": ["string", "null"])
object, array, string, number, integer, boolean
Example: