Skip to main content
Method: client.generate_transcription(...) or client.create_transcription(...).

Example

require 'ai_stats_sdk'

client = AIStatsSdk::AIStats.new(api_key: ENV.fetch("AI_STATS_API_KEY"))
transcript = client.generate_transcription(
  model: 'openai/gpt-4o-transcribe',
  audio_b64: 'base64_audio_data',
  language: 'en'
)

Key parameters

  • model (required): Transcription-capable model id.
  • audio_url or audio_b64 (required): Audio data (URL or base64).
  • language: Hint language code (e.g., en).
  • prompt: Optional context to improve accuracy.
  • temperature (0–2): Sampling randomness.
  • response_format: json, text, srt, verbose_json, etc.

Returns

AudioTranscriptionResponse
Last modified on May 6, 2026