API de relay: audio
Esta página se genera a partir de docs-site/openapi/relay.yaml. Su contenido está en inglés; no la edites a mano.
Speech synthesis and transcription (OpenAI shape).
POST /v1/audio/speech
Sección titulada «POST /v1/audio/speech»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. 400provider_not_foundwhen 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 inorder. Providers with no measurement yet rank last.allow_fallbacks(boolean) —falsetogether withorder(or amodel:providerpin) restricts routing to those providers. Withoutorderor a pin it has no effect.
models(array of string) — Fallback list. The first entry that differs frommodelis tried after every provider ofmodelhas 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
POST /v1/audio/transcriptions
Sección titulada «POST /v1/audio/transcriptions»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.
POST /v1/audio/translations
Sección titulada «POST /v1/audio/translations»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.