---
title: "Convert text to speech"
method: POST
path: "/api/ai/{project_id}/speech"
tags: ["AI"]
---

# Convert text to speech

`POST /api/ai/{project_id}/speech`

## Request

- Base URL: `https://core.blink.new`
- URL: `https://core.blink.new/api/ai/{project_id}/speech`
- Auth: HTTP bearer

**🔊 AI Text-to-Speech Synthesis**

Convert text to natural-sounding speech using OpenAI's TTS API.
Generated audio is uploaded to cloud storage and returned as a public URL.

**🎙️ Available Voices**
- `alloy` – balanced, neutral (default)
- `echo` – soft, warm
- `fable` – expressive, British accent
- `onyx` – deep, authoritative
- `nova` – bright, energetic
- `shimmer` – gentle, clear

**🎵 Output Formats**
- MP3 (default), Opus, AAC, FLAC, WAV, PCM

## Path parameters

- `project_id` string, required

## Request body

- SpeechGenerationRequest
  - `model` string
  - `text` string, required: Text to convert to speech
  - `voice` 'alloy' | 'echo' | 'fable' | 'onyx' | 'nova' | 'shimmer'
  - `response_format` 'mp3' | 'opus' | 'aac' | 'flac' | 'wav' | 'pcm'
  - `speed` number

## Response `200`

Speech generated and uploaded to cloud storage

- SpeechGenerationResponse
  - `result` object: The response data
    - `url` string, uri: Public URL of the generated audio file
    - `voice` string: Voice used for speech synthesis
    - `format` string: Audio format
    - `mimeType` string: MIME type of the audio file
  - `metadata` object
    - `projectId` string: Project identifier
    - `timestamp` string, date-time: Response timestamp
    - `provider` 'google-gemini' | 'openai': AI provider used for generation

## Other responses

- `400`: Validation error
- `401`: Authentication required or invalid API key
- `500`: Internal server error

---

[API](https://skmtc.dev/blink/apis/blink-apis.md) - [All operations](https://skmtc.dev/blink/apis/blink-apis/llms.txt) - [OpenAPI document](https://skmtc.dev/blink/apis/blink-apis/revisions/4c59c706078e?raw)
