AivahHelp CenterGo to Aivah
Account and billing3 min read

Create an API key and make your first request

Generate an Aivah API key, call the Platform API in under a minute and build on the open-source Starter Kit.

By the end of this guideHave a working API key, a successful first request and a clear path to the Starter Kit.

Who this guide is for

Developers and technical teams building Aivah employees, characters and conversations into their own products

On this page
  1. Before you start
  2. Steps
  3. 1. Open API keys
  4. 2. Generate your key
  5. 3. Make your first request
  6. 4. Explore what you can build
  7. 5. Start from the Starter Kit
  8. 6. Rotate or turn off a key
  9. Good to know
  10. Troubleshooting
  11. Next steps

This guide is for developers. The Aivah Platform API lets your own app create employees, start live character sessions, clone voices and generate decks, podcasts and mind maps. One API key gets you started.

Before you start

  • Sign in with the account that should own the key. Its requests use that account's credits.
  • A safe place for the key, such as your server's environment variables.

Steps

1. Open API keys

Open the account menu at the bottom of the sidebar and choose API keys. Your account has one active key at a time.

2. Generate your key

Choose Generate API key and pick how long it should last: 30, 60 or 90 days, or no expiry. Copy the key as soon as it appears. It starts with sk_aivah_ and is shown only once.

3. Make your first request

Send the key in the AIVAH_API_KEY header. This request lists your employees:

Terminal
curl https://api.aivah.ai/v1/platform/agents \
  -H "AIVAH_API_KEY: sk_aivah_your_key_here"

The same request in JavaScript, with the key read from an environment variable on your server:

JavaScript
const response = await fetch("https://api.aivah.ai/v1/platform/agents", {
  headers: { AIVAH_API_KEY: process.env.AIVAH_API_KEY },
});
const { results } = await response.json();

4. Explore what you can build

The Platform API covers:

AreaWhat you can do
EmployeesList, create, update and delete employees; add or remove knowledge; retry training
Characters and scenesManage characters and backgrounds, and list scenes
Voices and modelsList voices, clone a voice, and list AI models
SessionsCreate live session tokens and assistant sessions, and read conversations
ContentGenerate slide decks, podcasts and mind maps, and list what you've generated

5. Start from the Starter Kit

The Aivah Starter Kit is an open-source Next.js app wired to the Platform API. It has live character chat, interactive presentations, a voice assistant and management screens. Clone it, add your key and run it. See Aivah for developers.

6. Rotate or turn off a key

Each key shows when it was Created on, Last used and Expires on. Choose Regenerate to swap in a new key. Your old key keeps working for six hours so you can update your apps, unless you choose to delete it straight away. You can also turn a key off, or delete it.

Good to know

Keep your key on your server. Never put it in website code, a mobile app or a public repository, where others could read it.

Troubleshooting

  • 401 Unauthorized: check the header name is exactly AIVAH_API_KEY. Check the key is complete, active and not expired.
  • You lost the key: choose Regenerate to create a new one, then update your apps within six hours.
  • The key works locally but not in production: check the environment variable is set on your production server.

Next steps

Read Aivah for developers, or see how credits work.