OpenrouterSdk.Api.Transcription (OpenRouter SDK v0.1.0)

Copy Markdown View Source

POST /audio/transcriptions — speech-to-text.

the upstream endpoint is openai-compatible: multipart upload with a file part plus a model field.

{:ok, %{"text" => text}} =
  OpenrouterSdk.Api.Transcription.create(%{
    file: {"recording.wav", File.read!("recording.wav"), "audio/wav"},
    model: "openai/whisper-1",
    language: "en"
  })

Summary

Functions

create(payload, opts \\ [])

@spec create(
  map(),
  keyword()
) :: {:ok, map()} | {:error, OpenrouterSdk.Error.t()}