Getting started

Authentication

API keys, live and test modes, scopes and safe rotation.

Every request is authenticated with a secret API key sent as a bearer token. Keys belong to a workspace, carry scopes, and are either live or test.

Sending your key

Pass the key in the Authorization header. Requests without a valid key return 401. All traffic is HTTPS. Plain HTTP is redirected to HTTPS, but always use https:// so your key never crosses the network unencrypted.

curl "https://api.intactvoice.com/v1/usage?start=2026-10-01&end=2026-10-05" \
  -H "Authorization: Bearer $API_KEY"

Live and test keys

The prefix tells you the mode at a glance, and the API refuses to mix them (a test key can't read live voices).

PrefixModeBillingBehaviour
sk_live_…LiveUses plan wordsFull models, real voices, counts toward rate limits for your plan.
sk_test_…TestNever billedSame validation, fact checks and response fields. No models run: the text gets the deterministic clean-up and scores are simulated from the text (model names end in -test). Deterministic for a given input apart from ids and timings. Limited to 60 requests/min.

Tip:

Use test keys in CI. The text and scores are stable for a given input, so snapshot tests stay stable once ids and timings are ignored, and fidelity failures still surface so you can test your error handling.

Scopes

Create restricted keys for each service so a leaked key can do as little as possible.

ScopeGrants
rewritePOST /rewrite.
detectPOST /detect.
voicesPOST /voices, GET /voices, GET and DELETE /voices/{voice_id}.
usageGET /usage, for billing dashboards and cost alerts.

A request outside a key's scopes returns 403 permission_denied with the missing scope in error.param. GET /jobs/{job_id} and its event stream need no scope: any key in the same workspace and mode can read a job by id.

Rotating keys

Rotate on a schedule (every 90 days is a sensible default) and immediately if a key might have leaked.

  1. Create a new key

    In Dashboard → API keys, create a key with the same scopes and mode. Both keys work until you revoke the old one.

  2. Deploy the new value

    Update your secret manager and redeploy. Nothing else changes: voices, jobs and usage belong to the workspace, not the key.

  3. Confirm traffic has moved, then revoke

    Call GET /usage with group_by=key. When the old key shows no requests, revoke it in the dashboard.

Warning:

Suspect a leak?

Revoke the key in the dashboard right away; it fails with 401 from the next request. In-flight async jobs created by the old key still complete and still deliver webhooks.

Keeping keys safe

  • Call the API from your server, a queue worker or an edge function, never from a browser or mobile app.
  • Give each environment and service its own key, so revoking one doesn't take down the rest.
  • Don't log the Authorization header. The X-Request-Id response header (req_…) and job ids (job_…) are safe to log and are what support will ask for.