> For clean Markdown of any page, append `.md` to the page URL.
> For a complete documentation index, see https://docs.sarvam.ai/llms.txt.
> For full documentation content in one file, see https://docs.sarvam.ai/llms-full.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.sarvam.ai/_mcp/server.

# Batch - Download Results

POST https://api.sarvam.ai/speech-to-text/job/v1/download-files
Content-Type: application/json

Generate presigned download URLs for the transcription output files of a completed speech to text bulk job.

**Required body fields:** `job_id` and `files` (array of output filenames such as `"0.json"`). Obtain filenames from the job status response (`job_details[].outputs[].file_name`) after the job reaches `Completed` or `PartiallyCompleted`.

**Method:** POST only (GET returns 405).

Reference: https://docs.sarvam.ai/api-reference-docs/speech-to-text/stt/job/download

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: ''
  version: 1.0.0
paths:
  /speech-to-text/job/v1/download-files:
    post:
      operationId: get-download-links
      summary: Download Files for Speech to Text Bulk Job V1
      description: >-
        Generate presigned download URLs for the transcription output files of a
        completed speech to text bulk job.


        **Required body fields:** `job_id` and `files` (array of output
        filenames such as `"0.json"`). Obtain filenames from the job status
        response (`job_details[].outputs[].file_name`) after the job reaches
        `Completed` or `PartiallyCompleted`.


        **Method:** POST only (GET returns 405).
      tags:
        - subpackage_speechToTextJob
      parameters:
        - name: api-subscription-key
          in: header
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FilesDownloadResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
        '422':
          description: Unprocessable Entity
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
        '429':
          description: Quota Exceeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
        '503':
          description: Service Overloaded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/FilesRequest'
servers:
  - url: https://api.sarvam.ai
    description: Production
components:
  schemas:
    FilesRequest:
      type: object
      properties:
        job_id:
          type: string
          description: UUID of the bulk job returned from job initiation.
        files:
          type: array
          items:
            type: string
          description: >-
            Required. Output filenames to download (e.g. "0.json"). Get these
            from the job status response: job_details[].outputs[].file_name
            after the job completes.
      required:
        - job_id
        - files
      description: >-
        Request body for bulk job upload/download URL generation. Both job_id
        and files are required for download.
      title: FilesRequest
    JobState:
      type: string
      enum:
        - Accepted
        - Pending
        - Running
        - Completed
        - Failed
      title: JobState
    FileSignedURLDetails:
      type: object
      properties:
        file_url:
          type: string
        file_metadata:
          type:
            - object
            - 'null'
          additionalProperties:
            description: Any type
      required:
        - file_url
      title: FileSignedURLDetails
    StorageContainerType:
      type: string
      enum:
        - Azure
        - Local
        - Google
        - Azure_V1
      title: StorageContainerType
    FilesDownloadResponse:
      type: object
      properties:
        job_id:
          type: string
        job_state:
          $ref: '#/components/schemas/JobState'
        download_urls:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/FileSignedURLDetails'
        storage_container_type:
          $ref: '#/components/schemas/StorageContainerType'
      required:
        - job_id
        - job_state
        - download_urls
        - storage_container_type
      title: FilesDownloadResponse
    ErrorCode:
      type: string
      enum:
        - invalid_request_error
        - internal_server_error
        - unprocessable_entity_error
        - insufficient_quota_error
        - invalid_api_key_error
        - authentication_error
        - rate_limit_exceeded_error
        - not_found_error
      title: ErrorCode
    ErrorDetails:
      type: object
      properties:
        message:
          type: string
          description: Message describing the error
        code:
          $ref: '#/components/schemas/ErrorCode'
          description: >-
            Error code for the specific error that has occurred. Refer to the
            error code documentation for more details.
        request_id:
          type: string
          default: ''
          description: 'Unique identifier for the request. Format: date_UUID4'
      required:
        - message
        - code
      title: ErrorDetails
    ErrorMessage:
      type: object
      properties:
        error:
          $ref: '#/components/schemas/ErrorDetails'
          description: Error details
      required:
        - error
      title: ErrorMessage
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: api-subscription-key

```

## Examples



**Request**

```json
{
  "job_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "files": [
    "0.json",
    "1.json"
  ]
}
```

**Response**

```json
{
  "job_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "job_state": "Completed",
  "download_urls": {},
  "storage_container_type": "Azure"
}
```

**SDK Code**

```typescript
import { SarvamAIClient } from "sarvamai";

async function main() {
    const client = new SarvamAIClient({
        apiSubscriptionKey: "YOUR_API_KEY_HERE",
    });
    await client.speechToTextJob.getDownloadLinks({
        job_id: "3fa85f64-5717-4562-b3fc-2c963f66afa6",
        files: [
            "0.json",
            "1.json",
        ],
    });
}
main();

```

```python
from sarvamai import SarvamAI

client = SarvamAI(
    api_subscription_key="YOUR_API_KEY_HERE",
)

client.speech_to_text_job.get_download_links(
    job_id="3fa85f64-5717-4562-b3fc-2c963f66afa6",
    files=[
        "0.json",
        "1.json"
    ],
)

```

```go
package main

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

func main() {

	url := "https://api.sarvam.ai/speech-to-text/job/v1/download-files"

	payload := strings.NewReader("{\n  \"job_id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n  \"files\": [\n    \"0.json\",\n    \"1.json\"\n  ]\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("api-subscription-key", "<apiSubscriptionKey>")
	req.Header.Add("Content-Type", "application/json")

	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.sarvam.ai/speech-to-text/job/v1/download-files")

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

request = Net::HTTP::Post.new(url)
request["api-subscription-key"] = '<apiSubscriptionKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"job_id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n  \"files\": [\n    \"0.json\",\n    \"1.json\"\n  ]\n}"

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.post("https://api.sarvam.ai/speech-to-text/job/v1/download-files")
  .header("api-subscription-key", "<apiSubscriptionKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"job_id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n  \"files\": [\n    \"0.json\",\n    \"1.json\"\n  ]\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.sarvam.ai/speech-to-text/job/v1/download-files', [
  'body' => '{
  "job_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "files": [
    "0.json",
    "1.json"
  ]
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'api-subscription-key' => '<apiSubscriptionKey>',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://api.sarvam.ai/speech-to-text/job/v1/download-files");
var request = new RestRequest(Method.POST);
request.AddHeader("api-subscription-key", "<apiSubscriptionKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"job_id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n  \"files\": [\n    \"0.json\",\n    \"1.json\"\n  ]\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "api-subscription-key": "<apiSubscriptionKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "job_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "files": ["0.json", "1.json"]
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.sarvam.ai/speech-to-text/job/v1/download-files")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

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()
```