Synthesizes text with the given voice and returns the raw audio bytes in the response body. The
voice must be enrolled (status ready). You can use your workspace’s own voices and the public
platform voices returned by List voices.
Unlike the JSON endpoints, a successful response is the audio file itself - not a JSON envelope. Errors
still return the standard envelope.
Authorization
string
Your workspace API key (flv_…), from server-side code. Required scope:tts.
string
Alternative for browsers: Bearer fin_tok_…, a short-lived, single-use token your server minted with
Create an access token. Send either this or X-API-Key.
Path parameters
string
required
The voice id.
Body
string
required
The text to synthesize. Maximum 10,000 characters. Billed per character against your plan’s
monthly allowance; repeating an identical request (same voice, text, and parameters) is served
from cache and not billed again.
string
BCP-47 language code (for example en, hi). Defaults to the voice’s primary language.
string
default:"wav"
Output encoding. One of wav, s16le, s24le, s32le, f32le, f64le, mulaw. wav is a
self-contained file; the s*/f* formats are raw, headerless PCM; mulaw is raw G.711 µ-law for
phone calls and requires sample_rate: 8000.
integer
default:24000
Output sample rate in Hz. Defaults to the provider’s native rate (24000); values above it are
upsampled. 8000 (telephony) is produced as asked; other rates below 24000 return 24000.
integer
default:32
Number of inference steps, 1–32 (a quality/latency trade-off). Provider default (32) if
omitted.
number
Accepted (0.0–1.0) but has no effect today: the engine ignores it, so the audio is the
same with or without it.
Response headers
string
The audio MIME type, e.g. audio/wav for output_format: wav.
string
The sample rate of the returned audio, in Hz (when reported by the provider).
string
A public URL to the stored audio file, when object storage is enabled. Useful for download/share.
string
Your remaining character allowance for the month (present when billing is active). An exhausted
allowance returns 402 when enforcement is on - either a flat billing body or the standard
envelope with message: "insufficient_credits", see Errors.
Copy this into your coding agent (Claude Code, Cursor, Codex…) to implement this endpoint.
You are implementing a typed client for one Finesse Voice API endpoint: "Synthesize speech".Everything you need is in this prompt. Do not invent anything that is not specified here.WHAT TO BUILD- A function synthesizeSpeech(voiceId, params) (name it per the project's conventions) that turns text into ONE audio file with the given voice and returns: { audio: bytes, contentType: string, sampleRate?: number, audioUrl?: string, billingRemaining?: number } Use the stack's natural byte type (Buffer/Uint8Array, bytes, []byte).- Optionally a thin wrapper that writes the audio to a file path, if the project needs it.- Detect the stack first: look for package.json, tsconfig.json, pyproject.toml, requirements.txt, go.mod, Gemfile, composer.json and similar. Use the project's language, HTTP client, module layout, error-handling conventions and test runner. If there is no project yet or the stack is unclear, use TypeScript on Node 18+ with the built-in fetch and no new dependencies.- If the project already has a Finesse API client module, add this to it (reuse its auth, base URL, error type and retry helper) instead of creating a parallel one.- Keep the base URL (https://fi.production.flamapis.com) in one constant or config value.ENDPOINT- Method: POST- URL: https://fi.production.flamapis.com/flam-voice-svc/api/v1/public/voices/{id}/speak- Request Content-Type: application/json- The voice must be enrolled (status "ready"), and must belong to the key's workspace or be a public platform voice (as returned by the list endpoint).PARAMETERS- id (path, string, required): the voice id, a 24-character hex string (for example "665f1a2b3c4d5e6f7a8b9c0d"). Validate it locally against /^[0-9a-f]{24}$/i and URL-encode it.REQUEST BODY- text (string, required): the text to synthesize. Maximum 10,000 characters; over the limit returns 400 "text too long (max 10000 chars)". Check locally: reject empty text and count characters (Unicode code points, not bytes), e.g. [...text].length in JavaScript.- language (string, optional): BCP-47 code (e.g. "en", "hi", "es"). Defaults to the voice's primary_language.- output_format (string, optional, default "wav"): one of wav - self-contained WAV file (recommended for playback/download) s16le - signed 16-bit little-endian PCM (headerless) s24le - signed 24-bit little-endian PCM (headerless) s32le - signed 32-bit little-endian PCM (headerless) f32le - 32-bit float little-endian PCM (headerless) f64le - 64-bit float little-endian PCM (headerless) mulaw - G.711 mu-law, 8-bit (headerless), for phone calls; requires sample_rate 8000 The headerless formats need a known sample rate and channel count to play.- sample_rate (integer, optional, default 24000): output rate in Hz. Defaults to the provider's native rate (24000); values above it are upsampled. 8000 (telephony) is produced as asked; other rates below 24000 return 24000.- num_step (integer, optional, default 32): inference steps, 1-32; a quality vs latency trade-off.- expressiveness (number, optional): accepted (0.0-1.0) but has no effect today; the engine ignores it. Do not present it as a working control.- Validate the enums and ranges locally and omit optional fields the caller did not set. { "text": "The quick brown fox jumps over the lazy dog.", "language": "en", "output_format": "wav", "sample_rate": 24000, "expressiveness": 0.5 }AUTHENTICATION- Send the header X-API-Key: <workspace API key> on every request. Keys start with "flv_".- Required scope: tts. Keys carry one or more scopes (voices:read, voices:write, clone, tts); a key without this scope gets 403 with code "insufficient_scope". Keys created before scopes existed have all four.- Read the key from the environment variable FINESSE_API_KEY (or the project's existing secrets or config mechanism). Fail fast with a clear error if it is missing, before making any request.- Never hard-code, log or commit the key, and never ship it in browser/client-side code: call this from server-side code only. A key with the tts scope can synthesize with every voice in its workspace.- A key is bound to one workspace. Referencing a voice or job from another workspace returns 404.- Keys can expire: an expired key returns 401 with code "key_expired". Do not retry; surface it so an operator can rotate the key.- Browser alternative: instead of X-API-Key, send Authorization: Bearer <token> with a short-lived "fin_tok_..." token that YOUR server minted via POST https://fi.production.flamapis.com/flam-voice-svc/api/v1/public/tokens (see the "Create an access token" endpoint). A token grants tts only, is single use (consumed by one successful request), and may be restricted to specific voice_ids. Unknown, expired or already-used token: 401 with code "token_invalid" (mint a new one). Voice outside the token's voice_ids: 403 with code "voice_not_allowed". Only support this mode if the project needs browser-side synthesis.SUCCESS RESPONSE (200): RAW AUDIO BYTES, NOT JSON- The body is the audio file itself. Do not parse it as JSON; read it as binary (e.g. await res.arrayBuffer()).- Check the status BEFORE reading the body: only a 2xx body is audio.- Response headers to capture: Content-Type the audio MIME type, e.g. audio/wav for output_format "wav" X-Sample-Rate sample rate of the returned audio in Hz (when reported); parse to a number X-Audio-URL public URL of the stored audio file, when object storage is enabled X-Billing-Remaining remaining monthly character allowance, when billing is active All of these except Content-Type may be absent: type them as optional.ERROR RESPONSES (JSON, even though success is binary)Errors use the standard envelope: { "status": 400, "error": true, "message": "Voice is not enrolled yet" }Billing and plan denials do NOT use the envelope. They return a flat JSON body whose "error"field is a string, not a boolean: { "error": "plan limit reached", "feature": "max_voices", "limit": 10 } { "error": "quota_exhausted", "unit": "character", "limit": 100000, "used": 100000 }The "error" string is the denial reason (for example quota_exhausted, insufficient_credits,feature_disabled, or "plan limit reached"). Tell the two shapes apart bychecking whether "error" is a boolean (envelope) or a string (flat denial), and exposefeature / unit / limit / used on your error type when present.A 402 can come in either shape. The plan check before synthesis returns the flat body; the creditcheck inside synthesis returns the standard envelope: { "status": 402, "error": true, "message": "insufficient_credits" }- 400: invalid request: missing or invalid field, text over 10,000 characters, or the voice is not ready yet ("Voice is not enrolled yet"). Do not retry.- 401: X-API-Key missing, malformed, invalid or revoked, or code "key_expired" / "token_invalid". Do not retry.- 402: not enough credits or allowance. Either the flat body (insufficient_credits or quota_exhausted, with unit, limit, used) or the envelope with message "insufficient_credits". Do not retry; surface it so the app can prompt a top-up/upgrade.- 403 with code "insufficient_scope": the key lacks the tts scope. Do not retry.- 403 with code "voice_not_allowed": the Bearer token is restricted to other voices. Do not retry.- 403: not permitted, plan limit reached, or feature disabled for the plan (flat body). Do not retry.- 404 with code "not_found" (also returned for a malformed id): voice not found, including voices owned by another workspace. Do not retry.- 422 with code "invalid_input": the input could not be processed. Do not retry.- 429 with code "rate_limited" (over the plan's requests per second) or "concurrency_limited" (the workspace already has its plan's maximum synthesis requests in flight): wait the number of seconds in the Retry-After header, then retry with backoff. See /guides/rate-limits.- 502 with code "upstream_error": the synthesis service failed or is warming up. Retry with backoff.- 503 with code "upstream_busy": the synthesis service is at capacity. Wait the number of seconds in the Retry-After header, then retry with backoff.- Surface failures as one typed error (for example FinesseApiError) carrying: HTTP status, code (when present), message (the envelope "message" or the flat "error" string), optional feature / unit / limit / used, a retryable flag, the request id (the X-Request-Id response header; error bodies also carry it as request_id), and the raw body for debugging. Log the request id with every failure.- Parse error bodies defensively: if a body is not valid JSON, keep the raw text in the error.RETRIES AND TIMEOUTS- Retry 429, 502, 503 and network errors/timeouts (on 429/503 wait the Retry-After seconds first) with exponential backoff plus jitter (about 1s, 2s, 4s; at most 3 retries). Retrying is safe here: an identical request (same voice, text and parameters) is served from cache and not billed again.- The first request after a long idle period can be slow while the engine warms up; use a generous request timeout (configurable) rather than a short default.- Never retry 400, 401, 402, 403, 404 or 422.BILLING- Billed per character of text against the plan's monthly allowance.- Repeating an identical request is served from cache and not billed again.- Expose billingRemaining (from X-Billing-Remaining) so callers can warn before running out; an exhausted allowance returns 402 when enforcement is on.ACCEPTANCE CRITERIA- synthesizeSpeech validates id, text length and parameter ranges locally, sends only documented fields, and returns the audio bytes plus the parsed headers.- A non-2xx response is never treated as audio; both the envelope and the flat billing body are parsed into the typed error.- 429/502/503 are retried with backoff; other 4xx are not.- The key is never logged or sent from client-side code.TEST PLAN- Unit tests with mocked HTTP: 200 with audio/wav bytes and all four headers; 200 with only Content-Type; 400 "Voice is not enrolled yet"; 402 quota_exhausted flat body; 402 insufficient_credits envelope; 404; 429 then 200; 502 then 200; 10,001-character text rejected locally; num_step 0 and 33 rejected locally.- Smoke script:- Get a ready voice id from FLAM_VOICE_ID, or by calling GET https://fi.production.flamapis.com/flam-voice-svc/api/v1/public/voices (same X-API-Key header; voices are in data.voices) and picking the first one whose status is "ready". - Synthesize "Hello from Finesse." with output_format "wav", write speech.wav, and assert the file starts with the ASCII bytes "RIFF" and Content-Type is audio/wav. Print the byte count, X-Sample-Rate, X-Audio-URL and X-Billing-Remaining. Exit non-zero on error.RULES- Implement only what this spec describes. Do not invent parameters, fields, headers, endpoints or error codes. If something is ambiguous, missing, or conflicts with the existing codebase, stop and ask me before guessing.- Match the project's existing style and conventions; do not refactor unrelated code.
{"docsConfig":{"theme":"aspen","$schema":"https://mintlify.com/docs.json","name":"Finesse","description":"Finesse - realtime speech in 60 languages. Clone a voice and stream it in real time across 60 languages, 22 of them Indic.","colors":{"primary":"#2547F0","light":"#4F72FF","dark":"#1E3AD0"},"logo":{"light":"https://mintcdn.com/finesse-docs/u9NNXVA8yD6Y29Xd/logo/finesse-light.png?fit=max\u0026auto=format\u0026n=u9NNXVA8yD6Y29Xd\u0026q=85\u0026s=665b8b35d46e51f6ae805dffc09b6fc1","dark":"https://mintcdn.com/finesse-docs/u9NNXVA8yD6Y29Xd/logo/finesse-dark.png?fit=max\u0026auto=format\u0026n=u9NNXVA8yD6Y29Xd\u0026q=85\u0026s=1f28d4f2a2c26f147ce021c785c0e24a","href":"/introduction"},"favicon":{"light":"https://mintcdn.com/finesse-docs/0zFrmLlrHoW1tpnK/favicon.svg?fit=max\u0026auto=format\u0026n=0zFrmLlrHoW1tpnK\u0026q=85\u0026s=8b7f46bccba82eb14857fc9cc7baba20","dark":"https://mintcdn.com/finesse-docs/0zFrmLlrHoW1tpnK/favicon-dark.svg?fit=max\u0026auto=format\u0026n=0zFrmLlrHoW1tpnK\u0026q=85\u0026s=4d0d37da9ba0022182827b3ee360664c"},"api":{"mdx":{"auth":{"method":"key","name":"X-API-Key"},"server":"https://fi.production.flamapis.com"}},"appearance":{"default":"light","strict":true},"background":{"color":{"light":"#F5F3EE","dark":"#0E0F11"}},"navbar":{"links":[{"href":"/guides/authentication","label":"Get an API key"}],"primary":{"type":"button","label":"Dashboard","href":"https://finesse.flamapp.ai/dashboard"}},"fonts":{"heading":{"family":"Bricolage Grotesque","weight":700},"body":{"family":"Instrument Sans"}},"contextual":{"options":["copy","view"],"display":"header"},"styling":{"latex":false},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"finesse-docs","hasAudioNarration":false,"actualSubdomain":"finesse-docs","customDomains":["docs.finesse.flamapp.ai"],"gitSource":{"type":"github","owner":"homingos","repo":"fe-flam-voice","deployBranch":"production","contentDirectory":"docs","isPrivate":true,"mountPath":"","label":""},"entitlements":{},"buildId":"6afaecc7213a1421d385ef81","clientVersion":"0.0.4344","searchFilterCounts":[{"language":"default","tag":"API reference","count":17},{"language":"default","tag":"SDKs","count":13},{"language":"default","tag":"Voices","count":8},{"language":"default","tag":"TypeScript SDK","count":7},{"language":"default","tag":"Reference","count":6},{"language":"default","tag":"Get started","count":5},{"language":"default","tag":"Speech","count":4},{"language":"default","tag":"Essentials","count":3},{"language":"default","tag":"Start here","count":2},{"language":"default","tag":"Integrations","count":2}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableContextualStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-rbac-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"site-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"starter-pricing","enabled":true,"variant":{"name":"treatment","enabled":true,"payload":{"type":"string","value":"treatment"},"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"wildcard-email-auth","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"starterQuestions":[],"googleFontsInlined":true},"customCss":[]}
{"page":{"pagePath":"voice-api/synthesize-speech","slug":"/voice-api/synthesize-speech","pageMetadata":{"title":"Synthesize speech","description":"Turn text into a single audio file using a cloned voice.","api":"POST /flam-voice-svc/api/v1/public/voices/{id}/speak","href":"/voice-api/synthesize-speech"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Turn text into a single audio file using a cloned voice.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,..._provideComponents(),...props.components},{CodeBlock,CodeGroup,Heading,Note,ParamField,ResponseField}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!CodeGroup)_missingMdxReference(`CodeGroup`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Note)_missingMdxReference(`Note`,true);if(!ParamField)_missingMdxReference(`ParamField`,true);if(!ResponseField)_missingMdxReference(`ResponseField`,true);return _jsxs(_Fragment,{children:[_jsxs(_components.p,{children:[`Synthesizes `,_jsx(_components.code,{children:`text`}),` with the given voice and returns the `,_jsx(_components.strong,{children:`raw audio bytes`}),` in the response body. The\nvoice must be enrolled (status `,_jsx(_components.code,{children:`ready`}),`). You can use your workspace’s own voices and the public\nplatform voices returned by `,_jsx(_components.a,{href:`/voice-api/list-voices`,children:`List voices`}),`.`]}),`\n`,_jsx(Note,{children:_jsxs(_components.p,{children:[`Unlike the JSON endpoints, a successful response is the audio file itself - not a JSON envelope. Errors\nstill return the `,_jsx(_components.a,{href:`/voice-api/errors`,children:`standard envelope`}),`.`]})}),`\n`,_jsx(Heading,{level:`4`,id:`authorization`,children:`Authorization`}),`\n`,_jsx(ParamField,{header:`X-API-Key`,type:`string`,id:`param-x-api-key`,children:_jsxs(_components.p,{children:[`Your workspace API key (`,_jsx(_components.code,{children:`flv_…`}),`), from server-side code. `,_jsx(_components.strong,{children:`Required scope:`}),` `,_jsx(_components.code,{children:`tts`}),`.`]})}),`\n`,_jsx(ParamField,{header:`Authorization`,type:`string`,id:`param-authorization`,children:_jsxs(_components.p,{children:[`Alternative for browsers: `,_jsx(_components.code,{children:`Bearer fin_tok_…`}),`, a short-lived, single-use token your server minted with\n`,_jsx(_components.a,{href:`/voice-api/create-token`,children:`Create an access token`}),`. Send either this or `,_jsx(_components.code,{children:`X-API-Key`}),`.`]})}),`\n`,_jsx(Heading,{level:`4`,id:`path-parameters`,children:`Path parameters`}),`\n`,_jsx(ParamField,{path:`id`,type:`string`,required:true,id:`param-id`,children:_jsx(_components.p,{children:`The voice id.`})}),`\n`,_jsx(Heading,{level:`4`,id:`body`,children:`Body`}),`\n`,_jsx(ParamField,{body:`text`,type:`string`,required:true,initialValue:`Hello from Finesse.`,id:`param-text`,children:_jsxs(_components.p,{children:[`The text to synthesize. Maximum `,_jsx(_components.strong,{children:`10,000 characters`}),`. Billed per character against your plan’s\nmonthly allowance; repeating an identical request (same voice, text, and parameters) is served\nfrom cache and not billed again.`]})}),`\n`,_jsx(ParamField,{body:`language`,type:`string`,id:`param-language`,children:_jsxs(_components.p,{children:[`BCP-47 language code (for example `,_jsx(_components.code,{children:`en`}),`, `,_jsx(_components.code,{children:`hi`}),`). Defaults to the voice’s primary language.`]})}),`\n`,_jsx(ParamField,{body:`output_format`,type:`string`,default:`wav`,id:`param-output-format`,children:_jsxs(_components.p,{children:[`Output encoding. One of `,_jsx(_components.code,{children:`wav`}),`, `,_jsx(_components.code,{children:`s16le`}),`, `,_jsx(_components.code,{children:`s24le`}),`, `,_jsx(_components.code,{children:`s32le`}),`, `,_jsx(_components.code,{children:`f32le`}),`, `,_jsx(_components.code,{children:`f64le`}),`, `,_jsx(_components.code,{children:`mulaw`}),`. `,_jsx(_components.code,{children:`wav`}),` is a\nself-contained file; the `,_jsx(_components.code,{children:`s*`}),`/`,_jsx(_components.code,{children:`f*`}),` formats are raw, headerless PCM; `,_jsx(_components.code,{children:`mulaw`}),` is raw G.711 µ-law for\nphone calls and requires `,_jsx(_components.code,{children:`sample_rate: 8000`}),`.`]})}),`\n`,_jsx(ParamField,{body:`sample_rate`,type:`integer`,default:24e3,initialValue:24e3,id:`param-sample-rate`,children:_jsxs(_components.p,{children:[`Output sample rate in Hz. Defaults to the provider’s native rate (`,_jsx(_components.code,{children:`24000`}),`); values above it are\nupsampled. `,_jsx(_components.code,{children:`8000`}),` (telephony) is produced as asked; other rates below `,_jsx(_components.code,{children:`24000`}),` return `,_jsx(_components.code,{children:`24000`}),`.`]})}),`\n`,_jsx(ParamField,{body:`num_step`,type:`integer`,default:32,initialValue:32,id:`param-num-step`,children:_jsxs(_components.p,{children:[`Number of inference steps, `,_jsx(_components.code,{children:`1`}),`–`,_jsx(_components.code,{children:`32`}),` (a quality/latency trade-off). Provider default (`,_jsx(_components.code,{children:`32`}),`) if\nomitted.`]})}),`\n`,_jsx(ParamField,{body:`expressiveness`,type:`number`,initialValue:.5,id:`param-expressiveness`,children:_jsxs(_components.p,{children:[`Accepted (`,_jsx(_components.code,{children:`0.0`}),`–`,_jsx(_components.code,{children:`1.0`}),`) but has `,_jsx(_components.strong,{children:`no effect today`}),`: the engine ignores it, so the audio is the\nsame with or without it.`]})}),`\n`,_jsx(Heading,{level:`4`,id:`response-headers`,children:`Response headers`}),`\n`,_jsx(ResponseField,{name:`Content-Type`,type:`string`,id:`param-content-type`,children:_jsxs(_components.p,{children:[`The audio MIME type, e.g. `,_jsx(_components.code,{children:`audio/wav`}),` for `,_jsx(_components.code,{children:`output_format: wav`}),`.`]})}),`\n`,_jsx(ResponseField,{name:`X-Sample-Rate`,type:`string`,id:`param-x-sample-rate`,children:_jsx(_components.p,{children:`The sample rate of the returned audio, in Hz (when reported by the provider).`})}),`\n`,_jsx(ResponseField,{name:`X-Audio-URL`,type:`string`,id:`param-x-audio-url`,children:_jsx(_components.p,{children:`A public URL to the stored audio file, when object storage is enabled. Useful for download/share.`})}),`\n`,_jsx(ResponseField,{name:`X-Billing-Remaining`,type:`string`,id:`param-x-billing-remaining`,children:_jsxs(_components.p,{children:[`Your remaining character allowance for the month (present when billing is active). An exhausted\nallowance returns `,_jsx(_components.code,{children:`402`}),` when enforcement is on - either a flat billing body or the standard\nenvelope with `,_jsx(_components.code,{children:`message: \"insufficient_credits\"`}),`, see `,_jsx(_components.a,{href:`/voice-api/errors`,children:`Errors`}),`.`]})}),`\n`,_jsxs(CodeGroup,{children:[_jsx(CodeBlock,{filename:`cURL`,numberOfLines:`6`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`6`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -X`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` POST`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"https://fi.production.flamapis.com/flam-voice-svc/api/v1/public/voices/665f1a2b3c4d5e6f7a8b9c0d/speak\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"X-API-Key: `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$FINESSE_API_KEY`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Content-Type: application/json\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -d`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '{\"text\":\"Hello from Finesse.\",\"language\":\"en\",\"output_format\":\"wav\"}'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --output`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` speech.wav`})]}),`\n`]})})}),_jsx(CodeBlock,{filename:`JavaScript`,numberOfLines:`16`,language:`javascript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`javascript`,children:_jsxs(_components.code,{language:`javascript`,numberOfLines:`16`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`writeFile`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` } `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"node:fs/promises\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` id`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"665f1a2b3c4d5e6f7a8b9c0d\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` res`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` fetch`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\" `https://fi.production.flamapis.com/flam-voice-svc/api/v1/public/voices/\"}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#569CD6`},children:\"${\"}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`id`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\"/speak`\"}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` method:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"POST\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` headers:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"X-API-Key\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` process`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`env`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:`FINESSE_API_KEY`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Content-Type\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"application/json\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` body:`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` JSON`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`stringify`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`({ `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`text:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Hello from Finesse.\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`language:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"en\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`output_format:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"wav\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }),`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`if`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`!`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`res`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`ok`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`throw`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` new`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` Error`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\"`Synthesis failed: \"}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#569CD6`},children:\"${\"}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`res`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`status`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\"`\"}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`await`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` writeFile`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"speech.wav\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Buffer`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`from`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` res`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`arrayBuffer`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`()));`})]}),`\n`]})})}),_jsx(CodeBlock,{filename:`Python`,numberOfLines:`11`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`11`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` os, requests`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`voice_id `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"665f1a2b3c4d5e6f7a8b9c0d\"`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`res `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` requests.post(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` f`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"https://fi.production.flamapis.com/flam-voice-svc/api/v1/public/voices/`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`{`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`voice_id`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`/speak\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` headers`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"X-API-Key\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: os.environ[`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"FINESSE_API_KEY\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`], `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Content-Type\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"application/json\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`},`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` json`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"text\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Hello from Finesse.\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"language\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"en\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"output_format\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"wav\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`},`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`res.raise_for_status()`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`with`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:` open`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"speech.wav\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"wb\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`as`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` f:`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` f.write(res.content)`})}),`\n`]})})})]}),`\n`,_jsxs(_components.p,{children:[`See `,_jsx(_components.a,{href:`/voice-api/synthesize-parameters`,children:`Synthesize parameters`}),` for the full field reference.`]}),`\n`,_jsx(Heading,{level:`2`,id:`prompt`,children:`Prompt`}),`\n`,_jsx(_components.p,{children:`Copy this into your coding agent (Claude Code, Cursor, Codex…) to implement this endpoint.`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`182`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`182`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`You are implementing a typed client for one Finesse Voice API endpoint: \"Synthesize speech\".`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`Everything you need is in this prompt. Do not invent anything that is not specified here.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`WHAT TO BUILD`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- A function synthesizeSpeech(voiceId, params) (name it per the project's conventions) that turns`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` text into ONE audio file with the given voice and returns:`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` { audio: bytes, contentType: string, sampleRate?: number, audioUrl?: string,`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` billingRemaining?: number }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` Use the stack's natural byte type (Buffer/Uint8Array, bytes, []byte).`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Optionally a thin wrapper that writes the audio to a file path, if the project needs it.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Detect the stack first: look for package.json, tsconfig.json, pyproject.toml,`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` requirements.txt, go.mod, Gemfile, composer.json and similar. Use the project's language, HTTP`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` client, module layout, error-handling conventions and test runner. If there is no project yet or`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` the stack is unclear, use TypeScript on Node 18+ with the built-in fetch and no new dependencies.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- If the project already has a Finesse API client module, add this to it (reuse its auth, base`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` URL, error type and retry helper) instead of creating a parallel one.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Keep the base URL (https://fi.production.flamapis.com) in one constant or config value.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`ENDPOINT`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Method: POST`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- URL: https://fi.production.flamapis.com/flam-voice-svc/api/v1/public/voices/{id}/speak`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Request Content-Type: application/json`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- The voice must be enrolled (status \"ready\"), and must belong to the key's workspace or be a`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` public platform voice (as returned by the list endpoint).`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`PARAMETERS`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- id (path, string, required): the voice id, a 24-character hex string (for example`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` \"665f1a2b3c4d5e6f7a8b9c0d\"). Validate it locally against /^[0-9a-f]{24}$/i and URL-encode it.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`REQUEST BODY`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- text (string, required): the text to synthesize. Maximum 10,000 characters; over the limit`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` returns 400 \"text too long (max 10000 chars)\". Check locally: reject empty text and count`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` characters (Unicode code points, not bytes), e.g. [...text].length in JavaScript.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- language (string, optional): BCP-47 code (e.g. \"en\", \"hi\", \"es\"). Defaults to the voice's`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` primary_language.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- output_format (string, optional, default \"wav\"): one of`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` wav - self-contained WAV file (recommended for playback/download)`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` s16le - signed 16-bit little-endian PCM (headerless)`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` s24le - signed 24-bit little-endian PCM (headerless)`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` s32le - signed 32-bit little-endian PCM (headerless)`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` f32le - 32-bit float little-endian PCM (headerless)`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` f64le - 64-bit float little-endian PCM (headerless)`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` mulaw - G.711 mu-law, 8-bit (headerless), for phone calls; requires sample_rate 8000`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` The headerless formats need a known sample rate and channel count to play.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- sample_rate (integer, optional, default 24000): output rate in Hz. Defaults to the provider's`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` native rate (24000); values above it are upsampled. 8000 (telephony) is produced as asked;`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` other rates below 24000 return 24000.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- num_step (integer, optional, default 32): inference steps, 1-32; a quality vs latency trade-off.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- expressiveness (number, optional): accepted (0.0-1.0) but has no effect today; the engine`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` ignores it. Do not present it as a working control.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Validate the enums and ranges locally and omit optional fields the caller did not set.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` {`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` \"text\": \"The quick brown fox jumps over the lazy dog.\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` \"language\": \"en\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` \"output_format\": \"wav\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` \"sample_rate\": 24000,`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` \"expressiveness\": 0.5`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`AUTHENTICATION`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Send the header X-API-Key: \u003cworkspace API key> on every request. Keys start with \"flv_\".`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Required scope: tts. Keys carry one or more scopes (voices:read, voices:write, clone,`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` tts); a key without this scope gets 403 with code \"insufficient_scope\". Keys created before`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` scopes existed have all four.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Read the key from the environment variable FINESSE_API_KEY (or the project's existing secrets or`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` config mechanism). Fail fast with a clear error if it is missing, before making any request.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Never hard-code, log or commit the key, and never ship it in browser/client-side code: call this`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` from server-side code only. A key with the tts scope can synthesize with every voice in its`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` workspace.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- A key is bound to one workspace. Referencing a voice or job from another workspace returns 404.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Keys can expire: an expired key returns 401 with code \"key_expired\". Do not retry; surface it so`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` an operator can rotate the key.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Browser alternative: instead of X-API-Key, send Authorization: Bearer \u003ctoken> with a`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` short-lived \"fin_tok_...\" token that YOUR server minted via`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` POST https://fi.production.flamapis.com/flam-voice-svc/api/v1/public/tokens (see the \"Create an`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` access token\" endpoint). A token grants tts only, is single use (consumed by one successful`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` request), and may be restricted to specific voice_ids. Unknown, expired or already-used token:`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` 401 with code \"token_invalid\" (mint a new one). Voice outside the token's voice_ids: 403 with code`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` \"voice_not_allowed\". Only support this mode if the project needs browser-side synthesis.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`SUCCESS RESPONSE (200): RAW AUDIO BYTES, NOT JSON`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- The body is the audio file itself. Do not parse it as JSON; read it as binary`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` (e.g. await res.arrayBuffer()).`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Check the status BEFORE reading the body: only a 2xx body is audio.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Response headers to capture:`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` Content-Type the audio MIME type, e.g. audio/wav for output_format \"wav\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` X-Sample-Rate sample rate of the returned audio in Hz (when reported); parse to a number`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` X-Audio-URL public URL of the stored audio file, when object storage is enabled`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` X-Billing-Remaining remaining monthly character allowance, when billing is active`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` All of these except Content-Type may be absent: type them as optional.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`ERROR RESPONSES (JSON, even though success is binary)`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`Errors use the standard envelope:`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` {`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` \"status\": 400,`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` \"error\": true,`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` \"message\": \"Voice is not enrolled yet\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`Billing and plan denials do NOT use the envelope. They return a flat JSON body whose \"error\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`field is a string, not a boolean:`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` { \"error\": \"plan limit reached\", \"feature\": \"max_voices\", \"limit\": 10 }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` { \"error\": \"quota_exhausted\", \"unit\": \"character\", \"limit\": 100000, \"used\": 100000 }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`The \"error\" string is the denial reason (for example quota_exhausted, insufficient_credits,`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`feature_disabled, or \"plan limit reached\"). Tell the two shapes apart by`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`checking whether \"error\" is a boolean (envelope) or a string (flat denial), and expose`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`feature / unit / limit / used on your error type when present.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`A 402 can come in either shape. The plan check before synthesis returns the flat body; the credit`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`check inside synthesis returns the standard envelope:`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` { \"status\": 402, \"error\": true, \"message\": \"insufficient_credits\" }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- 400: invalid request: missing or invalid field, text over 10,000 characters, or the voice is not`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` ready yet (\"Voice is not enrolled yet\"). Do not retry.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- 401: X-API-Key missing, malformed, invalid or revoked, or code \"key_expired\" /`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` \"token_invalid\". Do not retry.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- 402: not enough credits or allowance. Either the flat body (insufficient_credits or`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` quota_exhausted, with unit, limit, used) or the envelope with message \"insufficient_credits\".`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` Do not retry; surface it so the app can prompt a top-up/upgrade.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- 403 with code \"insufficient_scope\": the key lacks the tts scope. Do not retry.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- 403 with code \"voice_not_allowed\": the Bearer token is restricted to other voices. Do not retry.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- 403: not permitted, plan limit reached, or feature disabled for the plan (flat body). Do not`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` retry.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- 404 with code \"not_found\" (also returned for a malformed id): voice not found, including voices owned by another workspace. Do not retry.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- 422 with code \"invalid_input\": the input could not be processed. Do not retry.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- 429 with code \"rate_limited\" (over the plan's requests per second) or \"concurrency_limited\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` (the workspace already has its plan's maximum synthesis requests in flight): wait the number of seconds in the Retry-After header, then retry with backoff.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` See /guides/rate-limits.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- 502 with code \"upstream_error\": the synthesis service failed or is warming up. Retry with backoff.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- 503 with code \"upstream_busy\": the synthesis service is at capacity. Wait the number of seconds in the Retry-After header, then retry with backoff.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Surface failures as one typed error (for example FinesseApiError) carrying: HTTP status,`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` code (when present), message`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` (the envelope \"message\" or the flat \"error\" string), optional feature / unit / limit / used, a`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` retryable flag, the request id (the X-Request-Id response header; error bodies also carry it as`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` request_id), and the raw body for debugging. Log the request id with every failure.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Parse error bodies defensively: if a body is not valid JSON, keep the raw text in the error.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`RETRIES AND TIMEOUTS`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Retry 429, 502, 503 and network errors/timeouts (on 429/503 wait the Retry-After seconds first) with exponential backoff plus jitter (about 1s, 2s,`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` 4s; at most 3 retries). Retrying is safe here: an identical request (same voice, text and`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` parameters) is served from cache and not billed again.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- The first request after a long idle period can be slow while the engine warms up; use a generous`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` request timeout (configurable) rather than a short default.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Never retry 400, 401, 402, 403, 404 or 422.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`BILLING`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Billed per character of text against the plan's monthly allowance.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Repeating an identical request is served from cache and not billed again.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Expose billingRemaining (from X-Billing-Remaining) so callers can warn before running out; an`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` exhausted allowance returns 402 when enforcement is on.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`ACCEPTANCE CRITERIA`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- synthesizeSpeech validates id, text length and parameter ranges locally, sends only documented`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` fields, and returns the audio bytes plus the parsed headers.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- A non-2xx response is never treated as audio; both the envelope and the flat billing body are`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` parsed into the typed error.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- 429/502/503 are retried with backoff; other 4xx are not.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- The key is never logged or sent from client-side code.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`TEST PLAN`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Unit tests with mocked HTTP: 200 with audio/wav bytes and all four headers; 200 with only`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` Content-Type; 400 \"Voice is not enrolled yet\"; 402 quota_exhausted flat body; 402`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` insufficient_credits envelope; 404; 429 then 200;`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` 502 then 200; 10,001-character text rejected locally; num_step 0 and 33 rejected locally.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Smoke script:`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Get a ready voice id from FLAM_VOICE_ID, or by calling GET https://fi.production.flamapis.com/flam-voice-svc/api/v1/public/voices (same`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` X-API-Key header; voices are in data.voices) and picking the first one whose status is \"ready\".`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` - Synthesize \"Hello from Finesse.\" with output_format \"wav\", write speech.wav, and assert the`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` file starts with the ASCII bytes \"RIFF\" and Content-Type is audio/wav. Print the byte count,`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` X-Sample-Rate, X-Audio-URL and X-Billing-Remaining. Exit non-zero on error.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`RULES`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Implement only what this spec describes. Do not invent parameters, fields, headers, endpoints or`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` error codes. If something is ambiguous, missing, or conflicts with the existing codebase, stop`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` and ask me before guessing.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- Match the project's existing style and conventions; do not refactor unrelated code.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Synthesize speech","description":"Turn text into a single audio file using a cloned voice.","api":"POST /flam-voice-svc/api/v1/public/voices/{id}/speak","href":"/voice-api/synthesize-speech"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Authorization","slug":"authorization","depth":4,"children":[]},{"title":"Path parameters","slug":"path-parameters","depth":4,"children":[]},{"title":"Body","slug":"body","depth":4,"children":[]},{"title":"Response headers","slug":"response-headers","depth":4,"children":[]},{"title":"Prompt","slug":"prompt","depth":2,"children":[]}],"codeExamples":{},"endpoint":{"title":"Synthesize speech","path":"/flam-voice-svc/api/v1/public/voices/{id}/speak","servers":[{"url":"https://fi.production.flamapis.com"}],"method":"post","request":{"security":[{"title":"API Key Auth","parameters":{"header":{"X-API-Key":{"type":"apiKey"}},"query":{},"cookie":{}}}],"parameters":{"query":{},"header":{"X-API-Key":{"schema":[{"type":"string","description":"Your workspace API key ( `flv_…` ), from server-side code. Required scope: `tts` ."}]},"Authorization":{"schema":[{"type":"string","description":"Alternative for browsers: `Bearer fin_tok_…` , a short-lived, single-use token your server minted with Create an access token . Send either this or `X-API-Key` ."}]}},"cookie":{},"path":{"id":{"schema":[{"type":"string","description":"The voice id.","required":true}]}}},"body":{"application/json":{"schemaArray":[{"type":"object","properties":{"text":[{"type":"string","description":"The text to synthesize. Maximum 10,000 characters . Billed per character against your plan’s monthly allowance; repeating an identical request (same voice, text, and parameters) is served from cache and not billed again.","required":true}],"language":[{"type":"string","description":"BCP-47 language code (for example `en` , `hi` ). Defaults to the voice’s primary language."}],"output_format":[{"type":"string","description":"Output encoding. One of `wav` , `s16le` , `s24le` , `s32le` , `f32le` , `f64le` , `mulaw` . `wav` is a self-contained file; the `s*` / `f*` formats are raw, headerless PCM; `mulaw` is raw G.711 µ-law for phone calls and requires `sample_rate: 8000` ."}],"sample_rate":[{"type":"integer","description":"Output sample rate in Hz. Defaults to the provider’s native rate ( `24000` ); values above it are upsampled. `8000` (telephony) is produced as asked; other rates below `24000` return `24000` ."}],"num_step":[{"type":"integer","description":"Number of inference steps, `1` – `32` (a quality/latency trade-off). Provider default ( `32` ) if omitted."}],"expressiveness":[{"type":"number","description":"Accepted ( `0.0` – `1.0` ) but has no effect today : the engine ignores it, so the audio is the same with or without it."}]}}],"examples":{"example":{"value":{"text":"\u003cstring>","language":"\u003cstring>","output_format":"\u003cstring>","sample_rate":123,"num_step":123,"expressiveness":123}}}}}},"response":{"200":{"application/json":{"schemaArray":[{"type":"object","properties":{"Content-Type":[{"type":"string","description":"The audio MIME type, e.g. `audio/wav` for `output_format: wav` ."}],"X-Sample-Rate":[{"type":"string","description":"The sample rate of the returned audio, in Hz (when reported by the provider)."}],"X-Audio-URL":[{"type":"string","description":"A public URL to the stored audio file, when object storage is enabled. Useful for download/share."}],"X-Billing-Remaining":[{"type":"string","description":"Your remaining character allowance for the month (present when billing is active). An exhausted allowance returns `402` when enforcement is on - either a flat billing body or the standard envelope with `message: \"insufficient_credits\"` , see Errors ."}]}}],"examples":{"example":{"value":{"Content-Type":"\u003cstring>","X-Sample-Rate":"\u003cstring>","X-Audio-URL":"\u003cstring>","X-Billing-Remaining":"\u003cstring>"}}}}}},"deprecated":false}},"jsLinks":[],"subdomain":"finesse-docs","siteName":"Finesse","title":"Synthesize speech - Finesse","contextualStarterQuestions":[],"navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-10-21T19:26:24.308Z","originalFileLocation":"voice-api/synthesize-speech.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=\"light\";if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"light\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Turn text into a single audio file using a cloned voice.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Finesse\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/finesse-docs/9nsqrG5QOUT6LAm6/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/finesse-docs/9nsqrG5QOUT6LAm6/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/finesse-docs/9nsqrG5QOUT6LAm6/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/finesse-docs/9nsqrG5QOUT6LAm6/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/finesse-docs/9nsqrG5QOUT6LAm6/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/finesse-docs/9nsqrG5QOUT6LAm6/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/finesse-docs/9nsqrG5QOUT6LAm6/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/finesse-docs/9nsqrG5QOUT6LAm6/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/finesse-docs/9nsqrG5QOUT6LAm6/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Synthesize speech - Finesse\">\u003cmeta data-mint-head property=\"og:description\" content=\"Turn text into a single audio file using a cloned voice.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Finesse\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.finesse.flamapp.ai/voice-api/synthesize-speech\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://finesse-docs.mintlify.site/_mintlify/api/og/v2?division=Speech\u0026amp;title=Synthesize+speech\u0026amp;description=Turn+text+into+a+single+audio+file+using+a+cloned+voice.\u0026amp;theme=b900d03be7b2e5a1a2310fa6\u0026amp;signature=419ebbafbf69bed215a4c118654237d36d41729c94ceb2981f61a527bbcbbeb7\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Synthesize speech - Finesse\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Turn text into a single audio file using a cloned voice.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://finesse-docs.mintlify.site/_mintlify/api/og/v2?division=Speech\u0026amp;title=Synthesize+speech\u0026amp;description=Turn+text+into+a+single+audio+file+using+a+cloned+voice.\u0026amp;theme=b900d03be7b2e5a1a2310fa6\u0026amp;signature=419ebbafbf69bed215a4c118654237d36d41729c94ceb2981f61a527bbcbbeb7\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/finesse-docs/9nsqrG5QOUT6LAm6/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Finesse\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#2547F0\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.finesse.flamapp.ai/voice-api/synthesize-speech\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/voice-api/synthesize-speech.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.finesse.flamapp.ai/#organization\",\"name\":\"Finesse\",\"url\":\"https://docs.finesse.flamapp.ai\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/finesse-docs/u9NNXVA8yD6Y29Xd/logo/finesse-light.png?fit=max\u0026auto=format\u0026n=u9NNXVA8yD6Y29Xd\u0026q=85\u0026s=665b8b35d46e51f6ae805dffc09b6fc1\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.finesse.flamapp.ai#website\",\"name\":\"Finesse\",\"url\":\"https://docs.finesse.flamapp.ai\",\"publisher\":{\"@id\":\"https://docs.finesse.flamapp.ai/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.finesse.flamapp.ai/voice-api/synthesize-speech#webpage\",\"url\":\"https://docs.finesse.flamapp.ai/voice-api/synthesize-speech\",\"name\":\"Synthesize speech\",\"description\":\"Turn text into a single audio file using a cloned voice.\",\"dateModified\":\"2026-10-21T19:26:24.308Z\",\"isPartOf\":{\"@id\":\"https://docs.finesse.flamapp.ai#website\"},\"breadcrumb\":{\"@id\":\"https://docs.finesse.flamapp.ai/voice-api/synthesize-speech#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.finesse.flamapp.ai/voice-api/synthesize-speech#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Finesse\",\"item\":\"https://docs.finesse.flamapp.ai\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Synthesize speech\",\"item\":\"https://docs.finesse.flamapp.ai/voice-api/synthesize-speech\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://docs.finesse.flamapp.ai/voice-api/synthesize-speech#apireference\",\"headline\":\"Synthesize speech\",\"name\":\"Synthesize speech\",\"description\":\"Turn text into a single audio file using a cloned voice.\",\"url\":\"https://docs.finesse.flamapp.ai/voice-api/synthesize-speech\",\"mainEntityOfPage\":{\"@id\":\"https://docs.finesse.flamapp.ai/voice-api/synthesize-speech#webpage\"},\"dateModified\":\"2026-10-21T19:26:24.308Z\",\"publisher\":{\"@id\":\"https://docs.finesse.flamapp.ai/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.finesse.flamapp.ai#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Finesse\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"Finesse\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/voice-api/synthesize-speech.md","siteName":"Finesse","nav":{"global":null,"tabs":[{"tab":"Get started","pages":[{"title":"Get started","href":"/introduction"}]},{"tab":"SDKs","pages":[{"title":"SDKs","href":"/sdks/overview"}]},{"tab":"API reference","groups":[{"group":"Authentication","icon":"lock","pages":[{"title":"Create an access token","api":"POST /flam-voice-svc/api/v1/public/tokens","tag":"START HERE","href":"/voice-api/create-token"}]},{"group":"Voices","icon":"microphone","pages":[{"title":"List voices","api":"GET /flam-voice-svc/api/v1/public/voices","href":"/voice-api/list-voices"},{"title":"Get a voice","api":"GET /flam-voice-svc/api/v1/public/voices/{id}","href":"/voice-api/get-voice"},{"title":"Create a voice","api":"POST /flam-voice-svc/api/v1/public/voices","href":"/voice-api/create-voice"},{"title":"Clone a voice","api":"POST /flam-voice-svc/api/v1/public/voices/clone","href":"/voice-api/clone-voice"},{"title":"Enroll a voice","api":"POST /flam-voice-svc/api/v1/public/voices/{id}/enroll","href":"/voice-api/enroll-voice"},{"title":"Get a job","api":"GET /flam-voice-svc/api/v1/public/jobs/{id}","href":"/voice-api/get-job"},{"title":"Update a voice","api":"PATCH /flam-voice-svc/api/v1/public/voices/{id}","href":"/voice-api/update-voice"},{"title":"Delete a voice","description":"Delete a voice from your workspace.","api":"DELETE /flam-voice-svc/api/v1/public/voices/{id}","href":"/voice-api/delete-voice"}]},{"group":"Speech","icon":"waveform","pages":[{"title":"Synthesize speech","api":"POST /flam-voice-svc/api/v1/public/voices/{id}/speak","href":"/voice-api/synthesize-speech"},{"title":"Stream speech (SSE)","description":"Stream synthesized audio as Server-Sent Events for low-latency playback.","api":"POST /flam-voice-svc/api/v1/public/voices/{id}/stream","href":"/voice-api/stream-speech"},{"title":"Realtime (WebSocket)","href":"/voice-api/realtime-websocket"},{"title":"Create a direct realtime session","api":"POST /flam-voice-svc/api/v1/public/realtime/sessions","href":"/voice-api/realtime-sessions"}]},{"group":"Compatibility","icon":"plug","pages":[{"title":"OpenAI-compatible API","href":"/voice-api/openai-compatible"}]},{"group":"Reference","icon":"book","pages":[{"title":"The Voice object","href":"/voice-api/voice-object"},{"title":"Synthesize parameters","href":"/voice-api/synthesize-parameters"},{"title":"Errors \u0026 response envelope","href":"/voice-api/errors"}]}]},{"tab":"Changelog","pages":[{"title":"Changelog","href":"/changelog/api"}]}]},"basePath":"","title":"Synthesize speech - Finesse","deploymentId":"dpl_EwfxjeKENdVkfzdag8rM6mKzcTUJ","buildId":"dpl_EwfxjeKENdVkfzdag8rM6mKzcTUJ","dynamics":["c2aa737661","2b790eda92","b0f84f53ff"],"chunks":["OpenApiReferenceProvider-B8kPdtB2.js","snippetPresets-C-p1aFQ1.js","utils-B9NnUZSZ.js","style-to-object-BY3JEAdk.js","utils-DFxl7cW2.js","v4-DIgz8zy6.js","addTypeLabelsToSchema-bSr9h7OB.js","conditional-requirements-CFM0id0Q.js","cloneDeep-Bw4Gcy_r.js","_Uint8Array-C68x8Gny.js","isObject-FP1Yky1u.js","ApiExamples-BXsp8PHs.js","usePlaygroundInputsStore-BlAOLmIF.js","shallow-C2F02mqa.js","isEqual-C8iG4q2G.js","CodeSnippets-45lHR04X.js","CodeSnippet-6Cemznl-.js","use-playground-group-access-Cyy8SXp5.js","Page-CeZ_ZB5X.js","api-description-markdown-DiOdv5rp.js","DynamicMarkdown-B_9ywLDq.js","SectionHeading-Cc2r-uqU.js","MethodPill-Df3Tcu4c.js","getPastedJson-B3vrV0wE.js","Check2Icon-YQhSFafd.js","axios-CsQoIw0U.js"]}