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:
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:
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:
| Area | What you can do |
|---|---|
| Employees | List, create, update and delete employees; add or remove knowledge; retry training |
| Characters and scenes | Manage characters and backgrounds, and list scenes |
| Voices and models | List voices, clone a voice, and list AI models |
| Sessions | Create live session tokens and assistant sessions, and read conversations |
| Content | Generate 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.
Help Center