---
title: "Create a realtime transcription"
---

> Documentation Index
> Fetch the complete documentation index at: https://docs.cloudraker.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Create a realtime transcription

Path: CloudRaker Paperwork API › Realtime Transcriptions

`POST /v1/realtime/transcriptions`

Creates a live transcription session and returns a `websocket.url` for one client.

Call this from your backend with your API key. Give `websocket.url` to the browser (or any client). The URL carries a single-use ticket that expires after 60 seconds. The client opens the socket and sends raw PCM16 little-endian audio, 16 kHz, mono, as binary frames. The session sends back `partial` and `final` text. The WebSocket upgrade is not an API operation: it is documented on the capability page, not here. Use `POST /v1/realtime/transcriptions/{id}/tickets` to get a new ticket for a reconnect.

**Pricing.** A 5-credit session fee, charged when the first decoder joins, or when a session that no client connected to expires. Then 2 credits per started minute of decoded audio. When the session fails on our side (no capacity, no decoder), you pay nothing. With `finalPass: true`, the batch diarized transcription is billed by the normal audio meters on top (20 credits per minute, minimum 1 minute).

**Data.** Montreal decode, North America session state, the final pass may run in the US; no residency guarantee. The server keeps no transcript: persist the finals your client receives. Without `finalPass`, no audio is kept after close.

**Limits.** A session lasts at most 4 hours (2 hours with `finalPass`). It closes after 5 minutes without audio. It expires when no client connects within 10 minutes. A revoked API key does not end its live sessions.

MCP code mode can create a session, but it cannot stream audio. Send an `idempotency-key`: a retry with the same key and body returns the same session with a fresh ticket and the `idempotent-replay: true` header.

