What changed
Deepgram now offers pay-per-request endpoints for agents, using x402 and Amazon Bedrock AgentCore payments. Charges are billed in USD to your AWS account through AWS Marketplace, with no contract and no Deepgram API key.
- Speech to text:
POST https://x402.deepgram.com/v1/listen (model=nova-3)
- Text to speech, recommended:
POST https://x402.deepgram.com/v2/speak (Flux TTS, for example flux-haley-en; model is required)
- Text to speech:
POST https://x402.deepgram.com/v1/speak (Aura-2, for example aura-2-thalia-en)
- Batch only: WebSocket streaming is not available this way, and
callback is not supported.
- Raw audio to
/v1/listen is limited to about 4.5 MB. Send {"url": "..."} for longer files.
- A paid quote lasts 5 minutes. A failed request does not use up the payment.
Prerequisites
- An AWS account with AgentCore payments set up: a Payment Manager with an AWS Billing connector, and a payment session with a spend limit
- boto3 1.44.7 or later for Python
Steps
- Send your request. The API answers
402 Payment Required, with the quote in the base64 JSON PAYMENT-REQUIRED header.
- Pick the
accepts entry with network aws:base and pass it unchanged to AgentCore ProcessPayment with paymentType AWS_BILLING_X402.
- Retry the same request with the payment token in the
PAYMENT-SIGNATURE header. Add a DPoP header if the token is bound to a key.
The full Python sample is on Deepgram's guide linked in the sources.
Test it
Request a short phrase from /v1/speak with aura-2-thalia-en. A successful paid call returns 200, audio, and your AWS Marketplace payment ID in the PAYMENT-RESPONSE header.
Not confirmed
- The guide does not list supported AWS Regions or fixed prices. The
402 quote states the exact USD price of each request.
- The AgentCore plugins for Strands Agents and LangGraph handle only stablecoin payments today, so call
ProcessPayment from a tool for AWS Marketplace quotes.