Identify the calling token
Alpha
GET
https://api.voxrouter.ai/v1/auth/whoamiReturn the user/account behind the bearer token. Accepts both `pk_*` API keys and `vr_session_*` CLI session tokens — `auth` in the response distinguishes which kind authenticated. Useful for `voxrouter whoami` and as a generic "are my creds OK?" probe before running an expensive operation.
bash
curl https://api.voxrouter.ai/v1/auth/whoami \
-H "Authorization: Bearer $VOXROUTER_API_KEY"Headers
AuthorizationstringRequiredBearer token. Send as
Authorization: Bearer pk_....Response
Caller identified.
json
{
"user_id": "string",
"auth": "api_key"
}user_idstringRequiredStable identifier of the calling user. For `pk_*` keys this is
the account_id (org or user wallet); for `vr_session_*` tokens
this is the user.id.
authenum (api_key | session)RequiredWhich token kind authenticated this request. `api_key` for
`pk_*` keys, `session` for `vr_session_*` tokens issued by
`voxrouter login`.
expires_atstring<date-time>OptionalISO-8601 expiry of the session token. Only present when
`auth = session`; `pk_*` keys do not expire on a clock.
Errors
Non-2xx responses return a JSON body with a machine-readable error code and an optional details string.
| Status | Meaning |
|---|---|
| 401 | Missing or invalid API key. |