GET
/
tts-result
/
{run_id}
curl --request GET \
  --url https://client.camb.ai/apis/tts-result/{run_id} \
  --header 'x-api-key: <api-key>'
"<string>"

Retrieves the result of a specific Text-to-Speech run using the provided run_id. Depending on the specified output_type, this endpoint returns one of two responses:

  • raw_bytes: A streaming response containing the Text-to-Speech generated audio in FLAC format (Used by default).
  • file_url: A JSON containing a URL pointing to the stored Text-to-Speech output audio file.

Example for Saving the File:

tts_result = requests.get(
    f"https://client.camb.ai/apis/tts-result/RUN_ID", # Replace with a `run_id` for a run you created.
    headers={"x-api-key": API_KEY}, stream=True
)

with open("saved_stream.flac", "wb") as f:
    for chunk in tts_result.iter_content(chunk_size=1024):
        f.write(chunk)
stream=True is required to stream the file when raw_bytes is specified, else the file will be downloaded in memory and then saved to disk.

Authorizations

x-api-key
string
header
required

The x-api-key is a custom header required for authenticating requests to our API. Include this header in your request with the appropriate API key value to securely access our endpoints. You can find your API key(s) in the 'API' section of our studio website.

Path Parameters

run_id
integer
required

The unique identifier for the run, which was generated during the creation process and returned upon task completion.

Query Parameters

output_type
enum<string>
default:raw_bytes

The type of the Text-to-Speech output to return. Either streamable audio bytes or a URL to the generated file.

Available options:
raw_bytes,
file_url

Response

200
audio/flac
Successful Response

The generated audio file bytes in FLAC format, representing the speech created from the Text to Speech task.