How do I create or revoke a Rarity API key?
Go to Settings > API keys and select Create a key, then name it and choose what it can do. The key is shown once, so copy it then, and you can revoke it on the same page at any time.
An API key lets your own code use the Rarity API on your account, to start, stop and message your agents and read what they do. It isn't your AI provider's key, which you connect in your dashboard for your agents to think with.
Create a key
- Go to Settings > API keys in your dashboard and select Create a key.
- Enter a Name that says what the key is for, up to 60 characters, and select Continue.
- Tick what the key can do, Read, Write or both, then select Create key.
- Copy the key with Copy and keep it somewhere safe, then select Done.
- Read lets a key see your agents, servers, logs, usage, webhooks and the referral program.
- Write lets a key start, stop and restart agents, send them messages, and change servers, webhooks and payouts.
The key is shown only this once. We keep only its last four characters, so it can't be shown again. If you lose it, revoke it and create a new one.
Use a key
A key starts with rk_live_. Send it in the Authorization header of each request, from your server and never from a web page, as Authentication in the developer docs shows.
- Make one key for each program or place that uses the API, so you can revoke it alone.
- Give a key only the access its code needs.
- Never send a key in a ticket, an email or a chat.
Your keys
Settings > API keys lists each key by its name, with rk_live_ and its last four characters, what it can do, when it was last used and the day it was created. Once you've revoked a key, the list has two tabs, Active and Revoked.
Revoke a key
- Go to Settings > API keys in your dashboard.
- Open the menu at the end of the key's row and select Revoke.
- Type the key's name to confirm, then select Revoke.
Code that uses the key stops working at once, and a revoked key can't be turned back on. It stays in the list under Revoked, with the day it was revoked. If a key may have leaked, revoke it and create a new one.