#Hi, I'm using the Typescript SDK for the Speech to text API like this : ```await elevenLabsClient.

1 messages · Page 1 of 1 (latest)

meager moatBOT
#
AI-generated Answer for klouzo35

The error message indicates that the additional_formats parameter is not being passed in the expected format. The API expects a valid JSON object with specific options for each format.

To resolve this, ensure that your additional_formats parameter is structured correctly. Here's an example of how you might adjust your code:

await elevenLabsClient.speechToText.convert({
  file: file,
  model_id: 'scribe_v1',
  additional_formats: [
    {
      format: 'segmented_json',
      // Add any required options for the format here
    }
  ],
});

Make sure to include any necessary options for the segmented_json format if required by the API. If the format does not require additional options, you can leave it as shown above. If the issue persists, double-check the API documentation for any specific requirements related to the additional_formats parameter.

visual plover
#

But it is the same

meager moatBOT
#
AI-generated Answer for klouzo35

The error message indicates that the additional_formats parameter is not being passed in the correct format. While your code snippet appears to follow the expected structure, the issue might be related to how the JSON object is being constructed or passed.

Here are a few steps to troubleshoot and resolve the issue:

  1. Verify the Format: Ensure that the additional_formats parameter is a valid JSON array of objects. Each object should include a format key and any additional options required for that format. For example:

    additional_formats: [
      {
        format: 'segmented_json',
        option1: 'value1', // Add any required options here
      },
    ]
    
  2. Check API Documentation: Confirm the exact structure expected for additional_formats in the API References. Ensure that the format and options you are using are supported.

  3. Validate Input Data: Ensure that the file and model_id parameters are correctly set and compatible with the API. For example, model_id should match a valid model like 'scribe_v1'.

  4. Debugging: Log the additional_formats object before making the API call to ensure it is being constructed correctly:

    console.log(additional_formats);
    

If the issue persists, you may need to provide more details about the exact structure of your additional_formats object or consult the API documentation for further clarification.

neon parrot
#

Hi, I'm getting the exact same error trying to use format: "txt"