Realtime TTS-2 is live. Built for realtime conversation that feels human. Read the Realtime TTS-2 announcement

Authentication

API keys

Create and manage the workspace API keys every other credential is minted from.

An API key is your workspace's long-lived credential. Session tokens and one-time tokens are created from an API key. Deleting that key invalidates them too.

Keep API keys on your servers, never in client code. See Security best practices for safe patterns for browsers, mobile apps, and games.

Getting an API key

To get an API key from the Portal:

  1. Log in to Inworld Portal.

  2. In the sidebar, under Manage, select API Keys.

    API Keys under Manage in the Portal sidebar
  3. Click Create Inworld API key. In New API key, choose the key type and permissions, then click Create key.

    Inworld API Keys section with one key: its name, the start of its key, a hidden email, creation time, expiration and permissions
  4. In Your API key is ready, click Copy key before you close the dialog. It copies the complete Base64 credential. Portal shows it only once, when the key is created; if you lose it, create a new key. The credential is the complete base64(key_id:secret) value; use it as-is for INWORLD_API_KEY. Do not encode it again. See API key authentication.

Choose whether each API key has write permission for:

  • Voice API: required for POST, PATCH, and DELETE endpoints (clone voice, update voice, delete voice). GET endpoints only require read permissions.
  • Router API: required for POST, PATCH, and DELETE endpoints (create router, update router, delete router). GET endpoints only require read permissions.
New API key dialog with key type and Voice and Router write permissions

These permissions do not affect other APIs (such as Text-to-Speech and LLM).

Alternatively, the Inworld CLI mints a key without leaving the terminal — this also works for AI coding agents:

bash
npm install -g @inworld/cli
inworld login
inworld workspace add-key --name my-key   # add --write to also allow Voice and Router write endpoints

inworld workspace add-key prints the new key's Base64 credential once and does not keep it. Copy it then and set it as INWORLD_API_KEY. To keep the key out of the terminal, add --output <file>: the CLI writes INWORLD_API_KEY=<key> to a new file instead of printing it.

--write only affects write endpoints of the Voice API and Router API — other APIs (such as Text-to-Speech and LLM) are not impacted.

Key permissions

What a key can reach:

  • Standard keys cover the platform APIs — TTS, STT, LLM, and read access to Voices and Router configuration.
  • Write permissions to the Voice API and Router API are opt-in toggles on the key: they gate POST, PATCH, and DELETE endpoints (cloning, updating, and deleting voices or router configs). GET endpoints only need read permissions, and other APIs are unaffected. You can edit these toggles on an existing key at any time.
  • Realtime-only keys (below) cover only the Realtime API.

Tokens created from a key inherit exactly its permissions.

A key's type, Realtime-only or standard, is fixed at creation and cannot change later. You can edit write permissions at any time. For a different key type, create a new key.

Realtime-only API keys

A Realtime-only key is built specifically for the Inworld Realtime API. Use it for voice agents that connect over WebSocket or WebRTC. It limits access to Realtime, so other APIs are not exposed if the key leaks.

It covers:

  • Realtime sessions over WebSocket and WebRTC
  • Streaming audio in and out within a realtime session
  • Speech, language, and voice generation the Realtime API performs for you

For other Inworld APIs, use a Standard key.

To create one: in Inworld Portal open Manage > API Keys, click Create Inworld API key, and choose Realtime-only as the key type. Click Create key, then click Copy key.

Managing keys

  • A key's credential is shown only once, when the key is created. Inworld cannot show it again. If you lose it, create a new key and save its credential. Update every integration that uses the old key and check that it works. Then delete the old key: deleting it breaks anything still using it and invalidates every token created from it.
  • Deleting a key immediately invalidates it and every token created from it. See Security best practices for what to do if a credential leaks.
  • Use separate keys for each environment and integration, so deleting one affects fewer services.
  • Usage is attributed per key in the usage dashboard.