Skip to main content
POST
/
api
/
public
/
v2
/
tool-registry
/
{identifier}
/
env-vars
Create Tool Env Var
curl --request POST \
  --url https://api.promptlayer.com/api/public/v2/tool-registry/{identifier}/env-vars \
  --header 'Content-Type: application/json' \
  --header 'X-API-KEY: <api-key>' \
  --data '
{
  "key": "<string>",
  "value": "<string>"
}
'
{
  "success": true,
  "tool_env_var": {
    "id": 123,
    "key": "<string>",
    "value_suffix": "<string>",
    "is_empty": true,
    "created_at": "2023-11-07T05:31:56Z",
    "updated_at": "2023-11-07T05:31:56Z",
    "workspace_id": 123,
    "tool_registry_id": 123
  }
}
Create a tool-scoped environment variable. Tool-level variables take precedence over workspace-level variables with the same key when the tool executes.

Authorizations

X-API-KEY
string
header
required

Path Parameters

identifier
string
required

Tool ID (numeric) or name

Body

application/json
key
string
required

Environment variable name. Must start with a letter or underscore and contain only letters, digits, and underscores.

Required string length: 1 - 255
Pattern: ^[A-Za-z_][A-Za-z0-9_]*$
value
string

Value to store. May be empty to create a placeholder that the user will fill in later.

Maximum string length: 8192

Response

Successful Response

success
boolean
tool_env_var
object