Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions docs/api-ref/realtime-transcription-websocket.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ import realtimeSchema from "!asyncapi-schema-loader!@site/spec/realtime.yaml";
<h2 className="openapi__method-endpoint-path">wss://eu.rt.speechmatics.com/v2/</h2>
</pre>

:::info
You can either pin to a specific region for data residency or connect to `wss://global.rt.speechmatics.com/v2/`, which automatically routes each connection to the nearest region for lowest latency. See [Supported endpoints](/get-started/authentication#supported-endpoints).
:::
Comment thread
jimmypsm marked this conversation as resolved.

## Protocol overview

A basic Realtime session will have the following message exchanges:
Expand Down
25 changes: 17 additions & 8 deletions docs/get-started/authentication.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ curl -X GET "https://eu1.asr.api.speechmatics.com/v2/jobs/" \
</TabItem>
<TabItem value="real-time" label="Realtime transcription" default>

For server-side calls, your API key must be provided in the header of the [Websocket connection request](/api-ref/realtime-transcription-websocket#handshake-responses). For example:
For server-side calls, your API key must be provided in the header of the [WebSocket connection request](/api-ref/realtime-transcription-websocket#handshake-responses). For example:
```bash
GET /v2/ HTTP/1.1
Host: eu.rt.speechmatics.com
Expand All @@ -43,7 +43,7 @@ Connection: Upgrade
Authorization: Bearer YOUR_API_KEY
User-Agent: Python/3.8 websockets/8.1
```
For client-side calls, we recommend using [temporary keys](#temporary-keys) (JWTs) to authenticate your requests. These can be passed as a query param to the [Websocket connection request](/api-ref/realtime-transcription-websocket#handshake-responses) URL. For example:
For client-side calls, we recommend using [temporary keys](#temporary-keys) (JWTs) to authenticate your requests. These can be passed as a query param to the [WebSocket connection request](/api-ref/realtime-transcription-websocket#handshake-responses) URL. For example:

```bash
wss://eu.rt.speechmatics.com/v2?jwt=$TEMP_KEY
Expand Down Expand Up @@ -87,10 +87,17 @@ The EU2 and US2 Batch SaaS endpoints are provided for enterprise customer high a

Speechmatics Realtime SaaS supports the following endpoints for production use:

| Customer type | Region | Endpoint |
| ------------- | ------------ | ---------------------- |
| All | EU1 (Europe) | eu.rt.speechmatics.com |
| All | US1 (USA) | us.rt.speechmatics.com |
| Region | Endpoint |
| ------------ | ------------------------------ |
| All regions | **global.rt.speechmatics.com** |
| EU1 (Europe) | **eu.rt.speechmatics.com** |
| US1 (USA) | **us.rt.speechmatics.com** |

`global.rt.speechmatics.com` automatically routes each connection to the nearest region for lowest latency, so you don't have to select one. The regional endpoints remain available if you want to pin to a specific region.

:::warning
`global.rt.speechmatics.com` may route a connection to any region. If you have data residency or compliance requirements, use a regional endpoint (`eu.rt.speechmatics.com` or `us.rt.speechmatics.com`) instead.
Comment thread
jimmypsm marked this conversation as resolved.
:::
</TabItem>
</Tabs>

Expand Down Expand Up @@ -147,7 +154,9 @@ curl -X GET "https://eu1.asr.api.speechmatics.com/v2/jobs/" \
</TabItem>
<TabItem value="realtime" label="Realtime transcription">

For Realtime transcription, temporary keys allow the end-user to start a websocket connection with Speechmatics directly, without exposing your long-lived API key. This will reduce the latency of transcription, as well as development effort.
For Realtime transcription, temporary keys allow the end-user to start a WebSocket connection with Speechmatics directly, without exposing your long-lived API key. This will reduce the latency of transcription, as well as development effort.

A Realtime temporary key is not tied to a region. The same key works with any Realtime endpoint, including `global.rt.speechmatics.com`.
Comment thread
jimmypsm marked this conversation as resolved.

The example request below will create a temporary key which can be used to start any number of Realtime transcription settings for 60 seconds:

Expand Down Expand Up @@ -177,7 +186,7 @@ Note that when starting a Realtime transcription session in the browser, you mus
|--------------|-----------|-----------------------------------------------------------
| `ttl` | Yes | Integer: 60-86400. The temporary key's time to live in seconds. **Note** We suggest using the shortest TTL possible to minimise security risks.
| `client_ref` | No | String. When provided, `batch` tokens can only create and retrieve jobs with that reference; without it, they can access any job. **Must** be set when temporary keys are exposed to end-users to prevent accessing another user's data. `client_ref` is ignored when requesting `rt` tokens.
| `region` | No | String: `eu` (default), `usa`, or `au` (Batch transcription only). Defines the region where the temporary key is valid.
| `region` | No | String: `eu` (default), `usa`, or `au` (Batch transcription only). Accepted for backward compatibility; the key is no longer scoped to a region.


## Next steps
Expand Down