Skip to content
API referenceCreate speech

Create speech

POST/v1/audio/speech

Create speech.

Compatible with OpenAI's create-speech endpoint: send model, input (the text) and voice and get the audio back as a binary body. Its content type follows response_format: mp3 (the default, audio/mpeg), opus, aac, flac, wav or pcm. Sarvam always answers in WAV. The body is forwarded to OpenAI and OpenAI-compatible providers as sent, and translated for Sarvam and ElevenLabs.

Authenticate with a BYOK virtual key or with x-provider and x-api-key; a PLATFORM virtual key is a 400. The key's checks, the plan's limits and the organization's approved-provider policy (403) apply. The call is priced on the length of input and the cost is in the x-operation-cost-usd response header. This call is not retried.

Compatible with the OpenAI Audio API (create speech). The request and response bodies are the provider's own format, passed through by the gateway: see the OpenAI Audio API (create speech) reference for every field. The credentials and headers below are what VectorAxis adds.

Authorization

  • AuthorizationBearer <slug>.<secret>

    A virtual key's API key (vk-....<secret>), as Authorization: Bearer. What the OpenAI SDK sends from its api_key. Used by the inference endpoints.

  • orx-virtual-keyheader

    A virtual key's API key in the x-virtual-key header, for clients that keep Authorization for something else.

  • orx-api-keyheader

    Direct credentials: the provider's own API key in x-api-key, with the provider named in x-provider (for example openai). On /v1/messages a virtual key is accepted in x-api-key too, which is what the Claude SDK sends.

Headers

  • x-providerstring

    With direct credentials: the provider x-api-key belongs to, for example openai or anthropic (case and dashes are normalised). Not used with a virtual key.

Responses

200audio/mpeg

The generated audio, in the requested format

NVIDIA Inception Program member

VectorAxis is built by GK Labs, a member of NVIDIA Inception.