DataEyesAI
Official SiteConsoleDocs HomeGetting StartedDeveloper ToolsAI Models API
Terms & Policies
Official SiteConsoleDocs HomeGetting StartedDeveloper ToolsAI Models API
Terms & Policies
  1. Audio API
  • API Overview
  • Chat Completions
  • Responses
  • Messages (Claude)
  • Gemini (generateContent)
  • Embeddings
  • Image Models
    • Images
    • Gemini Image Generation
    • Grok Imagine Image
  • Midjourney format
    • Midjourney API Reference
    • Task query interface
    • Upload image
    • Get seed (Seed)
    • Submit Imagine task
    • Query tasks based on ID list
    • FaceSwap
    • Execute Action operation
    • /mj/submit/blend
    • Submit Describe task
    • Submit Modal
    • Refresh link
    • Edit image
    • Query task status by task ID
    • Get the seed of the task image
  • Video Model
    • FLUX Video Generation (flux-3-video)
    • Grok Video Generation
      • 00-Overview
      • 01-Text-to-Video
      • 02-Image-to-Video
      • 03-Reference-to-Video
      • 04-Video-Editing
      • 05-Video-Extension
    • Seedance Video Generation
      • 00-Overview
      • 01-Create-Video-Generation-Task
      • 02-Query-Video-Generation-Task
      • 03-Query-Video-Generation-Task-List
      • 04-Cancel-or-Delete-Task
      • Seedance Private Asset Library API Documentation
    • MiniMax-H3 Video Generation
      • 00-Overview
      • 01-Create-Video-Generation
      • 02-Create-Video-Regeneration
      • 03-Create-H3-Context-IR
      • 04-Query-Task
      • 05-List-Tasks
      • 06-Cancel-or-Delete-Task
    • Hailuo Video Generation
      • 00-Overview
      • 01-Text-to-Video-T2V
      • 02-Image-to-Video-I2V
      • 03-First-Last-Frame-FL2V
      • 04-Subject-Reference-S2V
      • 05-Query-Task-Status
      • 06-Video-Download
      • 99-Appendix-Camera-Movement-and-Webhooks
    • Jimeng Video Generation
      • 00-Overview
      • 01-3.0-Pro-Video-Generation
      • 02-720P-Text-to-Video
      • 03-720P-Image-to-Video-First-Frame
      • 04-720P-Image-to-Video-Start-End-Frame
      • 05-720P-Image-to-Video-Camera
      • 06-1080P-Text-to-Video
      • 07-1080P-Image-to-Video-First-Frame
      • 08-1080P-Image-to-Video-Start-End-Frame
      • 09-Error-Codes
    • Kling AI Video Generation
      • 00-Overview
      • 01-Text-to-Video
      • 02-Image-to-Video
      • 03-Omni-Video
      • 04-Multi-Image-to-Video
      • 05-Motion-Control
      • 06-Multi-Elements
      • 07-Video-Extension
      • 08-Lip-Sync
      • 09-Avatar
      • 10-Text-to-Audio
      • 11-Video-to-Audio
      • 12-TTS
      • 13-Custom-Voices
      • 14-Image-Recognition
      • 15-Element-Management
      • 16-Video-Effects
      • 17-Kling-4.0-Video-Generation
    • Vidu Video Generation
      • 00-Overview
      • 01-Text-to-Video
      • 02-Image-to-Video
      • 03-Reference-to-Video
      • 04-Start-End-Frame
      • 05-Multi-Frame
      • 06-Scene-Template
      • 07-Template-Story
      • 08-Query-Tasks
    • HappyHorse
      • HappyHorse Text-to-Video
      • HappyHorse Image-to-Video (First Frame)
      • HappyHorse Reference-to-Video
      • HappyHorse Video Editing
    • Wan Video Generation
      • 00-Overview.md
      • 01-Text-to-Video
      • 02-Image-to-Video
      • 03-Reference-to-Video
      • 04-Video-Editing
      • 05-First-Last-Frame-to-Video
      • 06-Motion-Transfer-and-Character-Swap
      • 07-Digital-Human-Video
      • 08-VACE-Video-Editing
      • 09-Query-Task
  • Audio API
    • Audio API
    • Gemini TTS API
    • Google DeepMind Lyria API
    • Elevenlabs Speech to Text API Reference
  1. Audio API

Gemini TTS API

Gemini TTS Integration Guide#

Date: 2026-04-20
Platform Domain: https://studio.dataeyes.ai
Model: gemini-3.1-flash-tts-preview
Status: Verified Available

Calling Method#

Uses the Gemini native endpoint /v1beta/models/{model}:generateContent — this is not the OpenAI-compatible /v1/audio/speech endpoint.

Endpoint#

POST https://studio.dataeyes.ai/v1beta/models/gemini-3.1-flash-tts-preview:generateContent

Authentication#

Authorization: Bearer sk-YOUR_API_KEY

cURL Example#


Python Example#


Response Format#

{
  "candidates": [
    {
      "content": {
        "parts": [
          {
            "inlineData": {
              "mimeType": "audio/l16; rate=24000; channels=1",
              "data": "AAAAAAAAAA...(Base64-encoded PCM audio data)"
            }
          }
        ]
      }
    }
  ],
  "usageMetadata": {
    "promptTokenCount": 15,
    "candidatesTokenCount": 200,
    "totalTokenCount": 215
  }
}

Response Field Descriptions#

FieldDescription
mimeTypeaudio/l16; rate=24000; channels=1 — 16-bit PCM, 24kHz sample rate, mono
dataBase64-encoded raw PCM audio data

Available Voices#

Specify in speechConfig.voiceConfig.prebuiltVoiceConfig.voiceName:
Voice NameDescription
KoreFemale
CharonMale
FenrirMale
AoedeFemale
PuckMale
LedaFemale
For additional voice options, refer to the Google Gemini TTS Documentation.

Official Pricing#

TypePaid Tier (per 1M tokens)
Input (text)$1.00
Output (audio)$20.00
Audio token conversion: 25 audio tokens per second

Important Notes#

1.
You must use the Gemini native endpoint format — the OpenAI-compatible /v1/audio/speech endpoint is not supported
2.
The response contains raw PCM audio (not MP3/WAV) — the client must convert the format or play PCM directly
3.
responseModalities must be set to ["AUDIO"]; otherwise, text is returned instead of speech
4.
Supports multilingual input including Chinese and English — the model automatically detects the language
5.
For streaming output, change the endpoint to streamGenerateContent?alt=sse:
POST /v1beta/models/gemini-3.1-flash-tts-preview:streamGenerateContent?alt=sse

Verification Record (2026-04-20)#

Request: "Hello, welcome to our service. This is a test of text to speech."
Voice: Kore
Result: Audio data returned successfully
Response Format: audio/l16; rate=24000; channels=1
HTTP Status Code: 200
Previous
Audio API
Next
Google DeepMind Lyria API