---
title: "Create a transcription"
description: "Transcribes audio. Follows OpenAI's Audio Transcriptions API. `verbose_json` returns the transcript's `language`, `duration` and timed `segments`, and `words` where the provider times them. `srt` and `vtt` come back as plain text. Priced per minute of audio sent. Send Respan parameters in the `X-Data-Respan-Params` header (base64 JSON)."
---

<a id="playground-button:docs/apis/gateway/create-transcription"></a>

**POST** `https://gateway.respan.ai/v1/audio/transcriptions`

Transcribes audio. Follows OpenAI's Audio Transcriptions API. `verbose_json` returns the transcript's `language`, `duration` and timed `segments`, and `words` where the provider times them. `srt` and `vtt` come back as plain text. Priced per minute of audio sent. Send Respan parameters in the `X-Data-Respan-Params` header (base64 JSON).

## Servers

`https://gateway.respan.ai`: Respan gateway

## Authentication

### RespanApiKey

Use your Respan API key for Respan API authentication. Enter only the Respan API key value; clients send Authorization: Bearer &lt;RESPAN_API_KEY&gt;. For /api/responses, provider credentials such as Perplexity, OpenAI, or Azure OpenAI go in Settings -&gt; Providers or respan_params.credential_override in the request body, not in this authentication field.

HTTP scheme: `bearer`; format: `Respan API key`.


```http
Authorization: Bearer $RESPAN_API_KEY
```


## Headers


| Parameter | Type | Required | Description and constraints |
| --- | --- | --- | --- |
| `X-Data-Respan-Params` | `string` | Optional | Base64-encoded JSON object of Respan request parameters. |


## Request body

A request body is required.

### multipart/form-data


| Field | Type | Requirement | Description and constraints |
| --- | --- | --- | --- |
| `$` | `object` | Required body | - |
| `model` | `string` | Required in parent | The transcription model, such as `gpt-4o-transcribe`. |
| `file` | `string` | Required in parent | The audio to transcribe.<br />Format: `binary` |
| `language` | `string` | Optional | Language hint, such as `en`, where the provider takes it. Detected if left out. |
| `prompt` | `string` | Optional | Text to guide spelling or style, where the provider takes it. |
| `temperature` | `number` | Optional | Sampling temperature, where the provider takes it. |
| `response_format` | `string` | Optional | `json` by default.<br />Allowed: `"json"`, `"verbose_json"`, `"text"`, `"srt"`, `"vtt"` |
| `stream` | `boolean` | Optional | `true` to get `transcript.text.*` events, where the provider takes it. |
| `provider` | `object` | Optional | Settings only one provider takes, as `{"options": {"<provider id>": {...}}}`. A call carries the settings of the provider it goes to and ignores the rest. A key the provider does not list, or one that another field already sets, is refused with `400` naming `provider.options.<id>.<key>`. In a form, send it as JSON text.<br />Additional properties are allowed |


<details class="api-schema-source">
<summary>OpenAPI request schema</summary>


