> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.formantai.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.formantai.com/_mcp/server.

# Get a text-to-speech batch

GET https://api.voice.formantai.com/v1/tts/batch/{job_id}

Returns the batch's status and, once it finishes, a time-limited link per rendered clip. Poll until `status` is `completed` or `failed`; both are terminal. Every poll mints fresh links. A batch is scoped to the workspace that submitted it and stops resolving one hour after submission.

Reference: https://docs.formantai.com/api-reference/formant-ai-voice-api/text-to-speech/get-tts-batch

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.

## Servers

- `https://api.voice.formantai.com` (Global production, default)
- `https://api.in.voice.formantai.com` (India production)

## Request

### Path parameters

- `job_id` (string, required) — Batch id returned when the batch was submitted.

## Response

### 200

Current batch status, with clip links once finished

- `id` (string, required) — Batch id.
- `status` (enum, required) — `pending` is in-flight. `completed` means at least one clip rendered; `failed` means none did. Both are terminal.
  - Allowed values: `pending`, `completed`, `failed`
- `provider` (string, required) — Provider that voiced the batch.
- `model` (string, required) — Model actually used.
- `audio_format` (enum, required) — Container of every clip: `mp3` (128 kbps, 44.1 kHz) for ElevenLabs; `wav` for the rest, at 44.1 kHz for Sarvam and Smallest and 24 kHz for Vakyam.
  - Allowed values: `mp3`, `wav`
- `clips` (list of TtsBatchClip, optional) — One entry per text, in submission order. Empty while `pending`.
- `audio_url_expires_in` (integer, optional, nullable) — Seconds every `audio_url` in this response stays valid (900), or null when no clip rendered.

## Errors

### 401 Unauthorized Error

Invalid or missing API key

- `error` (ErrorResponseError, optional)

### 404 Not Found Error

Resource not found

- `error` (ErrorResponseError, optional)

### 429 Too Many Requests Error

Rate limit exceeded

- `error` (ErrorResponseError, optional)

## Types

### TtsBatchClip

- `index` (integer, required) — Position of the text in `texts`, starting at 0.
- `audio_url` (string, optional, nullable) — Time-limited link to the clip (WAV, 16-bit PCM, mono). Set when the clip rendered. Fetch it without an Authorization header.
- `error` (string, optional, nullable) — Why the clip did not render, usually the provider's message. Set when `audio_url` is not; that clip is refunded.

### ErrorResponseError

- `message` (string, optional)
- `type` (string, optional)

## Examples

**Response**

```json
{
  "id": "01b5ebec0fd34bcba12451ca79f27ab4",
  "status": "pending",
  "provider": "sarvam",
  "model": "bulbul:v3",
  "audio_format": "mp3",
  "clips": [
    {
      "index": 0,
      "audio_url": "string",
      "error": "string"
    }
  ],
  "audio_url_expires_in": 900
}
```

**SDK Code**

```python
import requests

url = "https://api.voice.formantai.com/v1/tts/batch/01b5ebec0fd34bcba12451ca79f27ab4"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.voice.formantai.com/v1/tts/batch/01b5ebec0fd34bcba12451ca79f27ab4';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.voice.formantai.com/v1/tts/batch/01b5ebec0fd34bcba12451ca79f27ab4"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.voice.formantai.com/v1/tts/batch/01b5ebec0fd34bcba12451ca79f27ab4")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.voice.formantai.com/v1/tts/batch/01b5ebec0fd34bcba12451ca79f27ab4")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.voice.formantai.com/v1/tts/batch/01b5ebec0fd34bcba12451ca79f27ab4', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.voice.formantai.com/v1/tts/batch/01b5ebec0fd34bcba12451ca79f27ab4");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.voice.formantai.com/v1/tts/batch/01b5ebec0fd34bcba12451ca79f27ab4")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```