Begin, Turn and Termination messages, and the same turn detection. To decide between SageMaker, the hosted API and running the stack yourself, see Compare deployment options.
Coding agent skill
Coding agent skill
The
assemblyai-sagemaker skill lets an AI coding agent such as Claude Code, Cursor or Copilot deploy, call, scale and troubleshoot the endpoint for you. Subscribe on AWS Marketplace and copy the model package ARN first; the agent can’t subscribe for you.- Claude Code:
/plugin marketplace add AssemblyAI-Solutions/assemblyai-sagemaker-samples, then/plugin install assemblyai-sagemaker@assemblyai-sagemaker - Cursor, Copilot and other agents that read skills:
npx skills add AssemblyAI-Solutions/assemblyai-sagemaker-samples - Any other agent: copy
SKILL.mdinto its skills folder.
Models
Both models are versions of one AWS Marketplace listing, each with its own model package: AssemblyAI-STT-3.7-Realtime-Agent is version 3.7.0, Universal-3.6 Pro the 1.0.x versions. An endpoint serves the model in the package you deploy. You don’t need to pass
speech_model; if you do, it must name that model. See Model selection for how the models compare.
What one endpoint serves
- Live streaming over
InvokeEndpointWithBidirectionalStream. Send audio as it’s captured and receive partial and final transcripts as the speaker talks. See Stream audio. - Whole-file transcription over
InvokeEndpoint. Send a complete file of up to about a minute and receive every turn at once. See Transcribe a file. - Batch transform jobs over files in Amazon S3, from the same model package.
sagemaker:InvokeEndpointWithBidirectionalStream and sagemaker:InvokeEndpoint on the endpoint’s ARN. Logs and usage metrics go to Amazon CloudWatch in your account.
Deploy the endpoint
You need an AWS account with IAM permissions for SageMaker (AmazonSageMakerFullAccess) and AWS Marketplace subscriptions (AWSMarketplaceManageSubscriptions), and the AWS CLI v2.
1
Subscribe and copy the model package ARN
Open the AssemblyAI realtime listing on AWS Marketplace, choose Continue to subscribe, and accept the offer. Then choose Continue to configuration, select the version (3.7.0 for AssemblyAI-STT-3.7-Realtime-Agent) and Region, and copy the model package ARN. The ARN is specific to the Region; you can find it later under Manage subscriptions.
2
Choose an instance type and check your quota
ml.g7e.2xlarge (one NVIDIA RTX PRO 6000) is the recommended starting point. The model runs one copy on each GPU of an instance. The AWS Marketplace listing shows the types and Regions for each version; AssemblyAI-STT-3.7-Realtime-Agent doesn’t run on ml.g5 or ml.p5.SageMaker needs a quota for each instance type, named like
ml.g7e.2xlarge for endpoint usage, in the Service Quotas console. New accounts often start at 0, so request an increase before you deploy.3
Find or create an execution role
SageMaker assumes an execution role to run the model package. Any role that If you don’t have one, create it, or ask your AWS administrator for its ARN:
sagemaker.amazonaws.com can assume and that has AmazonSageMakerFullAccess works, and one role can serve every endpoint in the account:4
Create the model, endpoint configuration and endpoint
InService once the model is loaded onto every GPU, which takes several minutes. AssemblyAI-STT-3.7-Realtime-Agent also compiles the model for the GPU at startup, except on ml.g7, which takes 15 to 30 minutes. The samples repository’s deploy.py runs the same steps with boto3.
To change a container setting, add an
Environment map to the container in create-model. For Universal-3.6 Pro the main one is MAX_OPEN_STREAMS, the concurrent sessions per GPU (default 32), which you need to change on some GPUs; see Capacity and scaling. For example, on ml.g5:
UpdateEndpoint. SageMaker starts new instances before it removes the old ones.
When you’re done, delete the endpoint to stop billing. Your AWS Marketplace subscription stays active for the next deployment:
Stream audio
A stream is oneInvokeEndpointWithBidirectionalStream request. You send audio and control messages on the request side and receive the v3 protocol’s messages on the response side. The session options that the hosted API takes as WebSocket query parameters go in the request’s ModelQueryString.
1
Install the packages
Streaming uses AWS’s
aws-sdk-sagemaker-runtime-http2 package, which needs Python 3.12 or later. AWS publishes it as experimental and its behavior has changed between releases, so install the tested versions:2
Stream a file
Save this as
stream.py. It streams a 16-bit mono WAV file at real-time pace and prints each partial and final turn. Credentials and the Region come from your AWS configuration, such as AWS_PROFILE and AWS_DEFAULT_REGION.3
Run it
ffmpeg -i input.mp3 -ac 1 -ar 16000 -sample_fmt s16 audio.wav.
Use one SDK client, and so one HTTP/2 connection, per concurrent stream; streams that share a client can stall.
language_codes takes specific languages, such as ["en","es"]; multi isn’t supported on this endpoint. The samples repository has a fuller file client and a microphone client.
The model detects the end of each turn itself; mode (balanced, min_latency or max_accuracy) sets how it trades latency against accuracy. If your voice agent runs its own turn detection, such as a voice activity detector or push-to-talk, open the stream with mode=manual instead and send {"type": "ForceEndpoint"} when it decides the user has stopped talking. AssemblyAI-STT-3.7-Realtime-Agent then ends the turn there and returns its final transcript right away. The file client’s --force-endpoint option shows this. See Turn detection.
Transcribe a file
The same endpoint transcribes complete files withInvokeEndpoint:
ContentType audio/l16. The response holds text and each final turn with its words and timestamps. InvokeEndpoint allows 60 seconds per request, which suits files of about a minute. For longer recordings, or many files in Amazon S3, use a batch transform job, on ml.g6e.xlarge for AssemblyAI-STT-3.7-Realtime-Agent or ml.g5.2xlarge for Universal-3.6 Pro.
Capacity and scaling
Unlike the hosted API, an endpoint has a fixed capacity, set per GPU; a whole-file request uses a session while it’s transcribed, and an instance with N GPUs takes N times as many. Concurrent sessions per GPU for latency-sensitive voice agents:
AssemblyAI-STT-3.7-Realtime-Agent refuses new sessions only above a fixed limit per GPU: 350 on RTX PRO 6000, 175 on L40S and 32 on RTX PRO 4500.
MAX_OPEN_STREAMS has no effect on it. Below the limit, an endpoint with too many sessions keeps accepting them and gets slower, so run enough instances for your peak at the figures above. Universal-3.6 Pro refuses sessions above MAX_OPEN_STREAMS. Measure with your own audio and traffic before you go to production.
A stream routed to a full instance receives Begin, then an Error with error_code 3005 a few seconds later. A whole-file request gets HTTP 400 with a 3005 message. Neither is billed; retry with a short backoff.
To scale out, add instances by hand with UpdateEndpointWeightsAndCapacities, or register the variant with Application Auto Scaling and track SageMakerVariantConcurrentRequestsPerModelHighResolution, which counts open streams per instance. Set the target below the figure for the instance, such as 70 on one RTX PRO 6000 with AssemblyAI-STT-3.7-Realtime-Agent, because a new instance takes several minutes to start. Real-time endpoints don’t scale to zero.
Streams still open on an instance that SageMaker removes when it scales in can end early. Use a long ScaleInCooldown, such as 300 seconds, and have clients reopen a stream that ends without Termination.
What’s not available
The model package contains the speech model only. Options that need other AssemblyAI services are refused with anError message rather than ignored: PII redaction (redact_pii), speaker diarization (speaker_labels), noise suppression (noise_suppression_model, voice_focus), LLM transcript enhancement (custom_context, llm_gateway), domain-specific correction (domain), webhooks, and any speech_model other than the model the package serves. Temporary tokens and AssemblyAI API keys don’t apply.
Limits and pricing
You pay two charges, both on your AWS bill:
- AssemblyAI software charge, per hour of audio processed, at the price on the AWS Marketplace listing. Usage is billed in steps of 0.000001 hour (3.6 ms). Sessions refused at capacity or for invalid options aren’t billed. Batch transform jobs are priced per instance-hour instead, as shown on the listing. Usage is also written to CloudWatch in your account, under the namespace
AssemblyAI/STT-3.7-Realtime-AgentorAssemblyAI/Universal-3.6-Pro-Realtime. - AWS infrastructure charge for the instances, at SageMaker AI real-time inference prices. The endpoint bills while it runs, even when idle.
Troubleshooting
Start with the container logs in the CloudWatch log group/aws/sagemaker/Endpoints/<endpoint-name>.
Learn more
Theassemblyai-sagemaker-samples repository has a folder for each model with runnable examples, a sample notebook that walks through deploying, streaming, transcribing a file, batch transform, usage metrics and clean up, and sample audio.
For questions about the model package, your subscription or a private offer, contact your AssemblyAI representative or support@assemblyai.com.