Getting Started
In about 15 minutes you will talk into your microphone and watch your words appear in your terminal as text, labelled with your name. ODIN Cortex does the transcription. You don't need an existing game or app: this guide brings a small script and a one-file web page, and you only need a terminal, Node.js and a browser.
How it works
Cortex doesn't produce audio. It listens to ODIN Voice rooms, the voice chat rooms your players or users talk in. When you ask Cortex to transcribe a room, it sends a bot into that room as one more participant. The bot hears every speaker separately and turns what they say into text.
A few words you'll meet along the way:
| Term | Meaning |
|---|---|
| Room | An ODIN Voice room. It is just a name you choose; everyone who joins the same name can hear each other. This guide uses cortex-quickstart. |
| Session | One transcription of one room. While a session is active, the bot is in the room. |
| Bot | The Cortex participant that listens. It appears in the room as transcription-bot. |
| Room token | A short-lived ticket that lets one person join one room. Your browser needs one to join. |
| Message | One piece of transcribed speech, from when someone starts talking until they pause, with who said it. |
Before you start
You need:
- A 4Players account and a project. Sign in at console.4players.io and create a project if you don't have one.
- Cortex activated on that project. Open the project, click Cortex in the left sidebar, then click Activate ODIN Cortex. Cortex needs ODIN Voice on the same project; if Voice isn't active yet, the page offers to activate it first.
- Your project ID. In the project, open Manage, then Overview. The ID has a copy button next to it.
- Node.js 18 or newer (check with
node --version) and a browser with a microphone.
It can take a few minutes until Cortex knows about a newly activated project. If you get
Project settings not configured in Step 4, wait a moment and try again.
Step 1 — Create an API key
Your script proves who it is with an API key. API keys belong to your account, not to one project, so you'll find them in your account settings rather than inside the project.
- Open console.4players.io/settings/api-keys. You can also get there from your user menu via Settings, then API Keys (Cortex). (The Tokens (Fleet) entry next to it is for a different product.)
- Click Create API Key.
- Enter a name, for example
quickstart. Under Project Scope, select your project. Under Scopes, tick Sessions and Messages; that's all this guide needs. - Click Create Key and copy the key right away. It starts with
ots_live_and is shown only once.
Create the key while you're logged in as the account that owns the project. A key created by a different team member's login won't work for it.
Anyone with this key can read every transcript of your project. Use it only on your own computer or server, never in a web page, mobile app or game build. The web page in this guide gets a short-lived room token instead.
Step 2 — Set up a folder
Open a terminal and create a folder with the Cortex SDK. The second line tells Node.js to treat the
script as a modern JavaScript module, which lets it use await at the top level.
Then put your key and project ID into environment variables, so they stay out of the code:
- macOS / Linux
- Windows (PowerShell)
Environment variables only live as long as the terminal window. If you open a new one, set them again.