Skip to content

Relay API: audio

This page is generated from docs-site/openapi/relay.yaml. Do not edit it by hand.

Speech synthesis and transcription (OpenAI shape).

Text to speech

operationId relayAudioSpeech · auth: bearerAuth

Request body (required) application/json — SpeechRequest

  • provider (RoutingPreferences) — Per-request routing wishes (OpenRouter-style). Use only the keys listed here: the Anthropic and Gemini dialects reject unknown keys with 400, and the others may ignore them. See docs/routing for the exact ranking.
    • order (array of string) — Provider tags to try first, in this order. Matching is case-insensitive.
    • only (array of string) — Use only these providers. 400 provider_not_found when none of them offers the model.
    • ignore (array of string) — Never use these providers.
    • sort (“price” | “latency” | “throughput”) — Rank the providers that are not named in order. Providers with no measurement yet rank last.
    • allow_fallbacks (boolean) — false together with order (or a model:provider pin) restricts routing to those providers. Without order or a pin it has no effect.
  • models (array of string) — Fallback list. The first entry that differs from model is tried after every provider of model has failed before the response started. One fallback model is used; further entries are ignored. The fallback is billed at its own price.
  • usage (UsageSwitch) — Accepted and removed before the request reaches the provider. The cost is always returned; the switch exists so that clients written for other gateways keep working.
    • include (boolean)
  • model (string, required)
  • input (string, required)
  • voice (string, required)
Status Meaning Body
200 Audio bytes (or an SSE stream when the model supports stream_format=sse). application/octet-stream string<binary>
default Error in the OpenAI envelope (error.message, error.type, error.param, error.code). application/json OpenAIError

Response 200 application/octet-stream — string

Speech to text (multipart)

operationId relayAudioTranscriptions · auth: bearerAuth

Request body (required) multipart/form-data — MultipartForm

Form fields of the OpenAI endpoint (file, model, …), plus the optional gateway fields provider and models as JSON strings.

Status Meaning Body
200 The transcript. application/json OpenAIObject
default Error in the OpenAI envelope (error.message, error.type, error.param, error.code). application/json OpenAIError

Response 200 application/json — OpenAIObject

The provider-shaped response object of the dialect, with cost added inside its usage object.

Speech translation to English (multipart)

operationId relayAudioTranslations · auth: bearerAuth

Request body (required) multipart/form-data — MultipartForm

Form fields of the OpenAI endpoint (file, model, …), plus the optional gateway fields provider and models as JSON strings.

Status Meaning Body
200 The translated transcript. application/json OpenAIObject
default Error in the OpenAI envelope (error.message, error.type, error.param, error.code). application/json OpenAIError

Response 200 application/json — OpenAIObject

The provider-shaped response object of the dialect, with cost added inside its usage object.