Retrieve the current key
Reference article: Part of the API reference.
Returns the API key the request was made with, the organization it belongs to, and the organization's data region. Use it to check a key works before you deploy it, or to confirm which key a service is running with.
GET /v1/whoami
Scope: none. Any active key can call it, including a restricted key with no scopes.
Request
No parameters.
::: code-group
curl https://api.gonimbus.ai/v1/whoami \
-H "Authorization: Bearer $NIMBUS_API_KEY"
const response = await fetch('https://api.gonimbus.ai/v1/whoami', {
headers: { Authorization: `Bearer ${process.env.NIMBUS_API_KEY}` },
})
const whoami = await response.json()
response = requests.get(
"https://api.gonimbus.ai/v1/whoami",
headers={"Authorization": f"Bearer {os.environ['NIMBUS_API_KEY']}"},
)
whoami = response.json()
:::
Response
{
"object": "whoami",
"organization": { "id": "acme", "name": "Acme Corp" },
"api_key": {
"id": "key_Lm42Qp8Rt3Vw6Xy9Za1Bc4De",
"object": "api_key",
"name": "CI status bot",
"kind": "restricted",
"scopes": ["messages:write", "runs:read"],
"last4": "Lm42",
"expires_at": 1759449600
},
"data_region": "us",
"api_version": "2026-09-25"
}
| Field | Type | Description |
|---|---|---|
object |
string | Always whoami. |
organization.id |
string | The organization the key belongs to. |
organization.name |
string or null | Its display name. |
api_key.id |
string | The key's ID, as shown on the Developers page and in the request log. |
api_key.object |
string | Always api_key. |
api_key.name |
string | The name given when the key was created or last renamed. |
api_key.kind |
string | secret or restricted. |
api_key.scopes |
string[] | The key's scopes. A secret key holds ["*"]. |
api_key.last4 |
string | The last four characters of the key, to tell keys apart without exposing them. |
api_key.expires_at |
integer or null | When the key stops working, in Unix seconds. Set only on a key rolled with a grace period. |
data_region |
string | us or eu. Send requests to your region's base URL. |
api_version |
string | The version this request was served with. |
The response never includes the key itself.
Errors
| Status | Code | When |
|---|---|---|
401 |
missing_api_key |
No key was sent. |
401 |
invalid_api_key |
The key doesn't exist. |
401 |
api_key_revoked |
The key was revoked. |
401 |
api_key_expired |
The key's grace period ended. |
FAQ
Why does expires_at have a value on a key I didn't set to expire?
The key was rolled with a grace period. It keeps working until expires_at; deploy its replacement before then.
Does calling this endpoint count against my rate limit?
Yes, like any request. One call at startup is plenty.
Can I use it as a health check?
Yes. A 200 means the key works and the API is reachable. Check expires_at too, so a pending expiry doesn't surprise you.
Why is organization.name null?
The organization has no display name set. Its id is always present.
Does it tell me who created the key?
No. The Developers page shows each key's creator to organization admins.