# Create Stream

`GET https://api.torbox.app/v1/api/stream/createstream`

- Operation ID: `create_stream`
- Group: Stream
- Auth: API key, `Authorization: Bearer <api key>` (Sign in with TorBox gives the same key)

### Overview

Creates a new stream based off of the data provided.

#### Selecting Subtitles and Audios

We use indexes to determine which audio and subtitle you would like to select. To view all available indexes, you must request this endpoint intially with "null" or 0, for the chosen indexes. This will return a metadata dictionary in the response, which will contain the list of audios and subtitles available for this stream. When choosing a subtitle or audio stream, use the **relative index**, starting from 0, rather than the "index" value. This is important for selecting the correct index. Once your user gets a selection of audios and subtitles available, you can submit this to the endpoint again to get the chosen stream.

- **null** - Selecting no subtitle. Not available for audio as one must always be selected.

- **0** - Selecting first subtitle or audio


#### Selecting Resolution

Similar to the subtitles and audios, we use indexes to determine the resolution chosen. Unlike the above, these are predetermined. We do not upscale video, so if for example, you pass a 1080p video, and request it with resolution, 7, it will stay at 1080p. Please see the below for options.

- **null** - Original video resolution. No downscaling will take place.

- **0** - 144p

- **1** - 240p

- **2** - 360p

- **3** - 480p

- **4** - 720p

- **5** - 1080p

- **6** - 1440p

- **7** - 2160p


#### Types

This endpoint allows you to handle torrents, usenet and web downloads all in one. This is why the "type" parameter is available. It defaults to "torrent".

- **torrent** - Torrents

- **usenet** - Usenet downloads

- **webdownload** - Web Downloads


#### Important Notes

- Only text based subtitles are supported. If a non-text based subtitle is selected, it will be ignored.

- If a subtitle or audio index does not exist on the stream, it will be ignored.

- There are a lot of edge-case videos, if something doesn't work, don't hesitate to report the download hash and file_id of the failing video file.

- This is a **Pro** only feature.


### Authorization

Requires an API key using the Authorization Bearer Header.

## Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | query | integer | yes | The ID of the type of download. |
| `file_id` | query | integer | no | The file ID inside of the download you would like to stream. |
| `type` | query | string | no | The type of download that this is. If choosing the incorrect one, the ID will be incorrect. |
| `chosen_subtitle_index` | query | any | no | The relative index of the subtitle you would like to stream. This is default null for none. 0 is the first subtitle found. |
| `chosen_audio_index` | query | integer | no | The relative index of the subtitle you would like to stream. Defaults to 0 for the first audio stream found inside the file. Cannot be null. |
| `chosen_resolution_index` | query | any | no | The index of the resolution you would like to stream. This is default null for original. |
| `scrobbling_enabled` | query | boolean | no |  |

## Responses

- `200` Successful Response
- `400` Bad Request
- `401` Unauthorized
- `403` Forbidden
- `404` Not Found
- `422` Validation Error
- `429` Too Many Requests
- `500` Internal Server Error
- `503` Service Unavailable
