# Gemini 3.1 Flash TTS Preview (`google/gemini-3.1-flash-tts-preview`): API > google/gemini-3.1-flash-tts-preview is a text-to-speech model from Google you can call on the OceanToken API. Endpoint: `POST https://api.oceantoken.ai/v1/audio/speech`. Auth: `Authorization: Bearer $OCEANTOKEN_API_KEY`. OpenAI-compatible; the OpenAI SDKs work with base URL https://api.oceantoken.ai/v1. ## Request parameters - `model` (string; required): This model's ID. - `input` (string; required): The text to read. - `voice` (string; required): One of this model's voices (see the Speech guide). - `response_format` (string; mp3, wav, opus, aac, flac, pcm, url): Audio format; `url` returns a link instead of the audio. - `speed` (number; 0.25 to 4; default 1): Pace, on models that support it. - `instructions` (string): Tone notes such as "calm, slow", on models that support them. ## Example: Basic ```bash curl https://api.oceantoken.ai/v1/audio/speech \ -H "Authorization: Bearer $OCEANTOKEN_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "google/gemini-3.1-flash-tts-preview", "input": "Welcome aboard.", "voice": "Kore" }' --output speech.wav ``` ```python import os from openai import OpenAI client = OpenAI(base_url="https://api.oceantoken.ai/v1", api_key=os.environ["OCEANTOKEN_API_KEY"]) audio = client.audio.speech.create( model="google/gemini-3.1-flash-tts-preview", input="Welcome aboard.", voice="Kore", ) audio.write_to_file("speech.wav") ``` ## Response - `(body)` (binary): The audio file. ## More - Model page: https://docs.oceantoken.ai/models/google/gemini-3.1-flash-tts-preview - This spec as JSON (with a JSON Schema of the request): https://docs.oceantoken.ai/models/google/gemini-3.1-flash-tts-preview/spec.json - Guide: https://docs.oceantoken.ai/guides/audio - All models: https://docs.oceantoken.ai/llms.txt