List
List every container environment variable currently attached to a specific Nairi agent. Returns the keys, values, and timestamps for each variable.
Environment variables are stored and transmitted in plaintext and are fully visible to the agent and anyone with access to it. For API keys, credentials, or other sensitive data, use Vault Secrets instead.
GET /api/public/v1/agents/{agent_id}/env-vars{agent_id} accepts either the ULID (cci_...) or the human-readable slug (the agent's agent_id field).
Example
curl -X GET https://api.nairi.ai/api/public/v1/agents/AGENT_ID/env-vars \
-H "Authorization: Bearer $NAIRI_API_KEY"const res = await fetch(
`https://api.nairi.ai/api/public/v1/agents/${agentId}/env-vars`,
{
headers: {
Authorization: `Bearer ${process.env.NAIRI_API_KEY}`,
},
},
);
const envVars = (await res.json()) as Array<{ id: string; key: string; value: string }>;require "net/http"
require "json"
require "uri"
uri = URI("https://api.nairi.ai/api/public/v1/agents/#{agent_id}/env-vars")
req = Net::HTTP::Get.new(uri)
req["Authorization"] = "Bearer #{ENV['NAIRI_API_KEY']}"
res = Net::HTTP.start(uri.host, uri.port, use_ssl: true) { |h| h.request(req) }
env_vars = JSON.parse(res.body)import os
import requests
res = requests.get(
f"https://api.nairi.ai/api/public/v1/agents/{agent_id}/env-vars",
headers={"Authorization": f"Bearer {os.environ['NAIRI_API_KEY']}"},
)
env_vars = res.json()package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"os"
)
func main() {
agentID := os.Getenv("AGENT_ID")
req, _ := http.NewRequest(
"GET",
"https://api.nairi.ai/api/public/v1/agents/"+agentID+"/env-vars",
nil,
)
req.Header.Set("Authorization", "Bearer "+os.Getenv("NAIRI_API_KEY"))
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
raw, _ := io.ReadAll(res.Body)
var envVars []map[string]any
json.Unmarshal(raw, &envVars)
fmt.Println(envVars)
}Response
[
{
"id": "cev_01KHGX61ZCCN8M1SG0VMSGRAAB",
"container_id": "cci_01KEQ6963XS96YDP3NF9NKB7QJ",
"key": "NODE_ENV",
"value": "production",
"created_at": "2026-02-15T15:02:26.000Z",
"updated_at": "2026-02-15T15:02:26.000Z"
}
]Overview
What container environment variables are, when to use them instead of vault secrets, and how to set them on your Nairi agents through the REST API.
Create
Create a new plaintext container environment variable on a Nairi agent. Use this for non-sensitive runtime config; for secrets, use the vaults API instead.