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

# Create a forced alignment

> Align audio of up to 90 seconds with its transcript and get every word's start and end time.



## OpenAPI

````yaml api-reference/openapi.json POST /v1/forced-alignment
openapi: 3.1.0
info:
  title: Chariot API
  version: '1'
  description: >-
    Chariot is a voice AI platform built for Indian and English languages.
    Convert text into natural-sounding speech over a simple REST call, an HTTP
    audio stream, or a low-latency WebSocket, and transcribe speech to text over
    a streaming WebSocket or from a prerecorded file (Beta). This reference
    documents the public, API-key-authenticated endpoints.
  contact:
    name: Chariot Support
    email: support@chariot.in
    url: https://chariot.in
servers:
  - url: https://api.chariot.in
    description: Production
security:
  - APIKeyHeader: []
tags:
  - name: Text to Speech
    description: Convert text into speech synchronously or as a stream.
  - name: Speech to Text
    description: >-
      Transcribe prerecorded files (Beta) and review streaming speech-to-text
      sessions.
  - name: Forced Alignment
    description: Time a transcript against its audio, word by word (Beta).
  - name: Voices
    description: Browse the voice catalog.
  - name: Account
    description: Inspect your credit balance and usage.
paths:
  /v1/forced-alignment:
    post:
      tags:
        - Forced Alignment
      summary: Create a forced alignment
      description: >-
        **Beta.** Align audio of up to 90 seconds with its transcript and
        receive a start and end time for every word in the same response. Costs
        1 credit per second of audio, rounded up.


        See the [Forced alignment guide](/guides/forced-alignment/overview).
      operationId: createForcedAlignment
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/ForcedAlignmentRequest'
      responses:
        '200':
          description: The completed alignment.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ForcedAlignment'
              example:
                alignment_id: 6f1c2d9e-3b7a-4f0e-9a51-2c8d4e7b1a90
                status: completed
                language: hi
                filename: greeting.wav
                duration_seconds: 1.83
                text_characters: 21
                word_count: 4
                credits_used: 2
                loss: 0.06
                words:
                  - text: नमस्ते,
                    start: 0.12
                    end: 0.58
                    loss: 0.04
                  - text: आप
                    start: 0.66
                    end: 0.81
                    loss: 0.06
                  - text: कैसे
                    start: 0.81
                    end: 1.1
                    loss: 0.05
                  - text: हैं?
                    start: 1.1
                    end: 1.42
                    loss: 0.09
                text: नमस्ते, आप कैसे हैं?
                has_audio: false
                error: null
                created_at: '2026-10-29T10:00:00Z'
                started_at: '2026-10-29T10:00:00Z'
                completed_at: '2026-10-29T10:00:01Z'
                content_expires_at: null
        '401':
          $ref: '#/components/responses/Unauthorized'
        '402':
          description: Not enough credits for this audio.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                statusCode: 402
                error: HTTPException
                message: >-
                  This audio is 12.0s and needs 12 credits. The workspace does
                  not have enough.
        '403':
          description: Forced alignment is not included in the current plan.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '413':
          description: >-
            The upload is well over 50 MB, refused while it is still uploading.
            Nothing is charged. This body has a single `detail` field, not the
            standard error envelope. A file just over 50 MB returns `422`
            instead.
          content:
            application/json:
              schema:
                type: object
                required:
                  - detail
                properties:
                  detail:
                    type: string
              example:
                detail: 'Request is too large: the file limit is 50 MB'
        '422':
          description: >-
            Invalid input: unreadable audio, too long or too short (under 0.1
            s), a file just over 50 MB, an empty transcript, one over 5,000
            characters or one with no words that can be aligned, or an
            unsupported language. Nothing is charged.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: Too many concurrent requests for this workspace.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                statusCode: 429
                error: HTTPException
                message: >-
                  Concurrent request limit exceeded (8) for alignment.standard
                  on the current plan
        '500':
          description: Something went wrong on Chariot's side. The credits were refunded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '503':
          description: The aligner is unavailable. Any charge was refunded; retry later.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '504':
          description: The alignment timed out. Any charge was refunded; retry later.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - APIKeyHeader: []
