POST
https://api.breeze.blue/v1/text-to-speech/ai-rewriteAI rewrite text to speech instruction
Rewrite a user-provided TTS instruction into clearer model guidance without changing the script.
Authentication
API key: Send your Breeze Developer API key with the xi-api-key header.
Headers
| Field | Type | Description |
|---|---|---|
xi-api-keyrequired | string | Your Breeze Developer API key. See authentication. |
content-typerequired | string | application/json |
Request body
| Field | Type | Description |
|---|---|---|
instructionrequired | string | Instruction text to rewrite. Required and must be 1000 characters or fewer. |
language_code | string | language_code request field for TtsAiRewriteRequest. |
Example request
python
import os
from breeze_blue import BreezeBlue
client = BreezeBlue(api_key=os.environ["BREEZE_API_KEY"])
rewritten = client.text_to_speech.ai_rewrite(
instruction="Make it warmer and more cinematic.",
language_code="en",
)
print(rewritten["instruction"])
typescript
import { BreezeBlueClient } from "@breeze.blue/sdk";
const client = new BreezeBlueClient({
apiKey: process.env.BREEZE_API_KEY!,
});
const rewritten = await client.textToSpeech.aiRewrite({
instruction: "Make it warmer and more cinematic.",
languageCode: "en",
});
console.log(rewritten.instruction);
curl
curl -X POST "https://api.breeze.blue/v1/text-to-speech/ai-rewrite" \
-H "xi-api-key: $BREEZE_API_KEY" \
-H "content-type: application/json" \
--data '{
"instruction": "Make it warmer and more cinematic.",
"language_code": "en"
}'
import os
from breeze_blue import BreezeBlue
client = BreezeBlue(api_key=os.environ["BREEZE_API_KEY"])
rewritten = client.text_to_speech.ai_rewrite(
instruction="Make it warmer and more cinematic.",
language_code="en",
)
print(rewritten["instruction"])Response
Rewritten instruction.
Content types: application/json
Response headers:
x-breeze-api-key-id: Public API key identifier used to authenticate the request, when an API key was used.
{
"instruction": "Deliver the script in a calm, conversational style with clear pacing, gentle emphasis on key ideas, and natural pauses between sentences.",
"language_code": "en"
}Errors
VALIDATION_ERROR— The rewrite payload failed validation.LLM_CONFIG_NOT_FOUND— AI Rewrite is not configured for the current environment.UPSTREAM_GENERATION_ERROR— The upstream AI Rewrite model failed.
See the full list on errors.