Skip to content
VoiceMint Developers

Authentication

Secret API keys for your server, voice-session tokens for browsers and apps, permissions, and how to keep keys safe.

VoiceMint has two kinds of credentials. Use the right one in the right place.

CredentialLooks likeWhere it livesWhat it can do
Secret API keyvm_sk_live_…, vm_sk_test_…Your server onlyAny API call within its permissions, as your account, spending your credits
Voice-session tokenvm_lst_…A browser page or mobile appOpen one live voice session with one agent or meet, within 60 seconds

Secret keys#

Send the key in the Authorization header on every request:

curl https://api.voicemint.io/api/v1/agents \
  -H "Authorization: Bearer $VOICEMINT_API_KEY"

No cookie, CSRF token or other header is needed. Create, list and revoke keys in the developer console under Developers → API keys; a revoked key stops working immediately. VoiceMint stores only a hash of each key, so a lost key cannot be shown again: create a new one.

Permissions#

Each key has a list of permissions, <resource>.<read|write>:

ResourceCovers
alleverything below
agents/api/v1/agents/... (agents, knowledge, calls, campaigns, workflows, webhooks)
meet/api/v1/meet/...
mediaevery other product: Voice Lab, Music, Video, Image
numbers.purchasebuying and releasing phone numbers (see below)

read allows GET and HEAD only; write allows every method. A live voice session always counts as a write.

Buying phone numbers spends real money, so it needs the separate numbers.purchase permission: agents.write and all.write do not include it. When a key buys a number, the number's setup price and first month's rent are taken from your credits first, and you get an email; the rent then renews every 30 days.

What a key can never do#

Whatever its permissions, a key cannot manage keys or apps, change the account, password or plan, buy credits or reach admin routes. It can read the credit balance but not purchase. A key never has admin rights, even if its owner does.

Test and live keys#

Test (vm_sk_test_…) and live (vm_sk_live_…) keys behave the same and use the same account; the prefix helps you keep production keys apart from development ones and spot them in logs and secret scanners.

Client workspaces (agencies)#

If you manage client workspaces, a key belongs to exactly one place, chosen when you create it: your own account, or one client workspace. A key for a client workspace only acts there.

Voice-session tokens#

A browser or mobile app must never hold a secret key. For live voice, your server asks VoiceMint for a single-use voice-session token and hands it to the client:

curl -X POST https://api.voicemint.io/api/v1/agents/AGENT_ID/live-sessions \
  -H "Authorization: Bearer $VOICEMINT_API_KEY" -H "Content-Type: application/json" \
  -d '{"variables": {"name": "Asha"}}'

The token opens one session, must be used within 60 seconds, works only for that agent, and stops working if the key is revoked first. Authenticate your user before minting one: each session spends your credits. See Live voice.

Securing a key#

  • IP allow-list: restrict a key to your servers' addresses (CIDR ranges). Requests from elsewhere get 403.
  • Spend caps: a daily and monthly credit limit per key; over the cap, calls that cost credits get 402.
  • Expiry: give temporary keys an expiry date.
  • Least privilege: one key per service, with only the products it needs, read where possible.

See Rate limits & spend caps.