Atmee.aiDocs
APIAPI referenceGeneration

Design a voice

POST
/v1/generation/voices

Designs voice previews from a description of how the voice should sound. Each preview runs 10 to 60 seconds, the length an avatar's voice sample needs: a short one is made once more with a longer read, and one still outside that range is dropped.

  • Text: sampleText is what every preview says, in language; without it, a greeting is written from the description. Each preview reports what it actually says in spokenText.
  • Output: each preview is an upload:<uploadId> that POST /v1/avatars (assets.voice) and PUT /v1/avatars/{avatarId}/voice take as is, with a short-lived url to play it. durationSeconds is null when the length is unknown.
  • Billing and idempotency: as for POST /v1/generation/portraits.
  • Scopes: generation:write and avatars:write.

Authorization

headerX-Api-Key<token>

Your secret API key (sk_atmee_...; older keys start sk_live_), sent as X-Api-Key. Keep it on your server and never send it to a browser.

Header Parameters

Idempotency-Key*string

A new UUID minted for this request. Reuse it only to retry the same request: a retry never charges twice and returns the first result. A malformed key, or a key already used with different inputs, gets 400 invalid_input.

Lengthlength <= 255

Request Body

application/json
  1. body
voiceDescription*string

How the voice should sound: age, tone, pace, accent, character.

Length20 <= length <= 1000
avatarName?string

The avatar's name; the written sample says it.

Lengthlength <= 100
language?string

The language the voice speaks. Default en.

Value in"en""zh-TW""zh-CN""ja""ko""fr""vi""es""de""hi""ru"
sampleText?string

What every preview says, in language: 220 to 600 characters for Latin and Cyrillic scripts, 120 to 300 for Chinese, Japanese and Korean, 180 to 450 for Hindi. Absent, a greeting is written from the description.

Lengthlength <= 600

Response Body

The voice previews (or the replayed first result).

application/json
  1. response
voices*array<>
Items1 <= items
language*string
Value in"en""zh-TW""zh-CN""ja""ko""fr""vi""es""de""hi""ru"
microcreditsCharged*integer

What this call charged to credits (100 microcredits = 1 credit), after the plan's free generation allowance; 0 on a replay. The call's price is microcreditsCharged + microcreditsFree.

microcreditsFree*integer

The part of the price the plan's free generation allowance covered (pricing.generation.freeAllowance on GET /v1/account); 0 on a replay and when none is left.

replayed*boolean

True when an earlier call with the same Idempotency-Key was replayed.

failedProviders*array<string>

The providers that returned nothing usable.

Example Request
curl -X POST 'https://api.atmanity.us/v1/generation/voices' \  -H 'Idempotency-Key: string' \  -H 'Content-Type: application/json' \  -d '{  "voiceDescription": "stringstringstringst"}'
Example Response
{  "voices": [    {      "upload": "upload:3f1c2a9e-8d4b-4f6a-9c2e-1b7d5a0e4c11",      "url": "http://example.com",      "expiresAt": "2019-08-24T14:15:22Z",      "provider": "string",      "spokenText": "string",      "durationSeconds": 0,      "unavailable": true    }  ],  "language": "en",  "microcreditsCharged": 0,  "microcreditsFree": 0,  "replayed": true,  "failedProviders": [    "string"  ]}