Skip to main content
Method: client.generate_translation(...) or client.create_translation(...).

Example

require 'ai_stats_sdk'

client = AIStatsSdk::AIStats.new(api_key: ENV.fetch("AI_STATS_API_KEY"))
translated = client.generate_translation(
  model: 'openai/gpt-4o-translate',
  audio_b64: 'base64_audio_data'
)

Key parameters

  • model (required): Translation-capable model id.
  • audio_url or audio_b64 (required): Audio data to translate.
  • prompt: Optional context to guide translation.
  • temperature (0–2): Sampling randomness.
  • response_format: json, text, srt, verbose_json, etc.

Returns

AudioTranscriptionResponse
Last modified on May 6, 2026