Audio

Text-to-speech, transcriptions, and realtime session minting

OpenAI-compatible audio surfaces on Hypery. All three endpoints require OAuth scope ai:audio (or a first-party API key / session). Chat scopes alone are not accepted.

Billing

Audio is not token-metered the same way as chat. Hypery always charges the billed team:

ModeHow audio bills
vag_passthroughStripe invoice item after a successful call (list-price USD)
metered / prepaidCredit reserve → finalize
Non-Vercel upstream under vagDowngraded to the credit ledger

Also enforced on every call: DISABLE_AI_SPEND, rate limits, app + team spending caps, model permission spend caps, usageRecords.

Realtime mint charges a floor ($0.50). Ongoing WebRTC media is terminated by the upstream — clients must settle remaining cost via POST /api/v1/usage/charge with category=realtime and scope billing:charge when the session ends.

Text-to-speech

POST /api/v1/audio/speech

FieldNotes
inputRequired, max 4096 characters
modeltts-1 ($0.015/1K chars) or tts-1-hd ($0.030/1K)
voicealloy, echo, fable, onyx, nova, shimmer, …
response_formatmp3 (default), opus, aac, flac, wav, pcm

Optional header: Idempotency-Key (prevents double-charge on retries).

Transcriptions

POST /api/v1/audio/transcriptionsmultipart/form-data

FieldNotes
fileRequired, max 25 MB
modelDefault whisper-1

Billing estimates minutes from file size (~32 kbps speech heuristic, capped at 45 min) × $0.006/min.

Realtime sessions

POST /api/v1/realtime/sessions — mints an ephemeral client_secret.

Response (whitelisted):

{
  "id": "…",
  "model": "gpt-4o-realtime-preview",
  "client_secret": { "value": "…", "expires_at": 0 },
  "hypery": {
    "sdp_url": "https://…/v1/realtime",
    "settle_usage": {
      "path": "/api/v1/usage/charge",
      "category": "realtime"
    }
  }
}

Accepted body fields include standup options: input_audio_transcription, turn_detection.

Errors

StatusCodeMeaning
403insufficient_scopeMissing ai:audio
402insufficient_creditsTeam cannot spend / spend cap
409idempotency_conflictSame Idempotency-Key already billed
429rate_limit_exceededRate limited
503No audio upstream configured