Provider options
Use any provider's own settings through AllModels with provider_options, from the OpenAI SDK, the ElevenLabs SDK or plain HTTP.
Every provider feature is supported through AllModels. Common settings such as model, voice, language and audio format use the standard fields of whichever API you call. For anything specific to one provider, add it to provider_options. AllModels passes those settings directly to the provider.
provider_options works with the OpenAI SDK, the ElevenLabs SDK and the native AllModels API, for text-to-speech, speech-to-text and realtime.
Text-to-speech
This example sets Fish Audio's expressiveness and latency on a text-to-speech request.
const audio = await client.audio.speech.create({
model: "fish/s2-pro",
voice: "933563129e564b19a115bedd57b7406a",
input: "Hello from AllModels.",
response_format: "mp3",
provider_options: { temperature: 0.9, latency: "balanced" }
});Speech-to-text
This example turns on ElevenLabs Scribe speaker diarization for a two-person call.
const transcript = await client.audio.transcriptions.create({
file: createReadStream("call.wav"),
model: "elevenlabs/scribe_v2",
response_format: "verbose_json",
provider_options: { diarize: true, num_speakers: 2 }
});File uploads are sent as form data, so with the ElevenLabs Python SDK pass provider_options as a JSON string, as shown above.
Where to put provider_options
| API | Where provider_options goes |
|---|---|
| OpenAI SDK, JavaScript | In the request object, next to the standard fields |
| OpenAI SDK, Python | In extra_body |
| OpenAI realtime transcription | In the session.update event |
| ElevenLabs SDK, JavaScript | In queryParams in the request options |
| ElevenLabs SDK, Python | In additional_body_parameters in request_options (as a JSON string for file uploads) |
| ElevenLabs Speech Engine | As stt.provider_options or tts.provider_options |
| Native AllModels API | As provider_options query parameters or in the request body |
The pages for each SDK show full examples: OpenAI and ElevenLabs.
Option names
Use the setting names from the provider's own API documentation. Each model page names its provider. If a standard field covers a setting, such as voice, language, speed or audio format, use the standard field.
Questions
If you have a question about a provider feature or run into a problem with one, email support@allmodels.io.
