---
title: "POST /ai/tasks"
method: POST
path: "/ai/tasks"
tags: ["ai"]
---

# POST /ai/tasks

`POST /ai/tasks`

Get a task run by the AI.

## Request body

- object
  - `provider` 'huggingface', required — The provider to use to perform the task
  - `task` string, required — The task to perform
  - `data` object, required — The data to use to perform the task
    - `inputs` union, required — The information that will be used to perform the requested task
      - string
      - string[]
    - `parameters` object — The parameters that might be passed to the provider call

## Response `200`

Response from the AI with the result of the task.

- object
  - `output` union, required — The output of the task that was run
    - object — The output of the task
    - object[]

## Other responses

- `400` — Invalid request (e.g. unsupported AI task).
- `403` — The endpoint was called not by a PB agent.
- `500` — Internal server error.

---

[API](https://skmtc.dev/phantombuster/apis/phantombuster-api-v2.md) · [All operations](https://skmtc.dev/phantombuster/apis/phantombuster-api-v2/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/phantombuster/phantombuster-api-v2/revisions/acf0049d7c7f/schema)