**Learn more:** [Realtime transcription](https://docs.cloudraker.com/paperwork/capabilities/realtime-transcription)

## Authentication

- `bearerAuth`, http, header `Authorization`

## Header parameters

- `idempotency-key` (`createRealtimeTranscription.header.idempotency-key`; string, optional) — A retry with the same key and body returns the same session.
  - minLength 1; maxLength 255

## Request body

_Required._

- `finalPass` (`createRealtimeTranscription.finalPass`; boolean, optional) — Archive the audio as a file and run batch diarized transcription at close. Billed by the normal audio meters (minimum 1 diarized minute).
  - default `false`
- `maxDurationSeconds` (`createRealtimeTranscription.maxDurationSeconds`; integer, optional) — Hard cap on received audio. Default and max 14400 (4 h); default and max 7200 with finalPass.
  - min 60; max 14400
- `metadata` (`createRealtimeTranscription.metadata`; map<string>, optional) — Kept 30 days after close. Do not put personal data here.

## Example request

```json
{
  "finalPass": false,
  "maxDurationSeconds": 60,
  "metadata": {
    "property1": "string",
    "property2": "string"
  }
}
```

## Code samples

### cURL

```bash
curl --request POST \
  --url https://api.cloudraker.com/v1/realtime/transcriptions \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "finalPass": false,
  "maxDurationSeconds": 60,
  "metadata": {
    "property1": "string",
    "property2": "string"
  }
}
'
```

### TypeScript

```typescript
const url = 'https://api.cloudraker.com/v1/realtime/transcriptions';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json', Authorization: 'Bearer <token>'},
  body: JSON.stringify({
    finalPass: false,
    maxDurationSeconds: 60,
    metadata: {property1: 'string', property2: 'string'}
  })
};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://api.cloudraker.com/v1/realtime/transcriptions"

payload = {
    "finalPass": False,
    "maxDurationSeconds": 60,
    "metadata": {
        "property1": "string",
        "property2": "string"
    }
}
headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer <token>"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
```

## Responses

### 201

The session, with `websocket` for the first client.

#### Example

```json
{
  "object": "realtime_transcription",
  "id": "rtt_01KZ0000000000000000000000",
  "status": "created",
  "closeReason": "client_end",
  "audio": {
    "encoding": "pcm_s16le",
    "sampleRate": 16000,
    "channels": 1
  },
  "maxDurationSeconds": -9007199254740991,
  "audioSeconds": 0,
  "billedMinutes": -9007199254740991,
  "finalPass": {
    "enabled": true,
    "status": "disabled",
    "fileId": "string"
  },
  "metadata": {
    "property1": "string",
    "property2": "string"
  },
  "createdAt": "2019-08-24T14:15:22Z",
  "connectedAt": "2019-08-24T14:15:22Z",
  "closedAt": "2019-08-24T14:15:22Z",
  "connectBy": "2019-08-24T14:15:22Z",
  "websocket": {
    "object": "realtime_transcription_ticket",
    "url": "string",
    "expiresAt": "2019-08-24T14:15:22Z"
  }
}
```

- `object` (`createRealtimeTranscription.response.201.object`; string, required)
- `id` (`createRealtimeTranscription.response.201.id`; string, required)
  - example `"rtt_01KZ0000000000000000000000"`
- `status` (`createRealtimeTranscription.response.201.status`; string, required)
  - one of `"created"`, `"active"`, `"closing"`, `"closed"`, `"expired"`, `"failed"`
- `closeReason` (`createRealtimeTranscription.response.201.closeReason`; any of, required)
  - any of:
    - `string`: one of `"client_end"`, `"stopped"`, `"idle_timeout"`, `"max_duration"`, `"credits_exhausted"`, `"worker_unavailable"`, `"too_fast"`, `"internal_error"`
    - `null`
- `audio` (`createRealtimeTranscription.response.201.audio`; object, required)
  - `encoding` (`createRealtimeTranscription.response.201.audio.encoding`; string, required)
  - `sampleRate` (`createRealtimeTranscription.response.201.audio.sampleRate`; number, required)
  - `channels` (`createRealtimeTranscription.response.201.audio.channels`; number, required)
- `maxDurationSeconds` (`createRealtimeTranscription.response.201.maxDurationSeconds`; integer, required)
  - min -9007199254740991; max 9007199254740991
- `audioSeconds` (`createRealtimeTranscription.response.201.audioSeconds`; number, required) — Received audio, in seconds.
- `billedMinutes` (`createRealtimeTranscription.response.201.billedMinutes`; integer, required) — Minutes charged so far.
  - min -9007199254740991; max 9007199254740991
- `finalPass` (`createRealtimeTranscription.response.201.finalPass`; object, required)
  - `enabled` (`createRealtimeTranscription.response.201.finalPass.enabled`; boolean, required)
  - `status` (`createRealtimeTranscription.response.201.finalPass.status`; string, required)
    - one of `"disabled"`, `"recording"`, `"uploading"`, `"processing"`, `"ready"`, `"failed"`, `"skipped"`
  - `fileId` (`createRealtimeTranscription.response.201.finalPass.fileId`; string | null, required) — A normal /v1 file (`GET /v1/files/{id}`).
- `metadata` (`createRealtimeTranscription.response.201.metadata`; any of, required)
  - any of: `map<string>`, `null`
- `createdAt` (`createRealtimeTranscription.response.201.createdAt`; string, required)
  - format `date-time`; pattern `^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$`
- `connectedAt` (`createRealtimeTranscription.response.201.connectedAt`; any of, required)
  - any of: `string`, `null`
- `closedAt` (`createRealtimeTranscription.response.201.closedAt`; any of, required)
  - any of: `string`, `null`
- `connectBy` (`createRealtimeTranscription.response.201.connectBy`; any of, required) — Connect before this time, or the session expires. Null once a client connected.
  - any of: `string`, `null`
- `websocket` (`createRealtimeTranscription.response.201.websocket`; object, optional) — Only in the create response.
  - `object` (`createRealtimeTranscription.response.201.websocket.object`; string, required)
  - `url` (`createRealtimeTranscription.response.201.websocket.url`; string, required) — The `wss://` URL to open. It carries a single-use ticket that expires after 60 seconds.
  - `expiresAt` (`createRealtimeTranscription.response.201.websocket.expiresAt`; string, required)
    - format `date-time`; pattern `^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$`

### 400

`invalid_request` — the body failed validation.

### 401

Missing or invalid credential.

### 402

`credits_exhausted`, or `feature_not_in_plan` — your plan does not include realtime transcription.

### 403

The credential may not use the /v1 API.

### 409

`idempotency_conflict` — the key was used with another body.

### 429

Rate limited. The `/v1` API allows at least **67 requests per minute per organization** (about 1,000 requests per 15 minutes) — a guaranteed floor, enforced per edge location, so a geographically spread caller may get more. Wait for the `Retry-After` interval and retry — the error is `retryable`.

#### Example

```json
{
  "code": "rate_limited",
  "message": "string",
  "retryable": true,
  "requestId": "string",
  "docUrl": "string"
}
```

- `code` (`createRealtimeTranscription.response.429.code`; string, required)
  - one of `"rate_limited"`
- `message` (`createRealtimeTranscription.response.429.message`; string, required)
- `retryable` (`createRealtimeTranscription.response.429.retryable`; boolean, required)
  - one of `true`
- `requestId` (`createRealtimeTranscription.response.429.requestId`; string, required)
- `docUrl` (`createRealtimeTranscription.response.429.docUrl`; string, optional)

### 503

`capacity_unavailable` — no capacity is free. Nothing was charged. Retry.


Source: https://docs.cloudraker.com/paperwork/api/realtime-transcriptions/create-realtime-transcription/index.md