```json
{
  "type": "object",
  "required": [
    "model",
    "file"
  ],
  "properties": {
    "model": {
      "type": "string",
      "description": "The transcription model, such as `gpt-4o-transcribe`."
    },
    "file": {
      "type": "string",
      "description": "The audio to transcribe.",
      "format": "binary"
    },
    "language": {
      "type": "string",
      "description": "Language hint, such as `en`, where the provider takes it. Detected if left out."
    },
    "prompt": {
      "type": "string",
      "description": "Text to guide spelling or style, where the provider takes it."
    },
    "temperature": {
      "type": "number",
      "description": "Sampling temperature, where the provider takes it."
    },
    "response_format": {
      "type": "string",
      "description": "`json` by default.",
      "enum": [
        "json",
        "verbose_json",
        "text",
        "srt",
        "vtt"
      ]
    },
    "stream": {
      "type": "boolean",
      "description": "`true` to get `transcript.text.*` events, where the provider takes it."
    },
    "provider": {
      "type": "object",
      "description": "Settings only one provider takes, as `{\"options\": {\"<provider id>\": {...}}}`. A call carries the settings of the provider it goes to and ignores the rest. A key the provider does not list, or one that another field already sets, is refused with `400` naming `provider.options.<id>.<key>`. In a form, send it as JSON text.",
      "additionalProperties": true
    }
  }
}
```

</details>

## Responses

### 200

The transcript as JSON, or as text for `text`, `srt` and `vtt`, or a stream of events.

#### Response headers


| Parameter | Type | Required | Description and constraints |
| --- | --- | --- | --- |
| `X-Respan-Log-Id` | `string` | Optional | ID of the Respan request log for this call. |


#### application/json


| Field | Type | Requirement | Description and constraints |
| --- | --- | --- | --- |
| `$` | `object` | Body | Additional properties are allowed |
| `text` | `string` | Optional | All of the transcript's text. |
| `language` | `string` | Optional | The language spoken, with `verbose_json`. |
| `duration` | `number` | Optional | The audio's length in seconds, with `verbose_json`. |
| `segments` | `array<object>` | Optional | Timed segments, with `verbose_json`. |
| `segments[]` | `object` | Array item | Additional properties are allowed |
| `segments[].start` | `number` | Optional | - |
| `segments[].end` | `number` | Optional | - |
| `segments[].text` | `string` | Optional | - |
| `segments[].speaker` | `string` | Optional | Who spoke it, if the provider tells speakers apart. |
| `words` | `array<object>` | Optional | Timed words, where the provider reports them. |
| `words[]` | `object` | Array item | Additional properties are allowed |
| `words[].word` | `string` | Optional | - |
| `words[].start` | `number` | Optional | - |
| `words[].end` | `number` | Optional | - |
| `usage` | `object` | Optional | Tokens or seconds of audio billed.<br />Additional properties are allowed |


<details class="api-schema-source">
<summary>OpenAPI response schema</summary>


```json
{
  "type": "object",
  "properties": {
    "text": {
      "type": "string",
      "description": "All of the transcript's text."
    },
    "language": {
      "type": "string",
      "description": "The language spoken, with `verbose_json`."
    },
    "duration": {
      "type": "number",
      "description": "The audio's length in seconds, with `verbose_json`."
    },
    "segments": {
      "type": "array",
      "description": "Timed segments, with `verbose_json`.",
      "items": {
        "type": "object",
        "properties": {
          "start": {
            "type": "number"
          },
          "end": {
            "type": "number"
          },
          "text": {
            "type": "string"
          },
          "speaker": {
            "type": "string",
            "description": "Who spoke it, if the provider tells speakers apart."
          }
        },
        "additionalProperties": true
      }
    },
    "words": {
      "type": "array",
      "description": "Timed words, where the provider reports them.",
      "items": {
        "type": "object",
        "properties": {
          "word": {
            "type": "string"
          },
          "start": {
            "type": "number"
          },
          "end": {
            "type": "number"
          }
        },
        "additionalProperties": true
      }
    },
    "usage": {
      "type": "object",
      "description": "Tokens or seconds of audio billed.",
      "additionalProperties": true
    }
  },
  "additionalProperties": true
}
```

</details>

#### text/plain


| Field | Type | Requirement | Description and constraints |
| --- | --- | --- | --- |
| `$` | `string` | Body | - |


<details class="api-schema-source">
<summary>OpenAPI response schema</summary>


```json
{
  "type": "string"
}
```

</details>

#### text/event-stream


| Field | Type | Requirement | Description and constraints |
| --- | --- | --- | --- |
| `$` | `string` | Body | - |


<details class="api-schema-source">
<summary>OpenAPI response schema</summary>


```json
{
  "type": "string"
}
```

</details>

### 400

The request is malformed, or a field is one the provider cannot take. Fields refused before the call say which one.

#### application/json


| Field | Type | Requirement | Description and constraints |
| --- | --- | --- | --- |
| `$` | `object` | Body | Additional properties are allowed |


<details class="api-schema-source">
<summary>OpenAPI response schema</summary>


```json
{
  "type": "object",
  "additionalProperties": true
}
```

</details>

### 403

The API key is missing, invalid or expired.

#### application/json


| Field | Type | Requirement | Description and constraints |
| --- | --- | --- | --- |
| `$` | `object` | Body | - |
| `detail` | `string` | Required in parent | - |


<details class="api-schema-source">
<summary>OpenAPI response schema</summary>


```json
{
  "type": "object",
  "required": [
    "detail"
  ],
  "properties": {
    "detail": {
      "type": "string"
    }
  }
}
```

</details>

##### Example


```json
{
  "detail": "Your API key is invalid or expired, please check your API key in the platform settings."
}
```


### 429

A rate limit or usage limit was reached. Retry with exponential backoff.

#### application/json


| Field | Type | Requirement | Description and constraints |
| --- | --- | --- | --- |
| `$` | `object` | Body | Additional properties are allowed |


<details class="api-schema-source">
<summary>OpenAPI response schema</summary>


```json
{
  "type": "object",
  "additionalProperties": true
}
```

</details>

## OpenAPI source

The operation and referenced components below retain the complete OpenAPI definitions, including constraints and examples.

<!-- openapi-operation:start -->
<details class="api-schema-source">
<summary>OpenAPI operation</summary>


```json
{
  "summary": "Create a transcription",
  "operationId": "createTranscription",
  "tags": [
    "Gateway"
  ],
  "servers": [
    {
      "url": "https://gateway.respan.ai",
      "description": "Respan gateway"
    }
  ],
  "description": "Transcribes audio. Follows OpenAI's Audio Transcriptions API. `verbose_json` returns the transcript's `language`, `duration` and timed `segments`, and `words` where the provider times them. `srt` and `vtt` come back as plain text. Priced per minute of audio sent. Send Respan parameters in the `X-Data-Respan-Params` header (base64 JSON).",
  "security": [
    {
      "RespanApiKey": []
    }
  ],
  "parameters": [
    {
      "name": "X-Data-Respan-Params",
      "in": "header",
      "required": false,
      "schema": {
        "type": "string"
      },
      "description": "Base64-encoded JSON object of Respan request parameters."
    }
  ],
  "requestBody": {
    "required": true,
    "content": {
      "multipart/form-data": {
        "schema": {
          "type": "object",
          "required": [
            "model",
            "file"
          ],
          "properties": {
            "model": {
              "type": "string",
              "description": "The transcription model, such as `gpt-4o-transcribe`."
            },
            "file": {
              "type": "string",
              "description": "The audio to transcribe.",
              "format": "binary"
            },
            "language": {
              "type": "string",
              "description": "Language hint, such as `en`, where the provider takes it. Detected if left out."
            },
            "prompt": {
              "type": "string",
              "description": "Text to guide spelling or style, where the provider takes it."
            },
            "temperature": {
              "type": "number",
              "description": "Sampling temperature, where the provider takes it."
            },
            "response_format": {
              "type": "string",
              "description": "`json` by default.",
              "enum": [
                "json",
                "verbose_json",
                "text",
                "srt",
                "vtt"
              ]
            },
            "stream": {
              "type": "boolean",
              "description": "`true` to get `transcript.text.*` events, where the provider takes it."
            },
            "provider": {
              "type": "object",
              "description": "Settings only one provider takes, as `{\"options\": {\"<provider id>\": {...}}}`. A call carries the settings of the provider it goes to and ignores the rest. A key the provider does not list, or one that another field already sets, is refused with `400` naming `provider.options.<id>.<key>`. In a form, send it as JSON text.",
              "additionalProperties": true
            }
          }
        }
      }
    }
  },
  "responses": {
    "200": {
      "description": "The transcript as JSON, or as text for `text`, `srt` and `vtt`, or a stream of events.",
      "headers": {
        "X-Respan-Log-Id": {
          "description": "ID of the Respan request log for this call.",
          "schema": {
            "type": "string"
          }
        }
      },
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "text": {
                "type": "string",
                "description": "All of the transcript's text."
              },
              "language": {
                "type": "string",
                "description": "The language spoken, with `verbose_json`."
              },
              "duration": {
                "type": "number",
                "description": "The audio's length in seconds, with `verbose_json`."
              },
              "segments": {
                "type": "array",
                "description": "Timed segments, with `verbose_json`.",
                "items": {
                  "type": "object",
                  "properties": {
                    "start": {
                      "type": "number"
                    },
                    "end": {
                      "type": "number"
                    },
                    "text": {
                      "type": "string"
                    },
                    "speaker": {
                      "type": "string",
                      "description": "Who spoke it, if the provider tells speakers apart."
                    }
                  },
                  "additionalProperties": true
                }
              },
              "words": {
                "type": "array",
                "description": "Timed words, where the provider reports them.",
                "items": {
                  "type": "object",
                  "properties": {
                    "word": {
                      "type": "string"
                    },
                    "start": {
                      "type": "number"
                    },
                    "end": {
                      "type": "number"
                    }
                  },
                  "additionalProperties": true
                }
              },
              "usage": {
                "type": "object",
                "description": "Tokens or seconds of audio billed.",
                "additionalProperties": true
              }
            },
            "additionalProperties": true
          }
        },
        "text/plain": {
          "schema": {
            "type": "string"
          }
        },
        "text/event-stream": {
          "schema": {
            "type": "string"
          }
        }
      }
    },
    "400": {
      "description": "The request is malformed, or a field is one the provider cannot take. Fields refused before the call say which one.",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "additionalProperties": true
          }
        }
      }
    },
    "403": {
      "$ref": "#/components/responses/InvalidApiKey"
    },
    "429": {
      "description": "A rate limit or usage limit was reached. Retry with exponential backoff.",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "additionalProperties": true
          }
        }
      }
    }
  }
}
```

</details>
<!-- openapi-operation:end -->

<!-- openapi-path-item:start -->
<details class="api-schema-source">
<summary>OpenAPI path metadata</summary>


```json
{}
```

</details>
<!-- openapi-path-item:end -->

<!-- openapi-components:start -->
<details class="api-schema-source">
<summary>Referenced OpenAPI components</summary>


```json
{
  "responses": {
    "InvalidApiKey": {
      "description": "The API key is missing, invalid or expired.",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "required": [
              "detail"
            ],
            "properties": {
              "detail": {
                "type": "string"
              }
            }
          },
          "example": {
            "detail": "Your API key is invalid or expired, please check your API key in the platform settings."
          }
        }
      }
    }
  },
  "securitySchemes": {
    "RespanApiKey": {
      "type": "http",
      "scheme": "bearer",
      "bearerFormat": "Respan API key",
      "description": "Use your Respan API key for Respan API authentication. Enter only the Respan API key value; clients send Authorization: Bearer <RESPAN_API_KEY>. For /api/responses, provider credentials such as Perplexity, OpenAI, or Azure OpenAI go in Settings -> Providers or respan_params.credential_override in the request body, not in this authentication field.",
      "x-fern-bearer": {
        "name": "respanApiKey",
        "env": "RESPAN_API_KEY"
      }
    }
  }
}
```

</details>
<!-- openapi-components:end -->
