> ## Documentation Index
> Fetch the complete documentation index at: https://domoinc-openapi-sync-dataflows.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Text Generation

> Generate text based on the given text input.



## OpenAPI

````yaml /openapi/product/aiservices.yaml post /api/ai/v1/text/generation
openapi: 3.0.0
info:
  title: AI Services API
  version: v1
  description: >-
    API for Domo's AI services, including Text Generation, Text-to-SQL, and
    Summarization.
servers:
  - url: https://{instance}.domo.com
    description: Domo Instance
    variables:
      instance:
        default: api
        description: Your specific Domo instance name (e.g., mycompany)
security:
  - developerToken: []
tags:
  - name: AI Services
    description: Endpoints for AI-powered text operations.
paths:
  /api/ai/v1/text/generation:
    post:
      tags:
        - AI Services
      summary: Text Generation
      description: Generate text based on the given text input.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TextGenerationRequest'
            examples:
              Basic:
                summary: Basic Example
                value:
                  input: Why is the sky blue?
              PromptTemplate:
                summary: Prompt Template Example
                value:
                  input: Why is the sky blue?
                  promptTemplate:
                    template: 'Respond to the following in ${language}: ${input}'
                  parameters:
                    language: Japanese
                  model: domo.domo_ai.domogpt-chat-small-v1:anthropic
              SystemMessage:
                summary: System Message Example
                value:
                  input: Why is the sky blue?
                  system: Respond only in Japanese
                  model: domo.domo_ai.domogpt-chat-small-v1:anthropic
      responses:
        '200':
          description: The generated text.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AIResponse'
              example:
                output: The sky is blue because of Rayleigh scattering.
                modelId: domo.domo_ai.domogpt-chat-small-v1:anthropic
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    TextGenerationRequest:
      type: object
      required:
        - input
      properties:
        input:
          type: string
          description: The input text to send to the model.
        model:
          type: string
          description: The ID of the model to use.
        modelConfiguration:
          $ref: '#/components/schemas/ModelConfiguration'
        promptTemplate:
          $ref: '#/components/schemas/PromptTemplate'
        parameters:
          $ref: '#/components/schemas/ModelParameters'
        system:
          type: string
          description: >-
            The system message to use for the Text Generation 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.
    AIResponse:
      type: object
      description: Standard successful AI response.
      properties:
        output:
          type: string
        modelId:
          type: string
    ErrorResponse:
      type: object
      properties:
        message:
          type: string
          description: A human-readable error message.
    ModelConfiguration:
      type: object
      description: >-
        Additional model-specific configuration key-value pairs (e.g.,
        temperature).
      additionalProperties: true
      example:
        temperature: 0.7
        max_tokens: 1024
    PromptTemplate:
      type: object
      description: >-
        A prompt template object. The 'template' string should contain
        placeholders.
      properties:
        template:
          type: string
          example: 'Respond to the following in ${language}: ${input}'
    ModelParameters:
      type: object
      description: Custom parameters to inject into the prompt template.
      additionalProperties: true
      example:
        language: Japanese
  securitySchemes:
    developerToken:
      type: apiKey
      in: header
      name: X-DOMO-Developer-Token
      description: Domo Developer Token for authentication.

````