Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add Streaming overview page #109

Merged
merged 1 commit into from
Jul 29, 2024
Merged
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
1 change: 1 addition & 0 deletions fern/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ navigation:
- getResponse
- purgeRequestData
- section: Streaming
summary: ./pages/streaming-overview.mdx
contents:
- realtime/createTemporaryToken
- realtime/realtime
Expand Down
43 changes: 43 additions & 0 deletions fern/pages/streaming-overview.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
---
title: Streaming
---

The Streaming Speech-to-Text service leverages [WebSockets](https://developer.mozilla.org/en-US/docs/Web/API/WebSockets_API). This section details the endpoints and procedures necessary for utilizing the streaming functionality, including:

- [POST endpoint](/docs/api-reference/streaming/create-temporary-token) to obtain a temporary token for authentication
- [WebSockets API reference](/docs/api-reference/streaming/realtime) with detailed information on managing WebSocket connections for streaming

Below, you'll also find information on error codes and limits.

## Close and error codes

The WebSocket specification provides [standard errors](https://github.com/Luka967/websocket-close-codes). Additionally, the API returns application-level errors for well-known scenarios:

| Error Condition | Status Code | Message |
| -------------------------------------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------ |
| bad sample rate | `4000` | "Sample rate must be a positive integer" |
| auth failed | `4001` | "Not Authorized" |
| insufficient funds | `4002` | "Insufficient Funds" |
| free tier user | `4003` | "This feature is paid-only and requires you to add a credit card. Please visit https://app.assemblyai.com/ to add a credit card to your account" |
| attempt to connect to nonexistent session id | `4004` | "Session not found" |
| session expired | `4008` | "Session Expired" |
| attempt to connect to closed session | `4010` | "Session previously closed" |
| rate limited | `4029` | "Client sent audio too fast" |
| unique session violation | `4030` | "Session is handled by another WebSocket" |
| session times out | `4031` | "Session idle for too long" |
| audio too short | `4032` | "Audio duration is too short" |
| audio too long | `4033` | "Audio duration is too long" |
| audio too small to transcode | `4034` | "Audio too small to transcode" |
| bad schema | `4101` | "Endpoint received a message with an invalid schema" |
| too many streams | `4102` | "This account has exceeded the number of allowed streams" |
| reconnected | `4103` | "This session has been reconnected. This WebSocket is no longer valid" |
| word boost parameter parsing failed | `4104` | "Could not parse word boost parameter" |

## Quotas and Limits

The following limits are imposed to ensure performance and service quality:

- **Idle Sessions** - Sessions that don't receive audio within 1 minute will be terminated.
- **Session Limit** - 100 sessions at a time for paid users. Please contact us if you need to increase this limit. Free-tier users must upgrade their account to use real-time streaming.
- **Session Uniqueness** - Only one WebSocket per session.
- **Audio Sampling Rate Limit** - Customers must send data in near real-time. If a client sends data faster than 1 second of audio per second for longer than 1 minute, we'll terminate the session.
Loading