BashBrainTeammatesPricingDevelopersGet a test key

Account

Your company's account: who is calling, its keys, its caps, what it spent and the models it may use.

Send Authorization: Bearer vk_test_... on every call.

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.

Your API key, any scope. On the card: keys. Every call here is a checked sample.

Nothing to send but the route.

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"
TypeScript
const me = await vestra.keys.me();
Python
me = vestra.keys.me()
CLI
vestra login
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"
HTTP

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.

Your API key, scope admin or all. On the card: keys. Over HTTP it is made from the contract: fill in every value.

PATCH/v1/orgChange the name, allowed return URLs, allowed embed origins, default deployment or default memory mode.

Your API key, scope admin or all. On the card: keys. Every call here is a checked sample.

GET/v1/keysList keys.

Only the last four characters are ever shown again.

Your API key, scope admin or all. On the card: keys. Over HTTP it is made from the contract: fill in every value.

POST/v1/keysCreate a test or live key.

The full key is shown once.

Your API key, scope admin or all. On the card: keys. Every call here is a checked sample.

POST/v1/keys/{key_id}/rollReplace a key.

The old one keeps working for a grace period you choose, then stops.

Your API key, scope admin or all. On the card: keys. Every call here is a checked sample.

DELETE/v1/keys/{key_id}Revoke a key immediately.

Your API key, scope admin or all. On the card: keys. Every call here is a checked sample.

GET/v1/limitsThe day and month caps for the company and per user, the alert thresholds and the rate limits.

Your API key, scope runtime or all. On the card: usage. Over HTTP it is made from the contract: fill in every value.

PATCH/v1/limitsSet the day and month caps for the company and per user, and the alert thresholds, within what Vestra allows.

Your API key, scope admin or all. On the card: usage. Every call here is a checked sample.

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.

Your API key, scope runtime or all. On the card: usage. Every call here is a checked sample.

GET/v1/usage/line-itemsThe charges behind one task or one conversation, newest first: the receipt you can show your user.

Your API key, scope runtime or all. On the card: usage. Every call here is a checked sample.

GET/v1/audit-logEvery key use, settings change and approval answer, newest first.

Your API key, scope admin or all. On the card: keys. Over HTTP it is made from the contract: fill in every value.

GET/v1/modelsThe models a deployment may choose from.

Your API key, scope runtime or all. On the card: keys. Over HTTP it is made from the contract: fill in every value.

GET/v1/healthIs the API up.

No key needed.

No key: anyone may call it. On the card: keys. Every call here is a checked sample.