Skip to content
GurtOS

Set a vault key

PUT
/vault/{name}
curl --request PUT \
--url http://127.0.0.1:7700/api/vault/FACTORY_API_KEY \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "value": "example-key-value" }'

Owner only. Sets or replaces one key in /etc/box/vault.env, which stays readable by root only. The value is one line of up to 8192 characters. The log records that the name was set, never the value. No route reads a value back. The box uses the new value straight away.

An ANTHROPIC_API_KEY is tried first with a free call to Anthropic. A key Anthropic rejects is a 400 and is not saved. If Anthropic cannot be reached, the key is saved and check says unchecked. A FACTORY_API_KEY is saved unchecked.

name
required
string
/^[A-Z][A-Z0-9_]{1,63}$/

Capital letters, digits and _, 2 to 64 characters, starting with a letter.

Example

FACTORY_API_KEY
Media typeapplication/json
object
value
required

The key. Never shown again.

string

Example

{
"value": "example-key-value"
}

The name and when it was set.

Media typeapplication/json
object
name
required
string
setAt
required
string format: date-time
check

For a model key

string
Allowed values: ok unchecked
checked

For a model key

boolean
message

For a model key

string

Example

{
"check": "ok"
}

A bad name or value, or a model key the provider rejected. The message never repeats the value.

Media typeapplication/json
object
error
required

What went wrong

string

Example generated

{
"error": "example"
}

The owner’s route, called by someone who is not the box’s own screen or a device paired as the owner.

Media typeapplication/json
object
error
required

What went wrong

string

Example

{
"error": "only this computer's own screen or the owner's paired device can do this"
}