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

# Run an AI media analysis tool

> Run Forma AI image understanding operations for descriptions, accessibility alt text, tags, or safety classification.



## OpenAPI

````yaml /openapi.json post /api/ai/tools
openapi: 3.1.0
info:
  title: Convertly API
  version: 1.0.0
  description: >-
    Convertly provides production API endpoints for media conversion,
    compression, Image CDN delivery, Forma AI, HLS/DASH video streaming, media
    tools, async jobs, workflows, webhooks, and Convertly Storage.
  license:
    name: Proprietary
    url: https://convertly.sh/terms
servers:
  - url: https://convertly.sh
security:
  - bearerAuth: []
  - apiKeyAuth: []
paths:
  /api/ai/tools:
    post:
      tags:
        - Forma AI
      summary: Run an AI media analysis tool
      description: >-
        Run Forma AI image understanding operations for descriptions,
        accessibility alt text, tags, or safety classification.
      operationId: runAiTool
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/AiToolRequest'
      responses:
        '200':
          description: AI tool result and usage
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AiToolResponse'
        '400':
          $ref: '#/components/responses/Error'
        '401':
          $ref: '#/components/responses/Error'
        '402':
          $ref: '#/components/responses/Error'
        '413':
          $ref: '#/components/responses/Error'
        '429':
          $ref: '#/components/responses/Error'
components:
  schemas:
    AiToolRequest:
      allOf:
        - type: object
          properties:
            operation:
              type: string
              enum:
                - image.describe
                - image.alt-text
                - image.tags
                - image.moderate
              description: AI analysis operation to run.
            file:
              type: string
              format: binary
              description: Image upload input. Required unless sourceUrl is provided.
            prompt:
              type: string
              maxLength: 2000
              description: Optional context for the AI operation.
          required:
            - operation
        - $ref: '#/components/schemas/RemoteSourceFields'
      description: Provide either file or sourceUrl with an AI analysis operation.
    AiToolResponse:
      type: object
      properties:
        result:
          type: object
          properties:
            operation:
              type: string
              enum:
                - image.describe
                - image.alt-text
                - image.tags
                - image.moderate
            summary:
              type: string
            altText:
              type: string
            tags:
              type: array
              items:
                type: string
            categories:
              type: array
              items:
                type: string
            safety:
              type: object
              properties:
                safe:
                  type: boolean
                labels:
                  type: array
                  items:
                    type: string
                reason:
                  type: string
            confidence:
              type: number
          required:
            - operation
            - summary
            - tags
            - categories
        usage:
          type: object
          properties:
            units:
              type: integer
            operation:
              type: string
          required:
            - units
            - operation
      required:
        - result
        - usage
    RemoteSourceFields:
      type: object
      properties:
        sourceUrl:
          type: string
          format: uri
          description: >-
            Remote HTTP(S) file input. Use instead of file for single-file
            tools.
        async:
          type: string
          enum:
            - 'true'
            - 'false'
          default: 'false'
          description: Set true to queue the media tool as a background job.
        background:
          type: string
          enum:
            - 'true'
            - 'false'
          description: Alias for async=true.
    Error:
      type: object
      properties:
        error:
          type: string
        upgradeUrl:
          type: string
      required:
        - error
  responses:
    Error:
      description: Error response
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Dashboard-generated Convertly API key. Keys currently begin with
        `cvly_`.
    apiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: Alternative API key header for server-side clients.

````