> ## Documentation Index
> Fetch the complete documentation index at: https://domoinc-bradley-turek-pfilter-operators-reference.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Image to Text

> Extract text from an image.
 By default, all text detected in the image is included. The system and input prompt may be modified in order to describe, classify or extract specific information from the image.



## OpenAPI

````yaml /openapi/product/AI-Services.yaml post /api/ai/v1/image/text
openapi: 3.1.0
info:
  title: AI Services
  description: >-
    Domo AI Services provide a consistent API to leverage Foundation Models to
    solve common problems such as natural language SQL generation (text-to-SQL),
    Summarization, Classification, Tool Calling and others.
  version: 2.3.3639_master
servers:
  - url: https://{subdomain}.domo.com
    variables:
      subdomain:
        description: The Domo instance subdomain.
        default: subdomain
security: []
tags:
  - name: AI Services - Classification
    description: Domo AI Service Classification APIs
  - name: AI Services - Data Extraction
    description: Domo AI Service Data Extraction APIs
  - name: AI Services - Embedding
    description: Domo AI Service Embedding APIs
  - name: AI Services - Image
    description: Domo AI Service Image APIs
  - name: AI Services - Messages
    description: Domo AI Service Messages APIs
  - name: AI Services - Sentiment Analysis
    description: Domo AI Service Sentiment Analysis APIs
  - name: AI Services - Text
    description: Domo AI Service Text APIs
paths:
  /api/ai/v1/image/text:
    post:
      tags:
        - AI Services - Image
      summary: Image to Text
      description: |-
        Extract text from an image.
         By default, all text detected in the image is included. The system and input prompt may be modified in order to describe, classify or extract specific information from the image.
      operationId: imageToText
      requestBody:
        description: Image to text AI Service request.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ImageToTextRequest'
            examples:
              Basic Request:
                description: Basic Image-to-Text request.
                value:
                  image:
                    data: <base64 string>
                    type: base64
                    mediaType: image/png
              Full Request:
                description: >-
                  Complete Image-to-Text Request with optional parameters for
                  configuring model, prompt, maxTokens and temperature.
                value:
                  input: >-
                    Please describe this image in detail, focusing on the main
                    subject and background elements.
                  image:
                    data: <base64 string>
                    type: base64
                    mediaType: image/jpeg
                  sessionId: <session_id>
                  model: domo.domo_ai.domogpt-medium-v1.2:anthropic
                  system: >-
                    You are a professional image analyst. Provide detailed,
                    accurate descriptions of images.
                  maxTokens: 500
                  temperature: 0.7
        required: true
      responses:
        '200':
          description: >-
            TextAIResponse A <code>TextAIResponse</code> containing the
            extracted or analyzed text from the image.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TextAIResponse'
              examples:
                Image to Text Response:
                  description: Image to Text Response
                  value:
                    prompt: What do you see in this image?
                    output: >-
                      This image shows a small red square on a white background.
                      The square appears to be a simple geometric shape with
                      clean edges.
                    model: domo.domo_ai.domogpt-medium-v1.2:anthropic
        '403':
          description: Forbidden
          content:
            '*/*':
              schema:
                type: string
        '409':
          description: Conflict
      security:
        - domo-developer-token: []
