Palbase ai · API
/ai/env/{key}Set a variable
One of the project's variables or secrets, set or set anew: every command of every session of its agents begun from now has it — on the platform's Linux machines and on the project's own pools, Linux and Mac — beside the agent's own (its definition's env), masked wherever a transcript would show it. The value is sealed where the sessions run and never answered, nor logged; a refusal never repeats it. A secret also says where it may go (hosts), where in a request it may be put (inject) and whether the agent reads it as it is (open); a field left out keeps what the variable has. A write that carries the value says them as its caller's role allows. A variable set before may leave out its value to change them alone (404 for one never set): a person's change only — an owner or an admin of the organization signed in, never a key or a token, the secret key included (403 person_required). open: true, and a secret made no secret, need acknowledge_open: true (400 open_not_acknowledged); a variable that stays no secret is refused hosts, inject and open (409 not_a_secret). A sealed value is at least 8 bytes with no line break or NUL (400 secret_unusable), and one a person may have chosen (fewer than 16 characters, or one kind of character only) needs acknowledge_guessable: true (400 secret_guessable) — the request's own value is judged, never one kept: an open secret or a variable that is no secret made sealed takes its value in the same request (400 value_required). A sealed secret is a placeholder in a session: the proxy beside the machine puts the value in only on a request to one of its hosts, and a machine with no proxy beside it (a Mac, or a Linux machine whose agent does not run it) gets no sealed secret.
Called by your server, with the project's secret key.
Path
keystring · requiredThe variable's name: upper-case letters, digits and _, starting with a letter, at most 128; not PALBASE_AI_….Request body
acknowledge_openboolean · optionalSaid with open: true, and to make a secret no secret (secret: false): you read that the agent then reads it as it is, so anyone who can drive the project's agents (an app's user where the project lets them, a prompt the agent reads) can get its value.hostsstring[] · optionalThe hosts a request may carry the secret to (32 at most): an exact DNS name (api.stripe.com) or *. and one (*.stripe.com: one label more). Lower-case ASCII, punycode for another script; no IP address, port, single-label name, public suffix (com, co.uk, github.io) or wildcard over one, and no wildcard over palbase.studio. Given, the secret is sealed. [] takes them all away.inject"header" | "query" | "body"[] · optionalWhere in a request to one of its hosts the secret may be put: header (the default), query, body — at least one. Never over plain http.openboolean · optionaltrue: the agent reads it as it is (no hosts, no inject), set with acknowledge_open; false: sealed, a placeholder the proxy swaps for the value only on a request to one of its hosts. Work an app's user starts gets an open secret only where the project lets it (settings.open_secrets_for_app_users).secretboolean · optionalWhether it is a secret (the default on a write of its value). One that is not (false) is given to the agent as it is, with no hosts and no class; a secret made none needs acknowledge_open. Every value is masked in a transcript either way.valuestring · optionalIts value: 1 byte to 32 KiB, no NUL (a sealed one: 8 bytes or more, no line break). Sealed, never answered, never logged. Required to set a new variable; left out, a variable set before keeps it.acknowledge_guessableboolean · optionalSaid with a sealed value a person may have chosen (fewer than 16 characters, or one kind of character only): you read that the proxy hides a value an allowed host echoes back, which lets an agent confirm a guess there.curl -X PUT "https://<your-ref>.palbase.studio/ai/env/<key>" \
-H "apikey: $PALBASE_SECRET_KEY" \
-H "content-type: application/json" \
-d '{"acknowledge_open":false,"hosts":["string"],"inject":["header"],"open":false,"secret":false,"value":"string","acknowledge_guessable":false}'Responses
200The variable, without its value
400The request is malformed, or names what this module does not offer (the error names which)
401No valid credential
403A publishable key or a user's session: everything here is the project's server's, called with the secret key
404No such response, job or provider in this project
409The response's state refuses it
503The model service or the database did not answer; retry shortly
defaultAn error: the envelope names it (`error`) and explains it (`error_description`).
Operation PutEnv of ai's contract.