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

# Get async operation

> Poll the status of an asynchronous or batch synthesis job. Substitute the full operation `name` returned by the submitting endpoint (including its slashes) directly into the URL path. Poll at a modest interval (for example every 5 seconds): short inputs typically complete within seconds, while long inputs and large batches can take minutes.



## OpenAPI

````yaml get /lro/v1alpha/{name}
openapi: 3.0.0
info:
  title: Inworld Text-to-Speech API
  version: v1
  contact:
    name: Inworld AI
    url: https://inworld.ai
    email: support@inworld.ai
servers:
  - url: https://api.inworld.ai
security:
  - inworld_basic: []
tags:
  - name: TextToSpeech
  - name: AudioPromptPreparationService
  - name: SpeechToPhonemesService
paths:
  /lro/v1alpha/{name}:
    get:
      tags:
        - TextToSpeech
      summary: Get operation
      description: >-
        Poll the status of an asynchronous or batch synthesis job. Substitute
        the full operation `name` returned by the submitting endpoint (including
        its slashes) directly into the URL path. Poll at a modest interval (for
        example every 5 seconds): short inputs typically complete within
        seconds, while long inputs and large batches can take minutes.
      operationId: Operations_GetOperation
      parameters:
        - name: name
          in: path
          required: true
          schema:
            type: string
          description: >-
            Full operation resource name returned by the async or batch
            synthesis endpoint, in the format
            `workspaces/{workspace}/ttsAsyncJobs/{job}/operations/{operation}`
            or
            `workspaces/{workspace}/ttsBatchJobs/{batch}/operations/{operation}`.
            The embedded slashes are part of the path.
          example: >-
            workspaces/{workspace}/ttsAsyncJobs/8f14e45f-ceea-4673-93d8-04f724c8a1b2/operations/1784837936461-p0sEhU
      responses:
        '200':
          description: A successful response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/longrunningOperation'
              examples:
                running:
                  summary: Job still running
                  value:
                    name: >-
                      workspaces/{workspace}/ttsAsyncJobs/8f14e45f-ceea-4673-93d8-04f724c8a1b2/operations/1784837936461-p0sEhU
                    done: false
                completed:
                  summary: Job completed
                  value:
                    name: >-
                      workspaces/{workspace}/ttsAsyncJobs/8f14e45f-ceea-4673-93d8-04f724c8a1b2/operations/1784837936461-p0sEhU
                    done: true
                    response:
                      '@type': >-
                        type.googleapis.com/ai.inworld.tts.v1.SynthesizeSpeechAsyncResponse
                      audioUri: >-
                        https://storage.googleapis.com/…/audio.mp3?X-Goog-Signature=…
                      timestampsUri: >-
                        https://storage.googleapis.com/…/timestamps.json?X-Goog-Signature=…
                      expireTime: '2026-07-30T12:00:00Z'
        4XX:
          description: An unexpected error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/rpcStatus'
      x-codeSamples:
        - lang: bash
          label: cURL
          source: >-
            curl --location
            'https://api.inworld.ai/lro/v1alpha/workspaces/{workspace}/ttsAsyncJobs/{job}/operations/{operation}'
            \

            --header "Authorization: Basic $INWORLD_API_KEY"
        - lang: python
          label: Python
          source: >-
            import time

            import requests


            operation_name =
            "workspaces/{workspace}/ttsAsyncJobs/{job}/operations/{operation}"

            url = f"https://api.inworld.ai/lro/v1alpha/{operation_name}"

            headers = {"Authorization": "Basic <api-key>"}


            while True:
                operation = requests.get(url, headers=headers).json()
                if operation.get("done"):
                    break
                time.sleep(5)

            if "error" in operation:
                raise RuntimeError(operation["error"]["message"])

            result = operation["response"]

            # Signed URLs: download WITHOUT an Authorization header.

            audio = requests.get(result["audioUri"]).content

            open("output.mp3", "wb").write(audio)
        - lang: javascript
          label: JavaScript
          source: >-
            const operationName =
              'workspaces/{workspace}/ttsAsyncJobs/{job}/operations/{operation}';
            const url = `https://api.inworld.ai/lro/v1alpha/${operationName}`;

            const headers = { Authorization: 'Basic <api-key>' };


            let operation;

            do {
              await new Promise((r) => setTimeout(r, 5000));
              operation = await (await fetch(url, { headers })).json();
            } while (!operation.done);


            if (operation.error) throw new Error(operation.error.message);


            // Signed URLs: download WITHOUT an Authorization header.

            const audio = await (await
            fetch(operation.response.audioUri)).arrayBuffer();
