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

# Generate AI Content

> Submit a transcription job that also generates AI content based on provided parts.



## OpenAPI

````yaml /api-reference/openapi.json post /v2/jobs/generate-transcription-ai-content
openapi: 3.0.1
info:
  title: Hamsa API
  description: Trying out our transcription and media-to-text APIs
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://api.tryhamsa.com
security: []
paths:
  /v2/jobs/generate-transcription-ai-content:
    post:
      summary: Generate AI Content
      description: >-
        Submit a transcription job that also generates AI content based on
        provided parts.
      requestBody:
        description: Request body containing media info and AI content options
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateTranscriptionWithAiContentRequestBody'
      responses:
        '200':
          description: Successful response with job id
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/SuccessResponse'
                  - type: object
                    properties:
                      data:
                        $ref: >-
                          #/components/schemas/CreateTranscriptionWithAiContentResponse
                      message:
                        type: string
                        example: >-
                          AI Content started, you will receive en email when
                          it's ready
        '400':
          description: Validation error response
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ValidationErrorResponse'
                  - properties:
                      message:
                        type: string
                        example: The Media Url field is required!
        '500':
          description: Internal server error response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InternalServerErrorResponse'
      security:
        - BearerAuth: []
        - ApiKeyAuth: []
components:
  schemas:
    CreateTranscriptionWithAiContentRequestBody:
      type: object
      required:
        - apiKey
        - mediaUrl
        - title
        - language
        - aiParts
      properties:
        apiKey:
          type: string
          format: uuid
          example: 9f5f1f6a-2b1d-4a33-8fd4-6f5c2b89e3aa
          description: API key identifier (used for API key authorization)
        mediaUrl:
          type: string
          format: uri
          minLength: 1
          example: https://example.com/audio.mp3
          description: URL of the media to transcribe
        title:
          type: string
          minLength: 1
          maxLength: 500
          example: Meeting Notes
        language:
          type: string
          enum:
            - ar
            - en
          example: ar
          description: Language code for the media being transcribed
        aiParts:
          type: array
          minItems: 1
          maxItems: 1
          items:
            type: string
            minLength: 1
          example:
            - summary
          description: AI content parts to generate (one key only)
        aiContentTitle:
          type: string
          minLength: 1
          maxLength: 500
          example: Project Kickoff Summary
          nullable: true
        aiContentLanguage:
          type: string
          enum:
            - ar
            - en
            - both_ar_first
            - both_en_first
          example: ar
          description: Preferred AI content language
          nullable: true
        aiContentDate:
          type: string
          format: date-time
          description: Date associated with the AI content
          example: '2025-01-01T00:00:00.000Z'
          nullable: true
        aiContentText:
          type: string
          minLength: 1
          maxLength: 5000
          example: Provide highlights focusing on action items.
          nullable: true
    SuccessResponse:
      type: object
      properties:
        success:
          type: boolean
          example: true
        message:
          type: string
          example: Operation completed successfully
        messageKey:
          type: string
          example: OPERATION_SUCCESSFUL
    CreateTranscriptionWithAiContentResponse:
      type: object
      required:
        - jobId
      properties:
        jobId:
          type: string
          example: ed9b5601-f731-441a-8500-d9fc7610ef8f
    ValidationErrorResponse:
      type: object
      properties:
        code:
          type: integer
          example: 9400
        message:
          type: string
          example: Field must be a string!
        messageKey:
          type: string
          example: FieldMustBeString
    InternalServerErrorResponse:
      type: object
      properties:
        success:
          type: boolean
          example: false
        code:
          type: integer
          example: 500
        message:
          type: string
          example: Internal server error
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: Authorization
      description: >-
        Pass the API key in the Authorization header, You need to put Token
        keyword before the API key. e.g. 'Authorization: Token <api-key>'

````