Audio · OpenAI
Voice Consents
Manage voice consent recordings required for custom voice creation.
Voice consent recordings are required before creating custom voices via the OpenAI API. Each consent recording must include a spoken consent phrase in the specified language.
Create Consent
POST
/v1/audio/voice_consentsUpload a voice consent recording.
Multipart Form Parameters
recordingfileformrequiredAudio file of the consent phrase
languagestringformrequiredBCP 47 language tag (e.g. en-US)
namestringformrequiredLabel for this consent recording
cURL
curl https://api.metriqual.com/v1/audio/voice_consents \
-H "Authorization: Bearer mql_your_key" \
-F language=en-US \
-F name="My Consent" \
-F recording=@/path/to/consent.mp3TypeScript SDK
const consent = await mql.audio.createVoiceConsent({
recording: consentAudioFile,
language: 'en-US',
name: 'My Consent',
});
console.log('Consent ID:', consent.id);Python SDK
with open("consent.mp3", "rb") as f:
consent = mql.audio.create_voice_consent(
file=f, language="en-US", name="My Consent"
)
print("Consent ID:", consent["id"])200
{
"id": "vc_abc123",
"created_at": 1719000000,
"language": "en-US",
"name": "My Consent",
"object": "audio.voice_consent"
}Retrieve Consent
GET
/v1/audio/voice_consents/:consent_idRetrieve a voice consent recording by ID.
Path Parameters
consent_idstringpathrequiredThe consent recording identifier
cURL
curl https://api.metriqual.com/v1/audio/voice_consents/vc_abc123 \
-H "Authorization: Bearer mql_your_key"TypeScript SDK
const consent = await mql.audio.getVoiceConsent('vc_abc123');
console.log(consent.name, consent.language);Python SDK
consent = mql.audio.get_voice_consent("vc_abc123")
print(consent["name"], consent["language"])200
{
"id": "vc_abc123",
"created_at": 1719000000,
"language": "en-US",
"name": "My Consent",
"object": "audio.voice_consent"
}Update Consent
POST
/v1/audio/voice_consents/:consent_idUpdate a voice consent recording's metadata (name only).
Path Parameters
consent_idstringpathrequiredThe consent recording identifier
Body Parameters
namestringbodyrequiredUpdated label for this consent recording
cURL
curl https://api.metriqual.com/v1/audio/voice_consents/vc_abc123 \
-H "Authorization: Bearer mql_your_key" \
-H "Content-Type: application/json" \
-d '{"name": "Updated Consent Name"}'TypeScript SDK
const updated = await mql.audio.updateVoiceConsent('vc_abc123', {
name: 'Updated Consent Name',
});
console.log('Updated:', updated.name);Python SDK
updated = mql.audio.update_voice_consent(
"vc_abc123", name="Updated Consent Name"
)
print("Updated:", updated["name"])200
{
"id": "vc_abc123",
"created_at": 1719000000,
"language": "en-US",
"name": "Updated Consent Name",
"object": "audio.voice_consent"
}Delete Consent
DELETE
/v1/audio/voice_consents/:consent_idDelete a voice consent recording.
Path Parameters
consent_idstringpathrequiredThe consent recording identifier
cURL
curl -X DELETE https://api.metriqual.com/v1/audio/voice_consents/vc_abc123 \
-H "Authorization: Bearer mql_your_key"TypeScript SDK
const result = await mql.audio.deleteVoiceConsent('vc_abc123');
console.log('Deleted:', result.deleted);Python SDK
result = mql.audio.delete_voice_consent("vc_abc123")
print("Deleted:", result["deleted"])200
{
"id": "vc_abc123",
"deleted": true,
"object": "audio.voice_consent"
}List Consents
GET
/v1/audio/voice_consentsReturns a paginated list of voice consent recordings.
Query Parameters
afterstringqueryCursor for pagination — object ID to start after
limitnumberqueryMax objects to return (1–100, default 20)
cURL
curl https://api.metriqual.com/v1/audio/voice_consents \
-H "Authorization: Bearer mql_your_key"TypeScript SDK
// List all consents
const consents = await mql.audio.listVoiceConsents();
consents.data.forEach(c => {
console.log(c.id, c.name, c.language);
});
// Paginate
const page2 = await mql.audio.listVoiceConsents({
after: consents.last_id,
limit: 10,
});Python SDK
consents = mql.audio.list_voice_consents()
for c in consents["data"]:
print(c["id"], c["name"], c["language"])200
{
"data": [
{
"id": "vc_abc123",
"created_at": 1719000000,
"language": "en-US",
"name": "My Consent",
"object": "audio.voice_consent"
}
],
"has_more": false,
"object": "list",
"first_id": "vc_abc123",
"last_id": "vc_abc123"
}