OpenRouter gives developers one request format for generating speech through different providers. An application sends text, a model identifier and a supported voice, then receives audio it can save or stream. The shared interface simplifies switching providers, but voices and output formats still belong to individual models. Its text-to-speech tutorial therefore recommends changing the model and voice together and checking the response before saving it. That last step prevents a specific failure: unsuccessful requests return an error as JSON, which careless file handling can save under an audio filename.
Terms in this piece · Glossary
streaming — Sending a model's response token by token as it is generated, so the reader sees text immediately instead of waiting for the whole answer.