---
title: "Text-to-speech synthesis"
method: POST
path: "/api/v1/ai/speech"
tags: ["AI"]
---

# Text-to-speech synthesis

`POST /api/v1/ai/speech`

## Request

- Base URL: `https://core.blink.new`
- URL: `https://core.blink.new/api/v1/ai/speech`
- Auth: one of:
  - HTTP bearer
  - HTTP bearer

Convert text to speech using OpenAI TTS. Returns base64-encoded audio — decode with `base64 -d > output.<format>`. Billed per character under `ai:speech`. Unknown model values fall back to `tts-1`.

## Request body

- object
  - `text` string, required: Text to synthesize (max 4 096 characters)
  - `voice` 'alloy' | 'echo' | 'fable' | 'onyx' | 'nova' | 'shimmer': Voice.
  - `model` 'tts-1' | 'tts-1-hd': TTS model (`tts-1` = fast, `tts-1-hd` = high quality)
  - `format` 'mp3' | 'opus' | 'aac' | 'flac' | 'wav' | 'pcm': Output format.
  - `speed` number: Speech speed multiplier (default 1.0)

## Response `200`

Speech generated — returns base64-encoded audio

- object
  - `audio_base64` string: Base64-encoded audio data. Decode and save as `output.<format>`.
  - `format` string: Audio format of the returned data
  - `voice` string: Voice used for synthesis
  - `model` string: TTS model used
  - `characters` integer: Number of input characters processed
  - `usage` object
    - `creditsCharged` number: Blink credits deducted
    - `costUSD` number: Upstream cost in USD

## Other responses

- `400`: Missing/empty `text` or text exceeds 4 096 characters
- `401`: Authentication required or invalid API key
- `500`: Speech service not configured

---

[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)
