Learning resourcesReviewed · OpenRouter

OpenRouter Python SDK speech-to-text reference

This OpenRouter reference explains audio transcription for Python developers, but advanced features depend on the chosen provider and model. It documents base64 audio, file uploads and audio URLs, alongside output formats, timestamps, speaker labels and routing options.

Researched 24 Nov 2026

In short.

This OpenRouter reference helps Python developers integrate audio transcription, but provider and model differences limit feature portability. It documents create_transcription and create_transcription_multipart, including input requirements, output formats, routing and observability fields. Practical constraints include a 25 MB multipart file limit, provider-dependent URL support and mandatory verbose_json output for speaker labels. The page does not establish installation requirements, current model availability, exact prices, licensing or transcription quality. No examples or API calls were executed.

Researched and written by an AI model and checked by a second AI model. How it works

Covers the complete page at [https://openrouter.ai/docs/client-sdks/python/sdks/stt/README.md], including both methods, examples, parameter tables, response references and error tables. The documentation-index notice and links to component schemas, retry configuration and related pages do not extend coverage to those destinations. SDK implementation, installation, live model availability, pricing, licensing and runtime behavior were not established. No code or API requests were executed.

The overview

Identity

The resource is the STT reference page within OpenRouter's Python client SDK documentation at [https://openrouter.ai/docs/client-sdks/python/sdks/stt/README.md]. It describes two methods for converting audio into text: open_router.stt.create_transcription and open_router.stt.create_transcription_multipart.

It is an API reference with examples and parameter tables. It does not provide a complete installation tutorial or identify a specific SDK release.

Assessment

The page is useful for understanding request construction and constraints before integrating transcription. Its strongest details concern input alternatives, response formats and feature combinations that produce errors.

It provides less help with choosing a model or estimating operating costs. Recognition accuracy, latency, reliability and the behavior of the examples remain unassessed.

Users

The reference fits Python developers adding transcription to applications, including developers who need timestamps, specialist vocabulary support or speaker labels. Speaker diarization means assigning labels to the people speaking in a recording.

Beginners can follow the request examples once they have a configured SDK and API access. Experienced developers will find routing preferences, provider-specific options, retry configuration and tracing parameters, although their linked definitions are outside this page.

Capabilities

Documented inputs include base64-encoded audio, multipart file uploads and audio URLs. The default json response contains text and usage. For OpenAI-compatible providers, verbose_json additionally includes task, language, duration and segment timestamps; requesting word granularity adds word timestamps.

Optional features include language selection, speaker labels, vocabulary boosting through keyterms, contextual prompting and temperature control. The JSON method documents automatic language detection when language is omitted. Contextual prompting is documented for OpenAI except gpt-4o-transcribe-diarize, Azure OpenAI, Groq, Together, Alibaba and AssemblyAI endpoints with prompted pricing configured; other providers ignore it.

Using it

Requirements

The examples require a Python environment with the openrouter package, an OpenRouter API key and a transcription model identifier. create_transcription requires input_audio and model. The multipart method requires model and exactly one of file or source_url.

Multipart files have a documented maximum of 25 MB. A source_url must be publicly reachable over HTTP or HTTPS and supported by the provider. Python versions, package versions, dependencies and general audio duration limits are not specified.

Mechanism

Requests name a model and can supply provider routing preferences such as order, only, ignore and allow_fallbacks. The JSON method accepts structured provider configuration; the multipart method accepts a JSON-encoded string. The multipart provider field must decode to an object, and only options for the matched provider are forwarded.

For URL input, the provider downloads the audio directly. session_id groups related requests, while user identifies an end user in Broadcast and private logging; the page says neither field is sent to the provider. Trace metadata can reach configured Broadcast destinations. These statements do not establish the complete handling or retention of audio and transcripts.

Setup

The examples import OpenRouter from openrouter and initialize it in a context manager, reading the API key from OPENROUTER_API_KEY. They also show optional application-identification fields: http_referer, x_open_router_title and x_open_router_categories.

After initializing the client, choose the input method, supply a model and add supported options. Installation commands, account setup and version pinning are absent, so this page alone is insufficient for establishing a complete working environment.

Example

The JSON example calls open_router.stt.create_transcription with base64 audio in input_audio, format_ set to wav, model set to openai/whisper-large-v3 and language set to en. The multipart example instead passes a file object containing file_name and binary content. Both print the returned response.

For a proposed speaker-labelled transcript, the documented combination is diarize=True with response_format="verbose_json" on a compatible model. Leaving the default json format would produce a documented 400 error. These examples were not executed, and the sample model identifier does not establish current availability.

Assessment & evidence

Limitations

Diarization requires verbose_json and returns a documented 400 error when the selected model lacks support. It includes word timestamps even when word granularity is omitted. Unsupported keyterms requests also produce 400 errors, and providers may limit term counts or term lengths. The page provides no complete compatibility matrix.

The multipart source_url description states that OpenRouter imposes no size limit on that route; it does not establish unlimited provider capacity. The error tables cover oversized payloads, authentication, rate limits, server failures, timeouts and provider overload, but provide no service-level guarantees or detailed retry policy.

Reasoning

The interface's likely benefit is a shared request structure for transcription with configurable model and provider routing. This is an architectural inference from the documented parameters, rather than a measured integration benefit.

Feature portability still requires care: routing to a provider without diarization or keyterms support can cause rejection, while unsupported contextual prompts can be ignored. Applications should therefore treat provider compatibility as part of request design.

Alternatives

Within this interface, the documented input choices are base64 JSON, multipart file upload and provider-downloaded URLs. Multipart provides a direct file-upload route up to 25 MB. The file parameter description points larger inputs toward base64 or URL submission, without establishing every limit on those alternatives.

The page does not compare direct provider APIs, local transcription software or other SDKs. Their relative accuracy, cost, privacy and integration effort cannot be assessed from this source.

Evidence

The sole source is the complete OpenRouter STT Python SDK reference at [https://openrouter.ai/docs/client-sdks/python/sdks/stt/README.md]. It contains examples, parameter tables, response-type links and error tables for both transcription methods.

The source documents intended behavior. It supplies no execution receipts, measured transcription results or independent performance evidence. Linked schemas and related documentation are outside the available source text.

Access & freshness

Costs

Exact transcription prices, billing units, minimum charges and free allowances are unknown from this page. The reference warns that providers may charge extra for diarization and keyterms. Its prompt description also refers to AssemblyAI endpoints with prompted pricing configured.

A 402 Payment Required error is listed, but it does not establish rates or account funding requirements. The usage field in a response is not a pricing schedule.

Rights

The page supplies no documentation license, SDK license, redistribution grant or terms governing submitted audio and resulting transcripts. Those rights remain unknown from this source.

Provider configuration exposes zdr and data_collection routing preferences. Their presence does not establish a retention guarantee, contractual protection or permission to process a particular recording.

Freshness

The page snapshot was captured on 24 November 2026 at 01:10:32 UTC. The text contains no publication date, update history or SDK version.

Compatibility with the latest installed SDK, current provider support and continued availability of the example model remain unknown. The capture date establishes the snapshot's timing, not when each documented feature became available.

Actions

Before integrating, confirm the SDK installation requirements, current model availability, provider feature support and prices. Choose an input route that fits the recording's size and accessibility, and request verbose_json when timestamps or speaker labels are needed.

Evaluate representative recordings for transcript accuracy, vocabulary handling, speaker labels, latency and actual charges. Confirm applicable audio permissions and data-handling terms before submitting recordings. These are recommended next steps; no evaluation was performed.

Evidence for this report

selected-page.txtselected · checked 2026-11-24