Get a voice
curl --request GET \
--url https://fi.production.flamapis.com/flam-voice-svc/api/v1/public/voices/{id} \
--header 'X-API-Key: <api-key>'import requests
url = "https://fi.production.flamapis.com/flam-voice-svc/api/v1/public/voices/{id}"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://fi.production.flamapis.com/flam-voice-svc/api/v1/public/voices/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://fi.production.flamapis.com/flam-voice-svc/api/v1/public/voices/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://fi.production.flamapis.com/flam-voice-svc/api/v1/public/voices/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://fi.production.flamapis.com/flam-voice-svc/api/v1/public/voices/{id}")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://fi.production.flamapis.com/flam-voice-svc/api/v1/public/voices/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"data": {
"language": "<string>",
"gender": "<string>"
}
}Voices
Get a voice
Fetch a single voice by id.
GET
/
flam-voice-svc
/
api
/
v1
/
public
/
voices
/
{id}
Get a voice
curl --request GET \
--url https://fi.production.flamapis.com/flam-voice-svc/api/v1/public/voices/{id} \
--header 'X-API-Key: <api-key>'import requests
url = "https://fi.production.flamapis.com/flam-voice-svc/api/v1/public/voices/{id}"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://fi.production.flamapis.com/flam-voice-svc/api/v1/public/voices/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://fi.production.flamapis.com/flam-voice-svc/api/v1/public/voices/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://fi.production.flamapis.com/flam-voice-svc/api/v1/public/voices/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://fi.production.flamapis.com/flam-voice-svc/api/v1/public/voices/{id}")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://fi.production.flamapis.com/flam-voice-svc/api/v1/public/voices/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"data": {
"language": "<string>",
"gender": "<string>"
}
}Returns a single Voice object, in the same shape as an item from
List voices (including
language and gender). The voice must belong to
the API key’s workspace or be a public Finesse platform voice, otherwise the request returns 404.
A malformed id (not a 24-character hex string) also returns 404.
Authorization
Path parameters
Response
The Voice object, plus:
curl "https://fi.production.flamapis.com/flam-voice-svc/api/v1/public/voices/665f1a2b3c4d5e6f7a8b9c0d" \
-H "X-API-Key: $FINESSE_API_KEY"
const id = "665f1a2b3c4d5e6f7a8b9c0d";
const res = await fetch(
`https://fi.production.flamapis.com/flam-voice-svc/api/v1/public/voices/${id}`,
{ headers: { "X-API-Key": process.env.FINESSE_API_KEY } },
);
const { data } = await res.json();
console.log(data);
import os, requests
voice_id = "665f1a2b3c4d5e6f7a8b9c0d"
res = requests.get(
f"https://fi.production.flamapis.com/flam-voice-svc/api/v1/public/voices/{voice_id}",
headers={"X-API-Key": os.environ["FINESSE_API_KEY"]},
)
print(res.json()["data"])
Response
{
"status": 200,
"data": {
"id": "665f1a2b3c4d5e6f7a8b9c0d",
"name": "Studio Narrator",
"status": "ready",
"primary_language": "en",
"language": "en",
"gender": "female",
"visibility": "public",
"clone_method": "instant",
"labels": [
{ "key": "accent", "value": "american" },
{ "key": "gender", "value": "female" }
]
},
"error": false
}
Prompt
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: "Get a voice".
Everything you need is in this prompt. Do not invent anything that is not specified here.
WHAT TO BUILD
- A function getVoice(id) (name it per the project's conventions) that fetches one voice by id and
returns it as a typed Voice object.
- 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: GET
- URL: https://fi.production.flamapis.com/flam-voice-svc/api/v1/public/voices/{id}
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.
- No query or body parameters.
AUTHENTICATION
- Send the header X-API-Key: <workspace API key> on every request. Keys start with "flv_".
- Required scope: voices:read. 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. Treat it like a password.
- A key is bound to one workspace. Referencing a voice or job from another workspace returns 404.
Public Finesse platform voices are readable by every key with the voices:read scope.
- Keys can expire: an expired key returns 401 with code "key_expired". Do not retry; surface it so
an operator can rotate the key.
RESPONSE ENVELOPE
JSON responses use one envelope. On success "error" is false and the payload is in "data":
{
"status": 200,
"data": { "...": "endpoint payload" },
"error": false
}
On failure "error" is true, "data" is omitted and "message" carries the detail:
{
"status": 404,
"error": true,
"message": "Voice not found"
}
SUCCESS RESPONSE (200, application/json)
"data" is the Voice object itself:
{
"status": 200,
"data": {
"id": "665f1a2b3c4d5e6f7a8b9c0d",
"name": "Studio Narrator",
"status": "ready",
"primary_language": "en",
"language": "en",
"gender": "female",
"visibility": "public",
"clone_method": "instant",
"labels": [
{ "key": "accent", "value": "american" },
{ "key": "gender", "value": "female" }
]
},
"error": false
}
VOICE OBJECT (define a type for it; timestamps are Unix epoch MILLISECONDS)
- id: string. Unique voice id, 24-character hex. Used by the synthesize endpoints.
- name: string. Display name.
- description: string, optional.
- status: string. Only "ready" voices can synthesize. All values: "draft" (created, no audio yet),
"uploading", "queued", "verifying", "processing", "training" (in progress), "ready", "failed"
(creation did not succeed), "archived" and "deleted".
Type it as a string union of these values but tolerate other strings (treat them as not usable).
- clone_method: "instant" | "professional" | "design" | "remix" | "guided".
- visibility: "private" | "org" | "public".
- primary_language: string, BCP-47 (e.g. "en"). Used when a synthesis request omits language.
- language: string. Same value as primary_language.
- gender: string, optional. The value of the "gender" label, when present.
- labels: array of { key: string, value: string }, optional. Common keys: accent, gender, age,
use_case. Example: [{ "key": "accent", "value": "american" }]
- settings: object, optional, present only when configured. Synthesis defaults: stability,
similarity, style, speed, pitch, volume, use_speaker_boost, emotion, engine_params.
- sample_audio_url: string, optional. Public URL of a short preview clip.
- base_voice_id: string, optional. Present when derived from another voice (clone_method "remix").
- created_at, updated_at: integers (epoch ms).
Optional fields may be absent. Responses may contain extra fields: ignore them, never fail on them.
Example:
{
"id": "665f1a2b3c4d5e6f7a8b9c0d",
"name": "Studio Narrator",
"description": "Warm, neutral narration voice.",
"status": "ready",
"clone_method": "instant",
"visibility": "public",
"primary_language": "en",
"labels": [
{ "key": "accent", "value": "american" },
{ "key": "gender", "value": "female" }
],
"sample_audio_url": "https://storage.googleapis.com/.../sample.wav",
"created_at": 1717939200000,
"updated_at": 1717939260000
}
ERRORS
- 401: X-API-Key missing, malformed, invalid or revoked, or code "key_expired". Do not retry.
- 403 with code "insufficient_scope": the key lacks the voices:read scope. Do not retry.
- 404 with code "not_found" (also returned for a malformed id): the voice does not exist or belongs to another workspace. Throw a not-found error (or
return null, if that is the project's convention for lookups); do not retry.
- 429 with code "rate_limited" (over the plan's requests per second): wait the number of seconds in the Retry-After header, then retry with backoff.
See /guides/rate-limits.
- 502 with code "upstream_error": temporarily unavailable. 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
- Retry only 429 (rate limited; wait Retry-After first), 502/503 (upstream unavailable or busy) and network errors or
timeouts, with exponential backoff plus jitter (for example about 1s, 2s, 4s; at most 3 retries),
then surface the error.
- Never retry 400, 401, 402, 403, 404 or 422: they fail the same way again.
ACCEPTANCE CRITERIA
- getVoice(id) validates the id locally, sends GET to the exact URL with the X-API-Key header, and
returns the typed Voice from "data".
- 404 is distinguishable from other failures; 401 is never retried; 429/502/503 are retried.
- A missing FINESSE_API_KEY fails before any network call. The key is never logged.
TEST PLAN
- Unit tests with mocked HTTP: 200 returns a Voice; 404 envelope becomes a not-found error; 401;
502 then 200 (retry); an invalid id (for example "abc") is rejected without a network call.
- Smoke script: read FINESSE_API_KEY and a voice id from FLAM_VOICE_ID (or take the first id returned
by GET https://fi.production.flamapis.com/flam-voice-svc/api/v1/public/voices, whose voices are in data.voices), call getVoice, print name,
status and labels, 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.