components:
  schemas:
    ImageToTextRequest:
      type: object
      description: |-
        <p>
         Image to Text AI Service Request.
         </p>

         <h2>Prompt Templates</h2>
         <p>
         A prompt template is a string that contains placeholders for parameters that will be replaced with parameter values before the prompt
         is submitted to the model.
         </p>
         <p>
         A default prompt template is set for each model configured for the Image to Text AI Service. Individual requests can override the
         default template by including the <code>promptTemplate</code> parameter.
         </p>
         <h3>Prompt Template Parameters</h3>
         <p>
         The following request parameters are automatically injected into the prompt template if the associated placeholder is present:
         <ul>
          <li>input</li>
          <li>system</li>
         </ul>
         </p>
         <p>
         Models with built-in support for system prompts and chat message history do not need to include <em>system</em> or
         <em>chatContext</em> in the prompt template.
         </p>
         <p>
         Additional parameters can be provided in the <code>parameters</code> map as key-value pairs.
         </p>
         <h3>Prompt Template Examples</h3>
         <ul>
             <li>"${input}"</li>
             <li>"${system}\n${input}"</li>
         </ul>
      properties:
        input:
          type: string
          description: The input text prompt for analyzing the image.
        image:
          $ref: '#/components/schemas/Image'
          description: The image to analyze and extract text from.
        sessionId:
          type: string
          format: uuid
          description: >-
            The AI session ID. If provided, this request will be associated with
            the specified AI Session.
        model:
          type: string
          description: >-
            The ID of the model to use for Image to Text processing. The
            specified model must be configured for the Image to Text
                                       AI Service by an Admin.
        system:
          type: string
          description: >-
            The system message to use for the Image to Text task. If not
            provided, the default system message will be
                                       used. If the model does not include built-in support for system prompts, this parameter may be included in the
                                       prompt template using the "${system}" placeholder.
        modelConfiguration:
          type: object
          additionalProperties: {}
          description: >-
            Additional model-specific configuration parameter key-value pairs.
            e.g. temperature, max_tokens, etc.
        promptTemplate:
          $ref: '#/components/schemas/ParameterizedPromptTemplate'
          description: >-
            The prompt template to use for the Image to Text task. The default
            prompt template will be used if not
                                       provided.
        parameters:
          type: object
          additionalProperties:
            type: string
          description: >-
            Custom parameters to inject into the prompt template if an
            associated placeholder is present.
        maxTokens:
          type: integer
          format: int32
          description: The maximum number of tokens to generate in the response.
        temperature:
          type: number
          format: double
          description: >-
            Controls randomness in the model's output. Lower values make output
            more deterministic.
        responseFormat:
          description: Model response format specification for structured outputs.
          oneOf:
            - $ref: '#/components/schemas/JsonResponseFormat'
        reasoningConfig:
          $ref: '#/components/schemas/ReasoningConfig'
          description: Configuration for reasoning behavior and effort level.
      required:
        - input
    TextAIResponse:
      type: object
      description: Response from a text AI Service.
      properties:
        prompt:
          type: string
          description: The formatted prompt that was used to generate the response.
        choices:
          type: array
          deprecated: true
          description: The list of choices generated by the model.
          items:
            $ref: '#/components/schemas/Choice'
        modelId:
          type: string
          description: The id of the model used to generate the response.
        sessionId:
          type: string
          format: uuid
          description: The id of the AI Session associated with this request.
        output:
          type: string
          description: The output of the model.
        modelProviderUsage:
          $ref: '#/components/schemas/ModelProviderUsage'
          description: The token usage from the model provider.
    Image:
      type: object
      description: Image data and metadata.
      properties:
        data:
          type: string
          description: the base64 encoded image data
        type:
          type: string
          description: the image type e.g. "base64"
        mediaType:
          type: string
          description: the media type of the image e.g. "image/png"
    ParameterizedPromptTemplate:
      type: object
      description: |-
        <p>
         A prompt template string that contains placeholders for parameters that will be replaced with parameter values before the prompt
         is submitted to the model.
         </p>
         <p>
         <h3>Prompt Template Examples</h3>
         <ul>
             <li>"${input}"</li>
             <li>"${system}\n${input}"</li>
         </ul>
      properties:
        template:
          type: string
    JsonResponseFormat:
      allOf:
        - $ref: '#/components/schemas/ResponseFormat'
        - type: object
          properties:
            schema:
              $ref: '#/components/schemas/ObjectFunctionParameter'
              description: The JSON Schema to which the model response should adhere.
      description: >-
        JSON response format provides schema information to the model for use
        cases where structured output is desired.
         The schema object follows the <a href="https://json-schema.org/specification">JSON Schema</a> specification.
    ReasoningConfig:
      type: object
      properties:
        reasoningEffort:
          type: string
          enum:
            - NONE
            - LOW
            - MEDIUM
            - HIGH
    Choice:
      type: object
      description: A choice generated by a text AI model.
      properties:
        output:
          type: string
          description: The text model output.
    ModelProviderUsage:
      type: object
      properties:
        inputTokens:
          type: integer
          format: int64
        outputTokens:
          type: integer
          format: int64
        totalTokens:
          type: integer
          format: int64
        reasoningTokens:
          type: integer
          format: int64
    ResponseFormat:
      discriminator:
        propertyName: type
      properties:
        type:
          type: string
      required:
        - type
    ObjectFunctionParameter:
      allOf:
        - $ref: '#/components/schemas/FunctionParameterObject'
        - type: object
          properties:
            description:
              type: string
            title:
              type: string
            additionalProperties:
              type: boolean
            required:
              type: array
              items:
                type: string
            enum:
              type: array
              items:
                type: object
                additionalProperties: {}
              uniqueItems: true
            properties:
              type: object
              additionalProperties:
                oneOf:
                  - $ref: '#/components/schemas/ArrayFunctionParameter'
                  - $ref: '#/components/schemas/BooleanFunctionParameter'
                  - $ref: '#/components/schemas/IntegerFunctionParameter'
                  - $ref: '#/components/schemas/LogicalOperatorFunctionParameter'
                  - $ref: '#/components/schemas/NullFunctionParameter'
                  - $ref: '#/components/schemas/NumberFunctionParameter'
                  - $ref: '#/components/schemas/ObjectFunctionParameter'
                  - $ref: '#/components/schemas/StringFunctionParameter'
            minProperties:
              type: integer
              format: int32
            maxProperties:
              type: integer
              format: int32
            const:
              type: object
              additionalProperties: {}
      required:
        - properties
        - type
    FunctionParameterObject:
      type: object
      properties:
        type:
          type: string
          enum:
            - object
            - array
            - string
            - number
            - integer
            - boolean
            - 'null'
            - unknown
            - oneOf
            - allOf
            - anyOf
        const: {}
        enum:
          type: array
          items: {}
          uniqueItems: true
      required:
        - type
    ArrayFunctionParameter:
      allOf:
        - $ref: '#/components/schemas/FunctionParameterObject'
        - type: object
          properties:
            description:
              type: string
            title:
              type: string
            items:
              oneOf:
                - $ref: '#/components/schemas/ArrayFunctionParameter'
                - $ref: '#/components/schemas/BooleanFunctionParameter'
                - $ref: '#/components/schemas/IntegerFunctionParameter'
                - $ref: '#/components/schemas/LogicalOperatorFunctionParameter'
                - $ref: '#/components/schemas/NullFunctionParameter'
                - $ref: '#/components/schemas/NumberFunctionParameter'
                - $ref: '#/components/schemas/ObjectFunctionParameter'
                - $ref: '#/components/schemas/StringFunctionParameter'
            enum:
              type: array
              items:
                type: array
                items: {}
              uniqueItems: true
            minItems:
              type: integer
              format: int32
            maxItems:
              type: integer
              format: int32
            uniqueItems:
              type: boolean
            const:
              type: array
              items: {}
      required:
        - description
        - type
    BooleanFunctionParameter:
      allOf:
        - $ref: '#/components/schemas/FunctionParameterObject'
        - type: object
          properties:
            description:
              type: string
            title:
              type: string
            const:
              type: boolean
            enum:
              type: array
              items:
                type: boolean
              uniqueItems: true
      required:
        - description
        - type
    IntegerFunctionParameter:
      allOf:
        - $ref: '#/components/schemas/FunctionParameterObject'
        - type: object
          properties:
            description:
              type: string
            title:
              type: string
            multipleOf:
              type: integer
              format: int32
            minimum:
              type: integer
              format: int32
            exclusiveMinimum:
              type: integer
              format: int32
            maximum:
              type: integer
              format: int32
            exclusiveMaximum:
              type: integer
              format: int32
            enum:
              type: array
              items:
                type: integer
                format: int32
              uniqueItems: true
            const:
              type: integer
              format: int32
      required:
        - description
        - type
    LogicalOperatorFunctionParameter:
      allOf:
        - $ref: '#/components/schemas/FunctionParameterObject'
        - type: object
          properties:
            description:
              type: string
            title:
              type: string
            oneOf:
              type: array
              items:
                oneOf:
                  - $ref: '#/components/schemas/ArrayFunctionParameter'
                  - $ref: '#/components/schemas/BooleanFunctionParameter'
                  - $ref: '#/components/schemas/IntegerFunctionParameter'
                  - $ref: '#/components/schemas/LogicalOperatorFunctionParameter'
                  - $ref: '#/components/schemas/NullFunctionParameter'
                  - $ref: '#/components/schemas/NumberFunctionParameter'
                  - $ref: '#/components/schemas/ObjectFunctionParameter'
                  - $ref: '#/components/schemas/StringFunctionParameter'
            allOf:
              type: array
              items:
                oneOf:
                  - $ref: '#/components/schemas/ArrayFunctionParameter'
                  - $ref: '#/components/schemas/BooleanFunctionParameter'
                  - $ref: '#/components/schemas/IntegerFunctionParameter'
                  - $ref: '#/components/schemas/LogicalOperatorFunctionParameter'
                  - $ref: '#/components/schemas/NullFunctionParameter'
                  - $ref: '#/components/schemas/NumberFunctionParameter'
                  - $ref: '#/components/schemas/ObjectFunctionParameter'
                  - $ref: '#/components/schemas/StringFunctionParameter'
            anyOf:
              type: array
              items:
                oneOf:
                  - $ref: '#/components/schemas/ArrayFunctionParameter'
                  - $ref: '#/components/schemas/BooleanFunctionParameter'
                  - $ref: '#/components/schemas/IntegerFunctionParameter'
                  - $ref: '#/components/schemas/LogicalOperatorFunctionParameter'
                  - $ref: '#/components/schemas/NullFunctionParameter'
                  - $ref: '#/components/schemas/NumberFunctionParameter'
                  - $ref: '#/components/schemas/ObjectFunctionParameter'
                  - $ref: '#/components/schemas/StringFunctionParameter'
      required:
        - description
        - type
    NullFunctionParameter:
      allOf:
        - $ref: '#/components/schemas/FunctionParameterObject'
        - type: object
          properties:
            description:
              type: string
            title:
              type: string
      required:
        - description
        - type
    NumberFunctionParameter:
      allOf:
        - $ref: '#/components/schemas/FunctionParameterObject'
        - type: object
          properties:
            description:
              type: string
            title:
              type: string
            multipleOf:
              type: number
              format: double
            minimum:
              type: number
              format: double
            exclusiveMinimum:
              type: number
              format: double
            maximum:
              type: number
              format: double
            exclusiveMaximum:
              type: number
              format: double
            enum:
              type: array
              items:
                type: number
                format: double
              uniqueItems: true
            const:
              type: number
              format: double
      required:
        - description
        - type
    StringFunctionParameter:
      allOf:
        - $ref: '#/components/schemas/FunctionParameterObject'
        - type: object
          properties:
            description:
              type: string
            title:
              type: string
            minLength:
              type: integer
              format: int32
            maxLength:
              type: integer
              format: int32
            pattern:
              type: string
            enum:
              type: array
              items:
                type: string
              uniqueItems: true
            format:
              type: string
            const:
              type: string
      required:
        - description
        - type
  securitySchemes:
    domo-developer-token:
      type: apiKey
      name: X-DOMO-Developer-Token
      in: header

````