CumulusDocs
Open Studio
On this page

Preview configured speech

Preview a fixed English or Spanish line with configured voice, model, speed and expressiveness; does not run an agent

Operation ID: voices.preview.

Request

POST /api/v1/voices/preview

  • TypeScript SDK: client.voices.preview (path arguments use path).
  • MCP tool: sdk_client_call with operationId: "voices.preview" (path arguments use input.path). Legacy alias: voices_preview. Connect to your authenticated /mcp endpoint with an API key for the same environment.
  • Minimum API key role: member.
  • Idempotency: Required. Send Idempotency-Key (TypeScript SDK: idempotencyKey) and keep it for retries.

Read resource IDs from earlier responses and use a key for the same environment.

Request example

Select the voice ID and compatible model from voices.list. The response contains preview audio. Keep the request key: replay never synthesizes again, and an already consumed preview returns 409. Use a new key only for an intentional new preview.

Set CUMULUS_BASE_URL to your workspace API URL and CUMULUS_API_KEY to a key for that environment. Set IDEMPOTENCY_KEY to a new UUID for this action and keep it for retries. Example values are synthetic.

cURL

curl
curl --fail-with-body -sS -X POST "${CUMULUS_BASE_URL%/}/api/v1/voices/preview" \
  -H "Authorization: Bearer $CUMULUS_API_KEY" \
  -H "Idempotency-Key: $IDEMPOTENCY_KEY" \
  -H "Content-Type: application/json" \
  --data '{
  "voice_id": "replace-with-catalog-voice-id",
  "model": "eleven_flash_v2_5",
  "language": "en",
  "speed": 1,
  "expressiveness": 1
}'

TypeScript

typescript
import { Cumulus } from "@cumulus/sdk";

const baseUrl = process.env.CUMULUS_BASE_URL;
const apiKey = process.env.CUMULUS_API_KEY;
if (!baseUrl || !apiKey) throw new Error("Set CUMULUS_BASE_URL and CUMULUS_API_KEY");
const client = new Cumulus({ baseUrl, apiKey });

const idempotencyKey = process.env.IDEMPOTENCY_KEY;
if (!idempotencyKey) throw new Error("Set IDEMPOTENCY_KEY for this request");

const response = await client.voices.preview({
  "body": {
    "voice_id": "replace-with-catalog-voice-id",
    "model": "eleven_flash_v2_5",
    "language": "en",
    "speed": 1,
    "expressiveness": 1
  },
  idempotencyKey,
});

Integration notes

Audio is returned once. A retry with the same Idempotency-Key never synthesizes again and returns 409 if the preview request was already consumed. Use a new key only for an intentional new preview.

Input schema

Path, query and header parameters

Idempotency-Key

header parameter · Required.

Type: string. minLength: 1. maxLength: 256.

JSON request body

FieldType or valuesRequiredDescription and limits
voice_idstringRequiredminLength: 1. maxLength: 256.
modelstringRequiredminLength: 1. maxLength: 128.
language"en" · "es"Required—
speednumberRequiredAt least 0.5. At most 2.
expressivenessnumberRequiredAt least 0. At most 2.
Complete OpenAPI schema
OpenAPI JSON
{
  "parameters": [
    {
      "name": "Idempotency-Key",
      "in": "header",
      "required": true,
      "schema": {
        "type": "string",
        "minLength": 1,
        "maxLength": 256
      }
    }
  ],
  "requestBody": {
    "required": true,
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/VoicesPreviewRequest"
        }
      }
    }
  }
}

Responses

HTTP 200

Preview a fixed English or Spanish line with configured voice, model, speed and expressiveness; does not run an agent

application/json

FieldType or valuesRequiredDescription and limits
audio_base64stringRequiredminLength: 1. maxLength: 3000000.
media_type"audio/mpeg"Required—
textstringRequired—

Error responses

HTTPDescription
4XXTyped error (ApiError)
5XXTyped error (ApiError)

Errors use the shared error envelope. Inspect error.code, retryable, outcome and details before retrying.

Complete OpenAPI schema
OpenAPI JSON
{
  "200": {
    "description": "Preview a fixed English or Spanish line with configured voice, model, speed and expressiveness; does not run an agent",
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/VoicesPreviewResponse200"
        }
      }
    }
  },
  "4XX": {
    "description": "Typed error (ApiError)",
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/ApiError"
        }
      }
    }
  },
  "5XX": {
    "description": "Typed error (ApiError)",
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/ApiError"
        }
      }
    }
  }
}

Referenced schemas

Expand the complete OpenAPI definitions for integrations that generate their own clients.

Complete OpenAPI schema
OpenAPI JSON
{
  "components": {
    "schemas": {
      "VoicesPreviewRequest": {
        "type": "object",
        "properties": {
          "voice_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256
          },
          "model": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "language": {
            "type": "string",
            "enum": [
              "en",
              "es"
            ]
          },
          "speed": {
            "type": "number",
            "minimum": 0.5,
            "maximum": 2
          },
          "expressiveness": {
            "type": "number",
            "minimum": 0,
            "maximum": 2
          }
        },
        "required": [
          "voice_id",
          "model",
          "language",
          "speed",
          "expressiveness"
        ],
        "additionalProperties": false
      },
      "VoicesPreviewResponse200": {
        "type": "object",
        "properties": {
          "audio_base64": {
            "type": "string",
            "minLength": 1,
            "maxLength": 3000000
          },
          "media_type": {
            "type": "string",
            "enum": [
              "audio/mpeg"
            ]
          },
          "text": {
            "type": "string"
          }
        },
        "required": [
          "audio_base64",
          "media_type",
          "text"
        ],
        "additionalProperties": false
      },
      "ApiError": {
        "type": "object",
        "properties": {
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string",
                "enum": [
                  "unauthenticated",
                  "forbidden",
                  "not_found",
                  "conflict",
                  "invalid_request",
                  "idempotency_conflict",
                  "policy_denied",
                  "capability_unavailable",
                  "provider_unavailable",
                  "knowledge_unavailable",
                  "publication_invalid",
                  "run_not_active",
                  "rate_limited",
                  "outcome_unknown",
                  "internal"
                ]
              },
              "message": {
                "type": "string"
              },
              "retryable": {
                "type": "boolean"
              },
              "outcome": {
                "type": "string",
                "enum": [
                  "none",
                  "unknown"
                ]
              },
              "details": {
                "type": "object",
                "additionalProperties": {}
              }
            },
            "required": [
              "code",
              "message",
              "retryable",
              "outcome"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "error"
        ],
        "additionalProperties": false
      }
    }
  }
}

Errors and recovery

See API error handling and Troubleshooting.

Content version 71a6c9deCustomer SDKMarkdown source
Preview configured speech · Cumulus developer docs