components:
  schemas:
    longrunningOperation:
      type: object
      description: >-
        A [google.longrunning.Operation](https://google.aip.dev/151) tracking an
        asynchronous or batch synthesis job.
      properties:
        name:
          type: string
          description: >-
            Server-assigned operation resource name, in the format
            `workspaces/{workspace}/ttsAsyncJobs/{job}/operations/{operation}`
            for async jobs or
            `workspaces/{workspace}/ttsBatchJobs/{batch}/operations/{operation}`
            for batch jobs. Pass it verbatim as the path of the Get operation
            endpoint to poll for completion.
          example: >-
            workspaces/{workspace}/ttsAsyncJobs/8f14e45f-ceea-4673-93d8-04f724c8a1b2/operations/1784837936461-p0sEhU
        metadata:
          description: >-
            Service-specific metadata associated with the operation. Not
            populated for TTS jobs yet; job metadata is planned for a later
            release, so do not write code that depends on this field staying
            absent.
          nullable: true
          allOf:
            - $ref: '#/components/schemas/protobufAny'
        done:
          type: boolean
          description: >-
            If `false`, the job is still running. If `true`, the job has
            finished and exactly one of `error` or `response` is set.
        error:
          $ref: '#/components/schemas/rpcStatus'
        response:
          description: >-
            Set when the job succeeded. Its `@type` identifies which kind: an
            async job carries SynthesizeSpeechAsyncResponse, a batch job
            SynthesizeSpeechBatchResponse.
          oneOf:
            - $ref: '#/components/schemas/ttsv1SynthesizeSpeechAsyncResponse'
            - $ref: '#/components/schemas/ttsv1SynthesizeSpeechBatchResponse'
    rpcStatus:
      type: object
      properties:
        code:
          type: integer
          format: int32
          description: >-
            The error code, as specified by [gRPC status
            codes](https://grpc.io/docs/guides/status-codes/).
          example: 5
        message:
          type: string
          description: A short description of the error.
          example: 'Unknown voice: John not found!'
        details:
          type: array
          items:
            $ref: '#/components/schemas/protobufAny'
          example: []
    protobufAny:
      type: object
      properties:
        '@type':
          type: string
      additionalProperties: {}
    ttsv1SynthesizeSpeechAsyncResponse:
      type: object
      description: >-
        Result of a completed asynchronous synthesis job, packed into the
        operation's `response` field. The download URLs are pre-signed and
        time-limited: fetch them without an `Authorization` header, and before
        `expireTime`.
      properties:
        '@type':
          type: string
          description: >-
            Type of the serialized message, always
            `type.googleapis.com/ai.inworld.tts.v1.SynthesizeSpeechAsyncResponse`.
          example: type.googleapis.com/ai.inworld.tts.v1.SynthesizeSpeechAsyncResponse
        audioUri:
          type: string
          description: >-
            Pre-signed download URL for the synthesized audio, in the format
            requested via `audioConfig.audioEncoding`.
          example: https://storage.googleapis.com/…/audio.mp3?X-Goog-Signature=…
        timestampsUri:
          type: string
          description: >-
            Pre-signed download URL for the timestamp alignment JSON. Only
            present when `timestampType` was set in the request.
          example: https://storage.googleapis.com/…/timestamps.json?X-Goog-Signature=…
        expireTime:
          type: string
          format: date-time
          description: >-
            Time at which the download URLs expire, approximately 7 days after
            job completion.
          example: '2026-07-30T12:00:00Z'
    ttsv1SynthesizeSpeechBatchResponse:
      type: object
      description: >-
        Result of a completed batch, packed into the operation's `response`
        field. A batch's per-item URLs do not fit in one response, so this names
        a results *file* instead. The URL is pre-signed and time-limited: fetch
        it without an `Authorization` header, and before `expireTime`.
      properties:
        '@type':
          type: string
          description: >-
            Type of the serialized message, always
            `type.googleapis.com/ai.inworld.tts.v1.SynthesizeSpeechBatchResponse`.
          example: type.googleapis.com/ai.inworld.tts.v1.SynthesizeSpeechBatchResponse
        resultsUri:
          type: string
          description: >-
            Pre-signed download URL for the results file, whose contents are
            described by SynthesizeSpeechBatchResults.
          example: https://storage.googleapis.com/…/results.json?X-Goog-Signature=…
        expireTime:
          type: string
          format: date-time
          description: >-
            Time at which the results file and every audio URL inside it expire,
            approximately 7 days after the batch completes.
          example: '2026-08-13T18:13:47Z'
  securitySchemes:
    inworld_basic:
      type: apiKey
      in: header
      name: Authorization
      description: >-
        Your [authentication](../../../api-reference/introduction) credentials.
        For Basic authentication, please populate `Basic $INWORLD_API_KEY`. You
        can create a key in one command with the [Inworld
        CLI](../../../tts/resources/inworld-cli): `inworld workspace add-key`.

````