{
  "info": {
    "name": "Dhanu API",
    "description": "Generate images and text, and give work to AI staff, from your own server. Authenticate with `Authorization: Bearer <api key>`. Set the apiKey variable to a key from the developer console.",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
  },
  "auth": {
    "type": "bearer",
    "bearer": [
      {
        "key": "token",
        "value": "{{apiKey}}",
        "type": "string"
      }
    ]
  },
  "variable": [
    {
      "key": "baseUrl",
      "value": "https://api.dhanu.ai/api/pub/v1"
    },
    {
      "key": "apiKey",
      "value": ""
    }
  ],
  "item": [
    {
      "name": "Meta",
      "item": [
        {
          "name": "Get the OpenAPI document",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/openapi.json",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "openapi.json"
              ]
            },
            "description": "This document. Needs no key."
          }
        },
        {
          "name": "Platform status",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/status",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "status"
              ]
            },
            "description": "Current state of the public API and its services with 90 days of daily uptime, from probes every five minutes. Needs no key."
          }
        }
      ]
    },
    {
      "name": "MCP",
      "item": [
        {
          "name": "Model Context Protocol server",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/mcp",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "mcp"
              ]
            },
            "description": "A remote MCP server over Streamable HTTP: tasks, staff, workflows, projects and brain search as MCP tools. Each tool is gated by the same scope as its REST operation and metered the same way.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"jsonrpc\": \"\",\n  \"method\": \"\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        }
      ]
    },
    {
      "name": "Keys",
      "item": [
        {
          "name": "Check the key",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/me",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "me"
              ]
            },
            "description": "The projects the key can reach, its name and its scope. The quickest way to confirm a key works."
          }
        },
        {
          "name": "List the API catalogue",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/reference",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "reference"
              ]
            },
            "description": "Every package and operation, with an `allowed` flag saying whether this key may call it."
          }
        },
        {
          "name": "List projects",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/projects",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "projects"
              ]
            },
            "description": "The projects this key can act in, the same list as `GET /me`, for clients that want it on its own."
          }
        }
      ]
    },
    {
      "name": "Images",
      "item": [
        {
          "name": "Generate an image",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/images",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "images"
              ]
            },
            "description": "Generate one image from a prompt and return its bytes as base64. Nothing is stored.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"prompt\": \"\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        }
      ]
    },
    {
      "name": "Text",
      "item": [
        {
          "name": "Generate text",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/text",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "text"
              ]
            },
            "description": "Generate a completion from a prompt.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"prompt\": \"\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        }
      ]
    },
    {
      "name": "Jobs",
      "item": [
        {
          "name": "Read a job",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/jobs/{jobId}",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "jobs",
                ":jobId"
              ]
            },
            "description": "A background job the API started for you, a video render, an export. Poll it until `status` is `succeeded` or `failed`, or subscribe to the `job.succeeded` / `job.failed` webhooks instead."
          }
        }
      ]
    },
    {
      "name": "Tasks",
      "item": [
        {
          "name": "Trigger a staff member",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/staff/{address}/trigger",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "staff",
                ":address",
                "trigger"
              ]
            },
            "description": "Hand a staff member a piece of work through its API address. Returns at once with the task; poll its messages for the reply.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"input\": \"\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "Read a task",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/tasks/{taskId}",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "tasks",
                ":taskId"
              ]
            },
            "description": "Read one task owned by the key's workspace."
          }
        },
        {
          "name": "Read a task's messages",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/tasks/{taskId}/messages",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "tasks",
                ":taskId",
                "messages"
              ],
              "query": [
                {
                  "key": "limit",
                  "value": "",
                  "description": "Rows per page, 1 to 100; defaults to 50.",
                  "disabled": true
                },
                {
                  "key": "cursor",
                  "value": "",
                  "description": "The nextCursor from the previous page, verbatim.",
                  "disabled": true
                }
              ]
            },
            "description": "The task's messages, oldest first, one page at a time."
          }
        },
        {
          "name": "Send a message",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/tasks/{taskId}/messages",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "tasks",
                ":taskId",
                "messages"
              ]
            },
            "description": "Add a message to a task and start the reply. Returns the message you sent; the reply follows in the background.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"input\": \"\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "Create a task",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/tasks",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "tasks"
              ]
            },
            "description": "Start a task from a first message. With `staffId` the reply comes from that staff member's run; without it the workspace assistant replies. Returns at once; read the messages, stream them, or subscribe to `task.message.created`.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"input\": \"\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "List tasks",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/tasks",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "tasks"
              ],
              "query": [
                {
                  "key": "limit",
                  "value": "",
                  "description": "Rows per page, 1 to 100; defaults to 50.",
                  "disabled": true
                },
                {
                  "key": "cursor",
                  "value": "",
                  "description": "The nextCursor from the previous page, verbatim.",
                  "disabled": true
                }
              ]
            },
            "description": "Tasks the key's creator can see in the workspace, newest first, one page at a time."
          }
        },
        {
          "name": "Stream a task's replies",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/tasks/{taskId}/stream",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "tasks",
                ":taskId",
                "stream"
              ],
              "query": [
                {
                  "key": "cursor",
                  "value": "",
                  "description": "Only messages after this cursor; omit to start from now.",
                  "disabled": true
                }
              ]
            },
            "description": "Server-sent events: one `message` event per completed assistant message that arrives after `cursor` (or after now), then `done` when the connection closes. Holds the connection for up to 60 seconds; reconnect with the last cursor."
          }
        }
      ]
    },
    {
      "name": "Staff",
      "item": [
        {
          "name": "List staff",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/staff",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "staff"
              ]
            },
            "description": "Every active staff member in the workspace, with the trigger address of each one that has the API channel switched on."
          }
        },
        {
          "name": "Read a staff member",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/staff/{staffId}",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "staff",
                ":staffId"
              ]
            },
            "description": "One staff member by id."
          }
        }
      ]
    },
    {
      "name": "Workflows",
      "item": [
        {
          "name": "List workflows",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/workflows",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "workflows"
              ]
            },
            "description": "Saved workflows the key's creator can see, each with the typed fields its form asks for."
          }
        },
        {
          "name": "Run a workflow",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/workflows/{workflowId}/run",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "workflows",
                ":workflowId",
                "run"
              ]
            },
            "description": "Fill the workflow's fields and start the task it composes. Values are validated against the stored field definitions, never trusted from the client.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"values\": {}\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        }
      ]
    },
    {
      "name": "Files",
      "item": [
        {
          "name": "Start a presigned upload",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/files/uploads",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "files",
                "uploads"
              ]
            },
            "description": "For files over the direct-upload limit: returns presigned part URLs to PUT the bytes to, then complete the upload.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"filename\": \"\",\n  \"mimeType\": \"\",\n  \"sizeBytes\": 0\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "Complete a presigned upload",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/files/uploads/{uploadId}/complete",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "files",
                "uploads",
                ":uploadId",
                "complete"
              ]
            },
            "description": "Finish a multipart upload with the ETag of each part; returns the file.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"parts\": [\n    {\n      \"partNumber\": 0,\n      \"etag\": \"\"\n    }\n  ]\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "Upload a file",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/files",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "files"
              ]
            },
            "description": "Multipart form with one `file` field, up to 25 MB, stored in the key creator's drive."
          }
        },
        {
          "name": "Read a file",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/files/{fileId}",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "files",
                ":fileId"
              ]
            },
            "description": "A file's metadata."
          }
        },
        {
          "name": "Download a file",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/files/{fileId}/download",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "files",
                ":fileId",
                "download"
              ]
            },
            "description": "The file's bytes, with its content type and a download disposition."
          }
        },
        {
          "name": "Export an artifact",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/files/{fileId}/export",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "files",
                ":fileId",
                "export"
              ],
              "query": [
                {
                  "key": "format",
                  "value": "",
                  "description": "Pages export as html, sheets as csv or xlsx, decks as pdf (after render) or pptx."
                }
              ]
            },
            "description": "A page as html, a sheet as csv or xlsx, a deck as pptx or, once rendered, pdf."
          }
        },
        {
          "name": "Render a deck to PDF",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/files/{fileId}/render",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "files",
                ":fileId",
                "render"
              ]
            },
            "description": "Starts the PDF render for a deck and returns a job; export as pdf once it succeeds."
          }
        }
      ]
    },
    {
      "name": "Videos",
      "item": [
        {
          "name": "Generate a video",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/videos",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "videos"
              ]
            },
            "description": "Start a video render on a task. Returns the video (status `generating`) and the job to follow; `video.ready` fires when it is done.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"taskId\": \"\",\n  \"prompt\": \"\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "Read a video",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/videos/{videoId}",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "videos",
                ":videoId"
              ]
            },
            "description": "A video's status; `ready` means the file can be fetched."
          }
        },
        {
          "name": "Download a video",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/videos/{videoId}/file",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "videos",
                ":videoId",
                "file"
              ]
            },
            "description": "The rendered MP4, with HTTP range support for scrubbing."
          }
        }
      ]
    },
    {
      "name": "Brain",
      "item": [
        {
          "name": "Search the brain",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/brain/search",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "brain",
                "search"
              ]
            },
            "description": "Semantic search over the brain pages the key's creator can see.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"query\": \"\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        }
      ]
    },
    {
      "name": "Audio",
      "item": [
        {
          "name": "Transcribe audio",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/transcriptions",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "transcriptions"
              ]
            },
            "description": "Multipart form with one `audio` field; returns the transcript."
          }
        }
      ]
    },
    {
      "name": "OCR",
      "item": [
        {
          "name": "Extract text",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/ocr",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "ocr"
              ]
            },
            "description": "Runs OCR over a base64 image or PDF in the background; the job's result carries the text.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"data\": \"\",\n  \"mimeType\": \"\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        }
      ]
    },
    {
      "name": "Embeddings",
      "item": [
        {
          "name": "Create embeddings",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/embeddings",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "embeddings"
              ]
            },
            "description": "One vector per input text, in order.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"input\": [\n    \"\"\n  ]\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        }
      ]
    }
  ]
}