{ "model_id": "openai/tts-1", "provider_id": "openai", "name": "TTS-1", "description": "OpenAI's text-to-speech model optimized for real-time use with low latency.", "task": "Text-to-Speech", "tags": [ "TTS", "Speech Synthesis" ], "context_length": null, "max_output_tokens": null, "schema_version": "1.0.0", "pricing": { "Per character": 0.000015 }, "examples": [ { "name": "Simple Speech", "description": "Generate speech with default voice and settings", "input": { "response_format": "mp3", "speed": 1, "text": "Hello! Welcome to Cloudflare AI Gateway. Let me show you what we can do.", "voice": "alloy" }, "output": { "audio": "https://pub-04a6d208d361438ea01b797e6973bd19.r2.dev/catalog/openai__tts-1/simple-speech.mp3" }, "raw_response": { "gatewayMetadata": { "keySource": "Unified" }, "result": { "audio": "https://pub-04a6d208d361438ea01b797e6973bd19.r2.dev/catalog/openai__tts-1/simple-speech.mp3" }, "state": "Completed" }, "code_snippets": [ { "label": "typescript", "language": "typescript", "code": "const response = await env.AI.run(\n 'openai/tts-1',\n {\n response_format: 'mp3',\n speed: 1,\n text: 'Hello! Welcome to Cloudflare AI Gateway. Let me show you what we can do.',\n voice: 'alloy',\n },\n)\nconsole.log(response)" }, { "label": "curl", "language": "bash", "code": "curl https://api.cloudflare.com/client/v4/accounts/$CLOUDFLARE_ACCOUNT_ID/ai/run \\\n --header \"Authorization: Bearer $CLOUDFLARE_API_TOKEN\" \\\n --header \"Content-Type: application/json\" \\\n --data '{\n \"model\": \"openai/tts-1\",\n \"input\": {\n \"response_format\": \"mp3\",\n \"speed\": 1,\n \"text\": \"Hello! Welcome to Cloudflare AI Gateway. Let me show you what we can do.\",\n \"voice\": \"alloy\"\n }\n}'" } ] }, { "name": "Different Voice", "description": "Use the Nova voice for a different tone", "input": { "response_format": "mp3", "speed": 1, "text": "The weather today is sunny with a high of 72 degrees. Perfect for a walk in the park.", "voice": "nova" }, "output": { "audio": "https://pub-04a6d208d361438ea01b797e6973bd19.r2.dev/catalog/openai__tts-1/different-voice.mp3" }, "raw_response": { "gatewayMetadata": { "keySource": "Unified" }, "result": { "audio": "https://pub-04a6d208d361438ea01b797e6973bd19.r2.dev/catalog/openai__tts-1/different-voice.mp3" }, "state": "Completed" }, "code_snippets": [ { "label": "typescript", "language": "typescript", "code": "const response = await env.AI.run(\n 'openai/tts-1',\n {\n response_format: 'mp3',\n speed: 1,\n text: 'The weather today is sunny with a high of 72 degrees. Perfect for a walk in the park.',\n voice: 'nova',\n },\n)\nconsole.log(response)" }, { "label": "curl", "language": "bash", "code": "curl https://api.cloudflare.com/client/v4/accounts/$CLOUDFLARE_ACCOUNT_ID/ai/run \\\n --header \"Authorization: Bearer $CLOUDFLARE_API_TOKEN\" \\\n --header \"Content-Type: application/json\" \\\n --data '{\n \"model\": \"openai/tts-1\",\n \"input\": {\n \"response_format\": \"mp3\",\n \"speed\": 1,\n \"text\": \"The weather today is sunny with a high of 72 degrees. Perfect for a walk in the park.\",\n \"voice\": \"nova\"\n }\n}'" } ] }, { "name": "Narration", "description": "Slower narration style with the Onyx voice", "input": { "response_format": "mp3", "speed": 0.85, "text": "In the beginning, the universe was a singularity of infinite density. Then, in a fraction of a second, it expanded into everything we know today.", "voice": "onyx" }, "output": { "audio": "https://pub-04a6d208d361438ea01b797e6973bd19.r2.dev/catalog/openai__tts-1/narration.mp3" }, "raw_response": { "gatewayMetadata": { "keySource": "Unified" }, "result": { "audio": "https://pub-04a6d208d361438ea01b797e6973bd19.r2.dev/catalog/openai__tts-1/narration.mp3" }, "state": "Completed" }, "code_snippets": [ { "label": "typescript", "language": "typescript", "code": "const response = await env.AI.run(\n 'openai/tts-1',\n {\n response_format: 'mp3',\n speed: 0.85,\n text: 'In the beginning, the universe was a singularity of infinite density. Then, in a fraction of a second, it expanded into everything we know today.',\n voice: 'onyx',\n },\n)\nconsole.log(response)" }, { "label": "curl", "language": "bash", "code": "curl https://api.cloudflare.com/client/v4/accounts/$CLOUDFLARE_ACCOUNT_ID/ai/run \\\n --header \"Authorization: Bearer $CLOUDFLARE_API_TOKEN\" \\\n --header \"Content-Type: application/json\" \\\n --data '{\n \"model\": \"openai/tts-1\",\n \"input\": {\n \"response_format\": \"mp3\",\n \"speed\": 0.85,\n \"text\": \"In the beginning, the universe was a singularity of infinite density. Then, in a fraction of a second, it expanded into everything we know today.\",\n \"voice\": \"onyx\"\n }\n}'" } ] }, { "name": "Echo Voice", "description": "Use the Echo voice for a deeper tone", "input": { "response_format": "mp3", "speed": 1, "text": "Welcome back to the podcast. Today we are going to talk about the future of artificial intelligence and its impact on creative work.", "voice": "echo" }, "output": { "audio": "https://pub-04a6d208d361438ea01b797e6973bd19.r2.dev/catalog/openai__tts-1/echo-voice.mp3" }, "raw_response": { "gatewayMetadata": { "keySource": "Unified" }, "result": { "audio": "https://pub-04a6d208d361438ea01b797e6973bd19.r2.dev/catalog/openai__tts-1/echo-voice.mp3" }, "state": "Completed" }, "code_snippets": [ { "label": "typescript", "language": "typescript", "code": "const response = await env.AI.run(\n 'openai/tts-1',\n {\n response_format: 'mp3',\n speed: 1,\n text: 'Welcome back to the podcast. Today we are going to talk about the future of artificial intelligence and its impact on creative work.',\n voice: 'echo',\n },\n)\nconsole.log(response)" }, { "label": "curl", "language": "bash", "code": "curl https://api.cloudflare.com/client/v4/accounts/$CLOUDFLARE_ACCOUNT_ID/ai/run \\\n --header \"Authorization: Bearer $CLOUDFLARE_API_TOKEN\" \\\n --header \"Content-Type: application/json\" \\\n --data '{\n \"model\": \"openai/tts-1\",\n \"input\": {\n \"response_format\": \"mp3\",\n \"speed\": 1,\n \"text\": \"Welcome back to the podcast. Today we are going to talk about the future of artificial intelligence and its impact on creative work.\",\n \"voice\": \"echo\"\n }\n}'" } ] }, { "name": "Fast Playback", "description": "Speed up speech for quick listening", "input": { "response_format": "mp3", "speed": 1.5, "text": "This is a fast-paced summary of the key findings from the quarterly report. Revenue is up fifteen percent, user growth exceeded expectations, and infrastructure costs remain stable.", "voice": "shimmer" }, "output": { "audio": "https://pub-04a6d208d361438ea01b797e6973bd19.r2.dev/catalog/openai__tts-1/fast-playback.mp3" }, "raw_response": { "gatewayMetadata": { "keySource": "Unified" }, "result": { "audio": "https://pub-04a6d208d361438ea01b797e6973bd19.r2.dev/catalog/openai__tts-1/fast-playback.mp3" }, "state": "Completed" }, "code_snippets": [ { "label": "typescript", "language": "typescript", "code": "const response = await env.AI.run(\n 'openai/tts-1',\n {\n response_format: 'mp3',\n speed: 1.5,\n text: 'This is a fast-paced summary of the key findings from the quarterly report. Revenue is up fifteen percent, user growth exceeded expectations, and infrastructure costs remain stable.',\n voice: 'shimmer',\n },\n)\nconsole.log(response)" }, { "label": "curl", "language": "bash", "code": "curl https://api.cloudflare.com/client/v4/accounts/$CLOUDFLARE_ACCOUNT_ID/ai/run \\\n --header \"Authorization: Bearer $CLOUDFLARE_API_TOKEN\" \\\n --header \"Content-Type: application/json\" \\\n --data '{\n \"model\": \"openai/tts-1\",\n \"input\": {\n \"response_format\": \"mp3\",\n \"speed\": 1.5,\n \"text\": \"This is a fast-paced summary of the key findings from the quarterly report. Revenue is up fifteen percent, user growth exceeded expectations, and infrastructure costs remain stable.\",\n \"voice\": \"shimmer\"\n }\n}'" } ] } ], "default_example": null, "code_snippets": [], "supports_async": false, "zdr": true, "zdr_comment": null, "external_info": "https://platform.openai.com/docs/guides/text-to-speech", "terms": "https://openai.com/policies/", "cover_image_url": "https://pub-26f1392c1b674324be6786695bd72257.r2.dev/openai/tts-1.png", "metadata": { "Voices": "alloy, echo, fable, onyx, nova, shimmer" }, "request_formats": null, "providers": null, "provider_details": [ { "id": "openai", "pricing": { "input_characters": 0.000015 } } ], "banner": null, "created_at": "2026-05-22 17:53:43", "schema": { "input": { "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "text": { "type": "string", "maxLength": 4096, "description": "The text to generate audio for. Maximum length is 4096 characters." }, "voice": { "default": "alloy", "description": "The voice to use when generating the audio. Defaults to alloy.", "type": "string", "enum": [ "alloy", "echo", "fable", "onyx", "nova", "shimmer" ] }, "response_format": { "default": "mp3", "description": "The output format for the audio. Supported formats are mp3, opus, wav, aac and flac.", "type": "string", "enum": [ "mp3", "opus", "wav", "aac", "flac" ] }, "speed": { "default": 1, "description": "The speed of the generated audio. Select a value from 0.25 to 4.0. 1.0 is the default.", "type": "number", "minimum": 0.25, "maximum": 4 } }, "required": [ "text", "voice", "response_format", "speed" ], "additionalProperties": false }, "output": { "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "audio": { "type": "string", "description": "URL to the generated audio file" } }, "required": [ "audio" ], "additionalProperties": false } } }