---
updatedAt: 2025-06-09T21:57:54.000Z
agentTools:
  projectIndex: https://docs.apptek.com/llms.txt
---

# Query text to speech request status and retrieve results

Check on the status of the request which has been successfully submitted, using the `request_id` received on submission of that request.

If results are available, the body of the response will contain a WAV file with the synthesized speech.
Otherwise, HTTP status code 204 is returned with an empty response.  Use the `x-status` header in the response to determine the request status.

## Response body

If the request status is “Ready” or “Completed”, the body of the response will contain the binary WAV with the synthesized speech.

## Response headers

* `x-status`	- One of the following indicating the current status of the request:

<Table align={["left","left"]}>
  <thead>
    <tr>
      <th>
        Status
      </th>

      <th>
        Description
      </th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        “Received”
      </td>

      <td>
        The request has been received but processing hasn’t started
      </td>
    </tr>

    <tr>
      <td>
        “Queued”
      </td>

      <td>
        One or more sub-components of the request have been queued for processing
      </td>
    </tr>

    <tr>
      <td>
        “Pending”
      </td>

      <td>
        All the components of the request have been queued for processing
      </td>
    </tr>

    <tr>
      <td>
        “Ready”
      </td>

      <td>
        All components of the request are finished processing but the user callback to the user has not occurred.
      </td>
    </tr>

    <tr>
      <td>
        “Completed”
      </td>

      <td>
        The request has finished processing and the user callback, if provided has been called.
      </td>
    </tr>

    <tr>
      <td>
        “Failed”
      </td>

      <td>
        An error occurred processing the request.
      </td>
    </tr>
  </tbody>
</Table>

* `x-error`	- If the request failed, this would contain an error message.
* `x-progress`	- Percentage (0-100) of the input that has completed processing.
* `x-userdata`	- This will contain the user data supplied with the original request.

## Details

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "apptek-apis",
    "version": "2.2"
  },
  "servers": [
    {
      "url": "https://api.apptek.com/api/v2"
    }
  ],
  "components": {
    "securitySchemes": {
      "sec0": {
        "type": "apiKey",
        "in": "header",
        "name": "x-token"
      }
    }
  },
  "security": [
    {
      "sec0": []
    }
  ],
  "paths": {
    "/texttospeech/{request_id}": {
      "get": {
        "summary": "Query text to speech request status and retrieve results",
        "description": "Check on the status of the request which has been successfully submitted, using the `request_id` received on submission of that request.\n\nIf results are available, the body of the response will contain a WAV file with the synthesized speech.\nOtherwise, HTTP status code 204 is returned with an empty response.  Use the `x-status` header in the response to determine the request status.",
        "operationId": "query-request-status-and-retrieve-results",
        "parameters": [
          {
            "name": "request_id",
            "in": "path",
            "description": "The request_id received when submitting the request",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "name": "x-token",
            "in": "header",
            "description": "API Key",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "200",
            "content": {
              "text/plain": {
                "examples": {
                  "OK. Results in the BODY of the response": {
                    "value": ""
                  }
                }
              }
            }
          },
          "204": {
            "description": "204",
            "content": {
              "text/plain": {
                "examples": {
                  "OK. The request has not finished processing": {
                    "value": ""
                  }
                }
              }
            }
          },
          "400": {
            "description": "400",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {}
                }
              }
            }
          },
          "404": {
            "description": "404",
            "content": {
              "text/plain": {
                "examples": {
                  "Couldn’t find a request matching the request_id": {
                    "value": ""
                  }
                }
              }
            }
          },
          "500": {
            "description": "500",
            "content": {
              "text/plain": {
                "examples": {
                  "Result": {
                    "value": ""
                  }
                }
              }
            }
          }
        },
        "deprecated": false
      }
    }
  },
  "x-readme": {
    "headers": [],
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "x-readme-fauxas": true
}
```