Getting access
Everything on this site works against a 2wai account that’s been enrolled in the developer program. This page covers that enrollment, where your sk_ key comes from, and the opt-in that lets your own custom avatars be reachable through the developer API.
Enroll at 2wai.ai/developers
Section titled “Enroll at 2wai.ai/developers”The developer portal is hosted on the main 2wai site, not here. Sign up and manage keys at:
- Create or sign in to a 2wai account at https://2wai.ai. Email/password or Google.
- Open the Developer area at https://2wai.ai/developers.
- Accept the developer agreement. This is the legal gate between a regular 2wai account (consumer) and developer access (API usage with billing exposure).
- Get auto-approved on the thinned baseline (verified email + not disabled + not rate-locked). If you miss one of those, the request goes to a short admin-review queue.
- Generate a key in the Developer Console. You’ll see:
sk_test_...andsk_live_.... Today both run the real pipeline and both are metered against your account (see below). The plaintext key is shown once at creation. Copy it immediately into your server’s environment (TWAI_SECRET_KEY=sk_live_...) or secrets manager.
sk_test_ vs sk_live_
Section titled “sk_test_ vs sk_live_”sk_test_ keys are not a sandbox today. Nothing in the gateway treats them differently: a test key runs the real avatar pipeline, renders real video, and is metered against your account exactly like a live key. There are no canned responses and no virtual quota.
sk_test_ | sk_live_ | |
|---|---|---|
| Where it hits | Same api.2wai.ai/v1/* surface | Same |
| What it runs | The real pipeline | The real pipeline |
| Metering | Metered against your account | Metered against your account |
Use the two prefixes to keep your own environments apart (for example a test key in CI and staging, a live key in production), and budget for test traffic the same as live traffic.
Expose your own avatars via the developer API
Section titled “Expose your own avatars via the developer API”By default, avatars you create in Avatar Studio (the consumer avatar-creation flow) are private to your account and not reachable through api.2wai.ai. To make an avatar available via your developer sk_:
- Create or open an avatar in Studio at https://2wai.ai/studio.
- Flip the “API-expose” toggle for that avatar in the Developer Console’s Avatars tab at 2wai.ai/developers/avatars. This writes
api_exposed_aton the avatar — the developer-portal gate that lets the API read it. - Resolve it from code by handle via
GET /v1/avatars/{owner}/{name}; see Catalog hydrate. The response’savatar_id(a gen id,gen-plus 26 lowercase letters and digits) is what you pass toPOST /v1/sessions. A hydrate200does not by itself prove the avatar is mintable: mint also checks that it is ready on LiveKit.
Listed (public) avatars may resolve through catalog hydrate without this toggle, but to mint a session with your sk_ the avatar’s owner must have exposed it to the API in Studio.
Where the keys live and how they’re billed
Section titled “Where the keys live and how they’re billed”- Issuance — the Developer Console at 2wai.ai/developers. SHA-256 hashed in gen-2wai’s
gen_developer_keytable; the plaintext is shown once and never retrievable. - Validation —
api.2wai.ai(the gateway) checks everysk_on every request. For keys issued by the Developer Portal, the gateway resolves them via a service-to-service bridge to gen-2wai and lazy-mirrors them locally so repeat requests fast-path. - Rate + concurrency — see Limits & concurrency. Per-tenant caps enforced at the gateway.
- Spend: real-time metering on every key,
sk_test_included. Dashboard surfaces are on the Developer Console roadmap.