v1
latestOpenAPI 3.0.02026-08-04891301.4 MBCreate an agent environment variable
Creates a new environment variable for the specified agent. The variable is stored securely and the plaintext value is never returned after creation; subsequent reads return a masked representation showing only the last four characters.
The authenticated user must have access to the agent's parent app. Pass the app scope via the app parameter when calling with an API key that is scoped to a specific app. Each key must be unique within the agent; attempting to create a duplicate key returns a validation error.
post/api/v1/agents/{agent}/agent_env_vars
Path parameters
agentstring required
Agent ID (agt_...). The agent must belong to an app the caller can access.
Request body
Example request
{
"description": "An example description.",
"key": "string",
"value": "string"
}Response
Successful response
Example response
{
"agent": "agi_0aBcDeFgHiJkLmNoPqRsTu",
"created_at": "2024-01-01T00:00:00Z",
"description": "An example description.",
"id": "anv_0aBcDeFgHiJkLmNoPqRsTu",
"key": "OPENAI_API_KEY",
"masked_value": "****1234",
"updated_at": "2024-01-01T00:00:00Z"
}