gedx402 · docs

Voice agent bundle

GEDX402 sells a conversational voice stack as one discoverable family. Agents pay USDC per route via x402 — no API keys.

Discovery: GET https://gedx402.com/v1/models?bundle=voice — five routes tagged voice-agent.

StepRouteShardMethod
Session (hero)/v1/voice/sessionsmediaPOST
Stream ASR/v1/asr/fluxmediaGET WebSocket
End-of-turn/v1/asr/smart-turn-v2mediaPOST
Agent reply/v1/chat/fastchatPOST
Speech out/v1/tts/aura-2-enmediaPOST
Alt TTS/v1/tts/aura-1mediaPOST

Origins: media.gedx402.com, chat.gedx402.com. Each route returns 402 with x402 payment instructions until settled — except bundle routes when a valid session_token from /v1/voice/sessions has remaining credits.

Starter route: POST https://media.gedx402.com/v1/voice/sessions (starter:true in agents.json).


Prepaid session (Slice C)

sequenceDiagram
  participant Agent
  participant Session as POST /v1/voice/sessions
  participant Flux as GET /v1/asr/flux
  participant Turn as POST /v1/asr/smart-turn-v2
  participant Chat as POST /v1/chat/fast
  participant TTS as POST /v1/tts/aura-2-en

  Agent->>Session: x402 payment + budget
  Session-->>Agent: session_id, session_token, credits
  Agent->>Flux: session_token (no 402 while flux seconds remain)
  Agent->>Turn: X-Voice-Session-Token
  Agent->>Chat: X-Voice-Session-Token
  Agent->>TTS: X-Voice-Session-Token
POST https://media.gedx402.com/v1/voice/sessions
Content-Type: application/json

{
  "budget": {
    "duration_minutes": 5,
    "max_turns": 30
  }
}

One x402 payment covers prepaid Flux streaming seconds plus smart-turn, chat/fast, and TTS turn credits. Send session_token on later bundle calls:

X-Voice-Session-Token: <session_token>

For Flux WebSocket, pass session_token as a query param (?session_token=…) or header. No 402 until the relevant credit pool is exhausted — then pay per-route or open a new session.


Integration flow

sequenceDiagram
  participant User
  participant Agent
  participant Flux as GET /v1/asr/flux
  participant Turn as POST /v1/asr/smart-turn-v2
  participant Chat as POST /v1/chat/fast
  participant TTS as POST /v1/tts/aura-2-en

  User->>Agent: speaks (mic PCM)
  Agent->>Flux: WebSocket Upgrade + PCM chunks
  Flux-->>Agent: partial transcripts / turn events
  Agent->>Turn: audio chunk (base64)
  Turn-->>Agent: end_of_turn signal
  Agent->>Chat: messages[] with user transcript
  Chat-->>Agent: assistant text
  Agent->>TTS: reply text
  TTS-->>Agent: audio bytes
  Agent->>User: play audio

1. Flux streaming ASR (WebSocket)

Endpoint: wss://media.gedx402.com/v1/asr/flux?encoding=linear16&sample_rate=16000

  1. Pay the route (x402 GET quote on the same URL with payment headers, or settle via your x402 client).
  2. Open WebSocket with Upgrade on GET /v1/asr/flux.
  3. Required query params:
  1. Stream raw PCM frames on the socket; receive JSON turn events (e.g. SpeechStarted, partial/final transcripts).

POST /v1/asr/flux returns 405 websocket_required.

2. Smart Turn v2 (end-of-turn)

When Flux indicates speech activity, POST a recent audio window to confirm the user finished speaking:

POST https://media.gedx402.com/v1/asr/smart-turn-v2
Content-Type: application/json

{ "audio": "<base64 PCM or encoded clip>" }

Use the response to gate when you call the chat model (avoid cutting off mid-utterance).

3. Chat reply (fast tier)

POST https://chat.gedx402.com/v1/chat/fast
Content-Type: application/json

{
  "messages": [
    { "role": "system", "content": "You are a concise voice assistant." },
    { "role": "user", "content": "<final transcript from Flux>" }
  ]
}

/v1/chat/fast is the low-latency tier suited to voice loops.

4. TTS (Aura)

POST https://media.gedx402.com/v1/tts/aura-2-en
Content-Type: application/json

{ "text": "<assistant reply>" }

Returns synthesized audio bytes. Use aura-1 for an alternate Deepgram Aura voice profile.


Pricing

Each route quotes one USDC wire settlement on Base. See GET /v1/models?bundle=voice for per-leg quotes.

Prepaid session: POST /v1/voice/sessions — $28.11 USDC wire settlement at default budget caps (duration_minutes: 5, max_turns: 30); scales with budget.


Agent discovery