> ## Documentation Index
> Fetch the complete documentation index at: https://docs.breezeblue.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# AI rewrite text to speech instruction

> Rewrite a user-provided TTS instruction into clearer model guidance without changing the script.



## OpenAPI

````yaml /openapi.json post /v1/text-to-speech/ai-rewrite
openapi: 3.1.0
info:
  title: Breeze Developer API
  description: >-
    Breeze Developer API for models, voices, text-to-speech, history, balance,
    usage, and browser-managed API keys.
  version: 1.0.0
servers:
  - url: https://api.breeze.blue
security: []
tags:
  - name: Models
    description: Supported TTS models.
  - name: Text to Speech
    description: Text-to-speech synthesis and instruction rewriting.
  - name: Voices
    description: Saved voices and voice settings.
  - name: Voice Previews
    description: Create, audition, and save temporary voice previews.
  - name: Account
    description: Balance, usage, and API keys.
  - name: History
    description: Generated audio history.
paths:
  /v1/text-to-speech/ai-rewrite:
    post:
      tags:
        - Text to Speech
      summary: AI rewrite text to speech instruction
      description: >-
        Rewrite a user-provided TTS instruction into clearer model guidance
        without changing the script.
      operationId: tts_ai_rewrite
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TtsAiRewriteRequest'
        required: true
      responses:
        '200':
          description: Rewritten instruction.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TtsAiRewriteResponse'
          headers:
            x-breeze-api-key-id:
              description: >-
                Public API key identifier used to authenticate the request, when
                an API key was used.
              schema:
                type: string
        '401':
          description: HTTP 401 error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: HTTP 422 error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationErrorResponse'
        '503':
          description: HTTP 503 error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - ApiKeyAuth: []
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl \
              --request POST \
              --url "https://api.breeze.blue/v1/text-to-speech/ai-rewrite" \
              --header "xi-api-key: $BREEZE_API_KEY" \
              --header "Content-Type: application/json" \
              --data '{
              "instruction": "Make it warmer and more cinematic.",
              "language_code": "en"
            }'
        - lang: Python
          label: Python SDK
          source: |-
            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"])
        - lang: TypeScript
          label: TypeScript SDK
          source: |-
            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);
components:
  schemas:
    TtsAiRewriteRequest:
      properties:
        instruction:
          type: string
          minLength: 1
          title: Instruction
          description: >-
            Instruction text to rewrite. Required and must be 1000 characters or
            fewer.
        language_code:
          anyOf:
            - type: string
              maxLength: 16
            - type: 'null'
          title: Language Code
          description: Optional language hint for the rewritten instruction.
      additionalProperties: false
      type: object
      required:
        - instruction
      title: TtsAiRewriteRequest
    TtsAiRewriteResponse:
      properties:
        instruction:
          title: Instruction
          type: string
        language_code:
          title: Language Code
          type: string
      required:
        - instruction
        - language_code
      title: TtsAiRewriteResponse
      type: object
    ErrorResponse:
      properties:
        ok:
          default: false
          title: Ok
          type: boolean
        code:
          title: Code
          type: string
        detail:
          title: Detail
          type: string
        error:
          title: Error
          type: string
        meta:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          default: null
          title: Meta
      required:
        - code
        - detail
        - error
      title: ErrorResponse
      type: object
    ValidationErrorResponse:
      properties:
        ok:
          default: false
          title: Ok
          type: boolean
        code:
          title: Code
          type: string
        detail:
          title: Detail
          type: string
        error:
          title: Error
          type: string
        meta:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Meta
      required:
        - code
        - detail
        - error
      title: ValidationErrorResponse
      type: object
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: xi-api-key
      description: Breeze Developer API key.

````