> ## Documentation Index
> Fetch the complete documentation index at: https://docs.anchorbrowser.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Generate Task

> Starts AI generation of a new task/tool from a natural-language `user_task`.
Poll `GET /v2/tasks/{taskId}/generation-status` until it is `ready`.




## OpenAPI

````yaml /openapi.yaml post /v2/tasks/generate
openapi: 3.1.0
info:
  title: AnchorBrowser API
  version: 1.0.0
  description: APIs to manage all browser-related actions and configuration.
servers:
  - url: https://api.anchorbrowser.io
    description: API server
security: []
paths:
  /v2/tasks/generate:
    post:
      tags:
        - Tasks
      summary: Generate Task
      description: >
        Starts AI generation of a new task/tool from a natural-language
        `user_task`.

        Poll `GET /v2/tasks/{taskId}/generation-status` until it is `ready`.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - name
                - description
                - user_task
              properties:
                name:
                  type: string
                  minLength: 1
                description:
                  type: string
                  minLength: 1
                user_task:
                  type: string
                  minLength: 1
                  description: Natural-language description of what the task should do.
                application_id:
                  type: string
                  format: uuid
                identity_id:
                  type: string
                input_schema:
                  type: array
                  items:
                    $ref: '#/components/schemas/TaskParameter'
                output_schema:
                  type: array
                  items:
                    $ref: '#/components/schemas/TaskParameter'
                output_file_only:
                  type: boolean
                  default: false
                task_browser_default_configuration:
                  type: object
                  additionalProperties: true
                human_intervention:
                  type: boolean
                  default: false
      responses:
        '200':
          description: Task generation started.
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                  status:
                    type: string
                    enum:
                      - generating
        '500':
          description: Failed to generate task.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FlatErrorResponse'
      security:
        - api_key_header: []
components:
  schemas:
    TaskParameter:
      type: object
      description: >-
        A task/tool input or output parameter definition (name, type,
        description, etc.).
      additionalProperties: true
    FlatErrorResponse:
      type: object
      properties:
        error:
          type: string
          description: Human-readable error message.
        code:
          type: integer
          description: HTTP status code.
      required:
        - error
  securitySchemes:
    api_key_header:
      type: apiKey
      in: header
      name: anchor-api-key
      description: API key passed in the header

````