Account
Your company's account: who is calling, its keys, its caps, what it spent and the models it may use.
RoutesOpen one for every field it takes and answers.
GET/v1/meWho is calling: the company, the key, and whether it is test or live.
Answers 2005 fields
object"me"Always me.
- Type
"me"
orgobjectThe company account the call acts for.
idstringYour company account's id.
- Example
org_2f8k
namestringYour company's name.
- Type
string
statusstringactive while the account works. Any other value means it is switched off, and calls answer 403 org_disabled.
- Type
string
mode"live" | "test"live or test: the mode of the key (or console session) in use. A test key sees only test users, test deployments and test money.
- Type
"live" | "test"
keyobject | nullThe API key in use; null when the call comes from a console session.
idstringThe key's id.
- Example
key_8f2k
namestring | nullThe name you gave the key; null when it has none.
- Type
string | null
last4stringThe last four characters of the key's secret, to tell keys apart.
- Type
string
memberobject | nullWho is signed in to the console; null when the call uses an API key.
role"owner" | "admin" | "developer"Your role in the company: owner, admin or developer.
- Type
"owner" | "admin" | "developer"
const me = await vestra.keys.me();me = vestra.keys.me()vestra login# Check your key. See your company, this key, and whether it is test or live.curl "$VESTRA_BASE_URL/v1/me" \ -H "Authorization: Bearer $VESTRA_API_KEY" # Create a key for CI. This one can only set things up. Its secret is shown only once.curl "$VESTRA_BASE_URL/v1/keys" \ -H "Authorization: Bearer $VESTRA_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "name": "ci", "scopes": ["setup"] }' # Roll a key. You get a new secret, and the old one keeps working for an hour.curl "$VESTRA_BASE_URL/v1/keys/key_3vd/roll" \ -H "Authorization: Bearer $VESTRA_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "grace_seconds": 3600 }' # Revoke a key. It stops working at once.curl -X DELETE "$VESTRA_BASE_URL/v1/keys/key_3vd" \ -H "Authorization: Bearer $VESTRA_API_KEY"No sample in your language for this route, so here it is over HTTP.
# Check your key. See your company, this key, and whether it is test or live.curl "$VESTRA_BASE_URL/v1/me" \ -H "Authorization: Bearer $VESTRA_API_KEY" # Create a key for CI. This one can only set things up. Its secret is shown only once.curl "$VESTRA_BASE_URL/v1/keys" \ -H "Authorization: Bearer $VESTRA_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "name": "ci", "scopes": ["setup"] }' # Roll a key. You get a new secret, and the old one keeps working for an hour.curl "$VESTRA_BASE_URL/v1/keys/key_3vd/roll" \ -H "Authorization: Bearer $VESTRA_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "grace_seconds": 3600 }' # Revoke a key. It stops working at once.curl -X DELETE "$VESTRA_BASE_URL/v1/keys/key_3vd" \ -H "Authorization: Bearer $VESTRA_API_KEY"GET/v1/orgThe company account: name, status, the wallet in billed dollars, day and month caps, alert thresholds, allowed return URLs, allowed embed origins, default deployment.
PATCH/v1/orgChange the name, allowed return URLs, allowed embed origins, default deployment or default memory mode.
GET/v1/keysList keys.
Only the last four characters are ever shown again.
POST/v1/keysCreate a test or live key.
The full key is shown once.
POST/v1/keys/{key_id}/rollReplace a key.
The old one keeps working for a grace period you choose, then stops.
DELETE/v1/keys/{key_id}Revoke a key immediately.
GET/v1/limitsThe day and month caps for the company and per user, the alert thresholds and the rate limits.
PATCH/v1/limitsSet the day and month caps for the company and per user, and the alert thresholds, within what Vestra allows.
GET/v1/usageExact billed spend and real task counts, by day, user, deployment, conversation, task, model or kind of spend, filtered by user, deployment or conversation.
An erased user's spend stays in the totals, as the user unknown.
GET/v1/usage/line-itemsThe charges behind one task or one conversation, newest first: the receipt you can show your user.
GET/v1/audit-logEvery key use, settings change and approval answer, newest first.
GET/v1/modelsThe models a deployment may choose from.
GET/v1/healthIs the API up.
No key needed.