components:
  schemas:
    ForcedAlignmentRequest:
      type: object
      required:
        - file
        - text
      properties:
        file:
          type: string
          format: binary
          description: >-
            The audio: WAV, MP3, FLAC, OGG, M4A, AAC or WebM. Video containers
            such as MP4 must contain an audio track.
        text:
          type: string
          description: >-
            The transcript of the audio as plain text, up to 5,000 characters.
            Speaker labels and timestamps are not supported.
        language:
          type: string
          default: hi
          description: >-
            ISO 639-1 code of the spoken language, for example `hi`, `en`, `ta`.
            See `GET /v1/forced-alignment/options` for the full list.
    ForcedAlignment:
      type: object
      required:
        - alignment_id
        - status
        - language
        - filename
        - duration_seconds
        - text_characters
        - credits_used
        - created_at
      properties:
        alignment_id:
          type: string
          format: uuid
        status:
          type: string
          enum:
            - processing
            - completed
            - failed
        language:
          type: string
          description: ISO 639-1 code the audio was aligned as.
        filename:
          type:
            - string
            - 'null'
          description: >-
            Name of the uploaded file, for display. `null` after
            `content_expires_at`.
        duration_seconds:
          type: number
          description: >-
            Duration of the audio, measured by Chariot. This is what you are
            billed for.
        text_characters:
          type: integer
        word_count:
          type:
            - integer
            - 'null'
        credits_used:
          type: integer
          description: >-
            Credits charged: the duration in seconds, rounded up. `0` when a
            failed alignment was refunded.
        loss:
          type:
            - number
            - 'null'
          description: Average alignment loss over the transcript. Lower is better.
        words:
          type:
            - array
            - 'null'
          items:
            $ref: '#/components/schemas/ForcedAlignmentWord'
          description: >-
            One entry per whitespace-separated word of your transcript, in
            order. Present once `status` is `completed`; `null` in lists and
            before completion. Punctuation-only words have `start` equal to
            `end`. `null` after `content_expires_at`.
        text:
          type:
            - string
            - 'null'
          description: >-
            The transcript as aligned. Returned when you create the alignment
            and by its detail; `null` in lists, and once the content has
            expired.
        has_audio:
          type: boolean
          description: >-
            Whether the audio you sent is stored and available from `GET
            /v1/forced-alignment/{alignment_id}/audio`. It is stored just after
            the alignment is created, so it can read `false` for a moment.
            `false` once the content has expired.
        error:
          oneOf:
            - $ref: '#/components/schemas/ForcedAlignmentError'
            - type: 'null'
        created_at:
          type: string
          format: date-time
        started_at:
          type:
            - string
            - 'null'
          format: date-time
        completed_at:
          type:
            - string
            - 'null'
          format: date-time
        content_expires_at:
          type:
            - string
            - 'null'
          format: date-time
          description: >-
            When the words, transcript, filename and stored audio expire under
            your workspace's data retention setting. After it, `words`, `text`
            and `filename` read as `null` and `has_audio` is `false`; duration,
            status and credits remain. `null` means kept until deleted.
    Error:
      type: object
      description: Standard error envelope returned by all endpoints.
      properties:
        statusCode:
          type: integer
          description: HTTP status code, echoed in the body.
        error:
          type: string
          description: Machine-readable error class name.
        message:
          type: string
          description: Human-readable description of what went wrong.
      required:
        - statusCode
        - error
        - message
    ForcedAlignmentWord:
      type: object
      required:
        - text
        - start
        - end
      properties:
        text:
          type: string
          description: >-
            The word, exactly as it appears in your transcript, punctuation
            included.
        start:
          type: number
          description: Start time in seconds from the beginning of the audio.
        end:
          type: number
          description: End time in seconds from the beginning of the audio.
        loss:
          type:
            - number
            - 'null'
          description: >-
            Alignment loss for this word. Lower means the aligner is more
            confident. `null` when not available.
    ForcedAlignmentError:
      type: object
      required:
        - code
        - message
      properties:
        code:
          type: string
          enum:
            - transcript_unalignable
            - audio_too_short
            - aligner_unavailable
            - aligner_timeout
            - interrupted
            - internal_error
          description: >-
            Why the alignment failed. `transcript_unalignable`: the transcript
            has no words that can be aligned. `audio_too_short`: the audio is
            too short to align. `aligner_unavailable`: the aligner could not
            process the request. `aligner_timeout`: the aligner took too long.
            `interrupted`: the request was interrupted on Chariot's side.
            `internal_error`: something went wrong on Chariot's side.
        message:
          type: string
          description: >-
            What went wrong, in plain words. A generic message once the content
            has expired.
  responses:
    Unauthorized:
      description: Authentication failed. The API key is missing, invalid, or expired.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            missing:
              summary: No credentials provided
              value:
                statusCode: 401
                error: UnauthorizedException
                message: No API key or user credentials provided
            invalid:
              summary: Invalid or unknown API key
              value:
                statusCode: 401
                error: UnauthorizedException
                message: Invalid API Key or user credentials
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      in: header
      name: chariotai-api-key
      description: >-
        Your Chariot API key, generated from the dashboard. Send it in the
        `chariotai-api-key` header on every request.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.