OpenGen models speech synthesis under the text-to-speech operation with typed voice, speed, audio outputFormat, and optional style systemPrompt controls. Inspect exact character limits and published character or token pricing for minimax/speech-02-hd and openai/gpt-4o-mini-tts via GET /v1/models/{provider}/{model}?operation=text-to-speech, run POST /v1/pricing/estimate to verify route eligibility, and submit once with a persisted Idempotency-Key when an executable route is configured.
operation: text-to-speechReviewed 2026-12-02
AGENT PROMPT · PASTE INTO YOUR AGENT OR AUTO-READ
Walk me through a text-to-speech synthesis request on OpenGen (https://opengen.dev):
1. Discover speech models via GET https://opengen.dev/v1/models?operation=text-to-speech (or MCP find_models with operation="text-to-speech").
2. Inspect minimax/speech-02-hd or openai/gpt-4o-mini-tts via GET https://opengen.dev/v1/models/{provider}/{model}?operation=text-to-speech (or MCP get_model) to verify prompt length limits, speed range, outputFormat ("mp3" or "wav"), voice, and optional systemPrompt support.
3. Run POST https://opengen.dev/v1/pricing/estimate (or MCP estimate_cost) to inspect workspaceEligibility and character or token pricing disclosures. Stop and report if routes are documented/comparison-only on the current gateway.
4. Only when an executable route is eligible and I confirm the spend cap, submit once with a persisted Idempotency-Key via POST https://opengen.dev/v1/generations or MCP generate, then retrieve the private audio output via job_get.
OpenGen text-to-speech uses the same canonical generation envelope (modelId, operation: "text-to-speech", input) and workspace-private delivery pipeline as image and video models, returning short-lived first-party /media/... links for MP3 or WAV audio files.
2. Estimate cost and route eligibility with MiniMax Speech-02 HD
Use POST /v1/pricing/estimate first to check route eligibility and character-based pricing ($0.10 / 1,000 characters).
set -eu
umask 077
if [ -e tts-submission.key ]; then
echo "Existing tts-submission.key found; recover read-only via GET /v1/generations/lookup before replacing tts-request.json." >&2
exit 1
fi
rm -f tts-request.json
cat <<'JSON' > tts-request.json
{
"modelId": "minimax/speech-02-hd",
"operation": "text-to-speech",
"input": {
"prompt": "Welcome to OpenGen. Your private media generation job has finished and is ready to download.",
"voice": "English_CalmWoman",
"speed": 1,
"outputFormat": "mp3"
},
"routeId": "minimax-undisclosed/minimax-speech-02-hd",
"billing": "managed",
"maxCostMicros": 150000
}
JSON
chmod 600 tts-request.json
# Dry-run estimate only (review selectedRouteId, recommendedMaxCostMicros, and workspaceEligibility)
curl --fail-with-body \
-X POST "https://opengen.dev/v1/pricing/estimate" \
-H "Authorization: Bearer $OPENGEN_API_KEY" \
-H "Content-Type: application/json" \
--data @tts-request.json
Submit once after reviewing the estimate
Run this step only after reviewing the estimate output above and confirming an executable route is eligible (selectedRouteId != null, executableCandidateCount > 0, blockers: []) and confirming maxCostMicros.
set -eu
umask 077
if [ -e tts-submission.key ]; then
echo "Existing tts-submission.key found; recover read-only via GET /v1/generations/lookup before creating a new submission." >&2
exit 1
fi
RAW_UUID="$(uuidgen)"
[ -n "$RAW_UUID" ] || { echo "uuidgen failed" >&2; exit 1; }
IDEMPOTENCY_KEY="tts-$(printf '%s' "$RAW_UUID" | tr '[:upper:]' '[:lower:]')"
(set -C; printf '%s\n' "$IDEMPOTENCY_KEY" > tts-submission.key)
curl --fail-with-body \
-X POST "https://opengen.dev/v1/generations" \
-H "Authorization: Bearer $OPENGEN_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $IDEMPOTENCY_KEY" \
-H "Prefer: wait=20" \
--data @tts-request.json > tts-receipt.json
3. Steerable delivery instructions with GPT-4o mini TTS
GPT-4o mini TTS (openai/gpt-4o-mini-tts) adds input.systemPrompt to steer speaking tone, pacing, and emphasis (up to 4,096 prompt characters and speed0.25–4). Because audio-token output length varies dynamically, managed quotes are currently comparison-only (selectedRouteId: null); once an execution adapter is enabled, use "billing": "byok" (omitting maxCostMicros):
JSON
{
"modelId": "openai/gpt-4o-mini-tts",
"operation": "text-to-speech",
"input": {
"prompt": "Your build pipeline succeeded with zero warnings.",
"voice": "coral",
"speed": 1,
"systemPrompt": "Speak in a calm, clear technical narration style with brief pauses between clauses.",
"outputFormat": "mp3"
},
"routeId": "openai-undisclosed/openai-gpt-4o-mini-tts",
"billing": "byok"
}
4. Download audio privately or feed it into video
Delivered MP3 (audio/mpeg) and WAV (audio/wav) outputs download over short-lived first-party /media/... URLs and can also be promoted into private workspace inputs with POST /v1/assets ({ "source": "job_output", "sourceJobId": "<audio-job-uuid>", "outputIndex": 0 }) for audio-conditioned Reference to Video workflows.
Next steps
Pair generated narration with synchronized visual clips in Reference to Video.
Compare per-unit pricing disclosures across all modalities in Pricing and Analytics.
Supported Models
Live catalog inventory for text-to-speech (2 documented variants). Click any model to compare exact regional routes, privacy disclosures, and source-linked tariffs, or inspect its canonical schema directly via the single-call model endpoint.