Skip to content

Feature Request: Add xAI (Grok) TTS as a native TTS provider #48454

Description

Summary

Add xAI Text-to-Speech as a first-class TTS provider alongside ElevenLabs, OpenAI, and Edge TTS.

Why

xAI just launched their TTS API at $4.20 per 1M characters — roughly 70x cheaper than ElevenLabs API pricing. The quality is competitive, with 5 expressive voices and inline speech tags for fine-grained delivery control (pauses, whispers, laughter, emphasis, pitch/speed changes).

API Details

Request format

{
  "text": "Hello world",
  "voice_id": "ara",
  "language": "en",
  "output_format": {
    "codec": "mp3",
    "sample_rate": 24000,
    "bit_rate": 128000
  }
}

Key features

  • 5 voices: eve, ara, rex, sal, leo
  • 20 languages + auto-detect
  • Inline speech tags: [pause], [laugh], <whisper>, <emphasis>, <slow>, etc.
  • Output formats: MP3, WAV, PCM, μ-law, A-law
  • Sample rates up to 48kHz
  • Max 15,000 chars per request

Response

Raw audio bytes in the specified format.

Suggested config

{
  messages: {
    tts: {
      provider: "xai",
      xai: {
        apiKey: "xai_api_key",
        baseUrl: "https://api.x.ai/v1",
        voiceId: "ara",
        language: "en",
        outputFormat: {
          codec: "mp3",
          sampleRate: 24000,
          bitRate: 128000
        }
      }
    }
  }
}

Context

There are several open TTS provider requests (#48366 Qwen3, #43579 Deepgram, #23080 Gemini, #46543 Chatterbox). xAI's price/quality ratio makes it particularly compelling as a default provider for cost-conscious users. The API is simple (single REST call, raw audio response) and should be straightforward to integrate following the existing provider pattern.

Related issues

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions