From f70a5606a4957a0cff12f76b4c34281bda22db6d Mon Sep 17 00:00:00 2001 From: netbirddev Date: Sat, 27 Jun 2026 11:47:55 +0000 Subject: [PATCH] Update API pages with v0.75.0-rc.3 --- src/pages/ipa/resources/agent-network.mdx | 7738 --------------------- 1 file changed, 7738 deletions(-) delete mode 100644 src/pages/ipa/resources/agent-network.mdx diff --git a/src/pages/ipa/resources/agent-network.mdx b/src/pages/ipa/resources/agent-network.mdx deleted file mode 100644 index ddcd4566..00000000 --- a/src/pages/ipa/resources/agent-network.mdx +++ /dev/null @@ -1,7738 +0,0 @@ -export const title = 'Agent Network' - - - -## List Agent Network access logs {{ tag: 'GET' , label: '/api/agent-network/access-logs' }} - - - - Returns a paginated, server-side-filtered list of agent-network (LLM) access log entries. Available only when the account has log collection enabled; otherwise entries are not retained. - - ### Query Parameters - - - - Page number for pagination (1-indexed). - - - - Number of items per page (max 100). - - - - Field to sort by. - - - - Sort order (ascending or descending). - - - - General search across log ID, host, path, model, and user email/name. - - - - Filter by authenticated user ID. - - - - Filter to a single conversation / coding session id (groups all requests of one session). - - - - Filter by authorising group id. Repeat for multiple (matches any). - - - - Filter by resolved provider id. Repeat for multiple (matches any). - - - - Filter by model. Repeat for multiple (matches any). - - - - Filter by policy decision (e.g. allow, deny). - - - - Filter by request path prefix (matches entries whose path starts with this value). - - - - Filter by timestamp {'>='} start_date (RFC3339 format). - - - - Filter by timestamp {'<='} end_date (RFC3339 format). - - - - - - -```bash {{ title: 'cURL' }} -curl -X GET https://api.netbird.io/api/agent-network/access-logs \ --H 'Accept: application/json' \ --H 'Authorization: Token ' -``` - -```js -const axios = require('axios'); - -let config = { - method: 'get', - maxBodyLength: Infinity, - url: '/api/agent-network/access-logs', - headers: { - 'Accept': 'application/json', - 'Authorization': 'Token ' - } -}; - -axios(config) -.then((response) => { - console.log(JSON.stringify(response.data)); -}) -.catch((error) => { - console.log(error); -}); -``` - -```python -import requests -import json - -url = "https://api.netbird.io/api/agent-network/access-logs" - -headers = { - 'Accept': 'application/json', - 'Authorization': 'Token ' -} - -response = requests.request("GET", url, headers=headers) - -print(response.text) -``` - -```go -package main - -import ( - "fmt" - "strings" - "net/http" - "io/ioutil" -) - -func main() { - - url := "https://api.netbird.io/api/agent-network/access-logs" - method := "GET" - - client := &http.Client { - } - req, err := http.NewRequest(method, url, nil) - - if err != nil { - fmt.Println(err) - return - } - - - req.Header.Add("Accept", "application/json") - req.Header.Add("Authorization", "Token ") - - res, err := client.Do(req) - if err != nil { - fmt.Println(err) - return - } - defer res.Body.Close() - - body, err := ioutil.ReadAll(res.Body) - if err != nil { - fmt.Println(err) - return - } - fmt.Println(string(body)) -} -``` - -```ruby -require "uri" -require "json" -require "net/http" - -url = URI("https://api.netbird.io/api/agent-network/access-logs") - -https = Net::HTTP.new(url.host, url.port) -https.use_ssl = true - -request = Net::HTTP::Get.new(url) -request["Accept"] = "application/json" -request["Authorization"] = "Token " - -response = https.request(request) -puts response.read_body -``` - -```java -OkHttpClient client = new OkHttpClient().newBuilder() - .build(); - -Request request = new Request.Builder() - .url("https://api.netbird.io/api/agent-network/access-logs") - .method("GET") - .addHeader("Accept", "application/json") - .addHeader("Authorization: Token ") - .build(); -Response response = client.newCall(request).execute(); -``` - -```php - 'https://api.netbird.io/api/agent-network/access-logs', - CURLOPT_RETURNTRANSFER => true, - CURLOPT_ENCODING => '', - CURLOPT_MAXREDIRS => 10, - CURLOPT_TIMEOUT => 0, - CURLOPT_FOLLOWLOCATION => true, - CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, - CURLOPT_CUSTOMREQUEST => 'GET', - CURLOPT_HTTPHEADER => array( - 'Accept: application/json', - 'Authorization: Token ' - ), -)); - -$response = curl_exec($curl); - -curl_close($curl); -echo $response; -``` - - - - - -```json {{ title: 'Example' }} -{ - "data": [ - { - "id": "ch8i4ug6lnn4g9hqv7m0", - "service_id": { - "type": "string", - "description": "ID of the synthesised agent-network service that handled the request." - }, - "timestamp": "2026-05-05T12:34:56Z", - "status_code": 200, - "duration_ms": 850, - "user_id": { - "type": "string", - "description": "NetBird user id of the authenticated caller, if applicable." - }, - "source_ip": { - "type": "string", - "description": "Source IP of the request. Empty when log collection is disabled." - }, - "method": "POST", - "host": { - "type": "string", - "description": "Upstream host the request was routed to. Empty when log collection is disabled." - }, - "path": { - "type": "string", - "description": "Request path. Empty when log collection is disabled." - }, - "provider": "openai", - "model": "gpt-4o", - "session_id": "019eeb72-ab7c-7cd2-aa05-6e8eb834afcb", - "resolved_provider_id": { - "type": "string", - "description": "NetBird agent-network provider id that served the request." - }, - "selected_policy_id": { - "type": "string", - "description": "Agent-network policy id that authorised (or denied) the request." - }, - "decision": "allow", - "deny_reason": { - "type": "string", - "description": "Raw deny reason code when the request was blocked (e.g. llm_policy.token_cap_exceeded)." - }, - "input_tokens": 1200, - "output_tokens": 640, - "total_tokens": 1840, - "cost_usd": 0.0231, - "stream": { - "type": "boolean", - "description": "Whether the request was a streaming completion." - }, - "group_ids": [ - { - "type": "string" - } - ], - "request_prompt": { - "type": "string", - "description": "Captured request prompt. Present only when prompt collection is enabled." - }, - "response_completion": { - "type": "string", - "description": "Captured response completion. Present only when prompt collection is enabled." - } - } - ], - "page": 1, - "page_size": 50, - "total_records": 523, - "total_pages": 11 -} -``` -```json {{ title: 'Schema' }} -{ - "data": [ - { - "id": "string", - "service_id": "string", - "timestamp": "string", - "status_code": "integer", - "duration_ms": "integer", - "user_id": "string", - "source_ip": "string", - "method": "string", - "host": "string", - "path": "string", - "provider": "string", - "model": "string", - "session_id": "string", - "resolved_provider_id": "string", - "selected_policy_id": "string", - "decision": "string", - "deny_reason": "string", - "input_tokens": "integer", - "output_tokens": "integer", - "total_tokens": "integer", - "cost_usd": "number", - "stream": "boolean", - "group_ids": [ - "string" - ], - "request_prompt": "string", - "response_completion": "string" - } - ], - "page": "integer", - "page_size": "integer", - "total_records": "integer", - "total_pages": "integer" -} -``` - - - - - - ---- - - -## Agent Network usage overview {{ tag: 'GET' , label: '/api/agent-network/usage/overview' }} - - - - Returns agent-network token and cost usage aggregated into time buckets, server-side filtered. Usage is always collected (independent of log collection). - - ### Query Parameters - - - - Time bucket width. Defaults to day. - - - - Filter by timestamp {'>='} start_date (RFC3339 format). - - - - Filter by timestamp {'<='} end_date (RFC3339 format). - - - - Filter by user ID. - - - - Filter to a single conversation / coding session id. - - - - Filter by authorising group id. Repeat for multiple (matches any). - - - - Filter by resolved provider id. Repeat for multiple (matches any). - - - - Filter by model. Repeat for multiple (matches any). - - - - - - -```bash {{ title: 'cURL' }} -curl -X GET https://api.netbird.io/api/agent-network/usage/overview \ --H 'Accept: application/json' \ --H 'Authorization: Token ' -``` - -```js -const axios = require('axios'); - -let config = { - method: 'get', - maxBodyLength: Infinity, - url: '/api/agent-network/usage/overview', - headers: { - 'Accept': 'application/json', - 'Authorization': 'Token ' - } -}; - -axios(config) -.then((response) => { - console.log(JSON.stringify(response.data)); -}) -.catch((error) => { - console.log(error); -}); -``` - -```python -import requests -import json - -url = "https://api.netbird.io/api/agent-network/usage/overview" - -headers = { - 'Accept': 'application/json', - 'Authorization': 'Token ' -} - -response = requests.request("GET", url, headers=headers) - -print(response.text) -``` - -```go -package main - -import ( - "fmt" - "strings" - "net/http" - "io/ioutil" -) - -func main() { - - url := "https://api.netbird.io/api/agent-network/usage/overview" - method := "GET" - - client := &http.Client { - } - req, err := http.NewRequest(method, url, nil) - - if err != nil { - fmt.Println(err) - return - } - - - req.Header.Add("Accept", "application/json") - req.Header.Add("Authorization", "Token ") - - res, err := client.Do(req) - if err != nil { - fmt.Println(err) - return - } - defer res.Body.Close() - - body, err := ioutil.ReadAll(res.Body) - if err != nil { - fmt.Println(err) - return - } - fmt.Println(string(body)) -} -``` - -```ruby -require "uri" -require "json" -require "net/http" - -url = URI("https://api.netbird.io/api/agent-network/usage/overview") - -https = Net::HTTP.new(url.host, url.port) -https.use_ssl = true - -request = Net::HTTP::Get.new(url) -request["Accept"] = "application/json" -request["Authorization"] = "Token " - -response = https.request(request) -puts response.read_body -``` - -```java -OkHttpClient client = new OkHttpClient().newBuilder() - .build(); - -Request request = new Request.Builder() - .url("https://api.netbird.io/api/agent-network/usage/overview") - .method("GET") - .addHeader("Accept", "application/json") - .addHeader("Authorization: Token ") - .build(); -Response response = client.newCall(request).execute(); -``` - -```php - 'https://api.netbird.io/api/agent-network/usage/overview', - CURLOPT_RETURNTRANSFER => true, - CURLOPT_ENCODING => '', - CURLOPT_MAXREDIRS => 10, - CURLOPT_TIMEOUT => 0, - CURLOPT_FOLLOWLOCATION => true, - CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, - CURLOPT_CUSTOMREQUEST => 'GET', - CURLOPT_HTTPHEADER => array( - 'Accept: application/json', - 'Authorization: Token ' - ), -)); - -$response = curl_exec($curl); - -curl_close($curl); -echo $response; -``` - - - - - -```json {{ title: 'Example' }} -[ - { - "period_start": "2026-05-05", - "input_tokens": 120000, - "output_tokens": 64000, - "total_tokens": 184000, - "cost_usd": 2.31 - } -] -``` -```json {{ title: 'Schema' }} -[ - { - "period_start": "string", - "input_tokens": "integer", - "output_tokens": "integer", - "total_tokens": "integer", - "cost_usd": "number" - } -] -``` - - - - - - ---- - - -## List Agent Network consumption counters {{ tag: 'GET' , label: '/api/agent-network/consumption' }} - - - - Returns every per-(dimension, window) consumption counter recorded for the account, ordered window-newest-first. Empty list when nothing has been consumed yet. - - - - -```bash {{ title: 'cURL' }} -curl -X GET https://api.netbird.io/api/agent-network/consumption \ --H 'Accept: application/json' \ --H 'Authorization: Token ' -``` - -```js -const axios = require('axios'); - -let config = { - method: 'get', - maxBodyLength: Infinity, - url: '/api/agent-network/consumption', - headers: { - 'Accept': 'application/json', - 'Authorization': 'Token ' - } -}; - -axios(config) -.then((response) => { - console.log(JSON.stringify(response.data)); -}) -.catch((error) => { - console.log(error); -}); -``` - -```python -import requests -import json - -url = "https://api.netbird.io/api/agent-network/consumption" - -headers = { - 'Accept': 'application/json', - 'Authorization': 'Token ' -} - -response = requests.request("GET", url, headers=headers) - -print(response.text) -``` - -```go -package main - -import ( - "fmt" - "strings" - "net/http" - "io/ioutil" -) - -func main() { - - url := "https://api.netbird.io/api/agent-network/consumption" - method := "GET" - - client := &http.Client { - } - req, err := http.NewRequest(method, url, nil) - - if err != nil { - fmt.Println(err) - return - } - - - req.Header.Add("Accept", "application/json") - req.Header.Add("Authorization", "Token ") - - res, err := client.Do(req) - if err != nil { - fmt.Println(err) - return - } - defer res.Body.Close() - - body, err := ioutil.ReadAll(res.Body) - if err != nil { - fmt.Println(err) - return - } - fmt.Println(string(body)) -} -``` - -```ruby -require "uri" -require "json" -require "net/http" - -url = URI("https://api.netbird.io/api/agent-network/consumption") - -https = Net::HTTP.new(url.host, url.port) -https.use_ssl = true - -request = Net::HTTP::Get.new(url) -request["Accept"] = "application/json" -request["Authorization"] = "Token " - -response = https.request(request) -puts response.read_body -``` - -```java -OkHttpClient client = new OkHttpClient().newBuilder() - .build(); - -Request request = new Request.Builder() - .url("https://api.netbird.io/api/agent-network/consumption") - .method("GET") - .addHeader("Accept", "application/json") - .addHeader("Authorization: Token ") - .build(); -Response response = client.newCall(request).execute(); -``` - -```php - 'https://api.netbird.io/api/agent-network/consumption', - CURLOPT_RETURNTRANSFER => true, - CURLOPT_ENCODING => '', - CURLOPT_MAXREDIRS => 10, - CURLOPT_TIMEOUT => 0, - CURLOPT_FOLLOWLOCATION => true, - CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, - CURLOPT_CUSTOMREQUEST => 'GET', - CURLOPT_HTTPHEADER => array( - 'Accept: application/json', - 'Authorization: Token ' - ), -)); - -$response = curl_exec($curl); - -curl_close($curl); -echo $response; -``` - - - - - -```json {{ title: 'Example' }} -[ - { - "dimension_kind": { - "type": "string", - "enum": [ - "user", - "group" - ], - "description": "Whether this row counts a single end user or a single source group across every member." - }, - "dimension_id": "grp-engineers", - "window_seconds": 86400, - "window_start_utc": "2026-05-05T12:00:00Z", - "tokens_input": 12000, - "tokens_output": 6500, - "cost_usd": 0.4231, - "updated_at": "2026-05-05T12:34:56Z" - } -] -``` -```json {{ title: 'Schema' }} -[ - { - "dimension_kind": "string", - "dimension_id": "string", - "window_seconds": "integer", - "window_start_utc": "string", - "tokens_input": "integer", - "tokens_output": "integer", - "cost_usd": "number", - "updated_at": "string" - } -] -``` - - - - - - ---- - - -## Retrieve Agent Network settings {{ tag: 'GET' , label: '/api/agent-network/settings' }} - - - - Returns the per-account Agent Network gateway settings (cluster, subdomain, endpoint). Returns 404 when no provider has been created yet — settings are lazily bootstrapped on first provider create. - - - - -```bash {{ title: 'cURL' }} -curl -X GET https://api.netbird.io/api/agent-network/settings \ --H 'Accept: application/json' \ --H 'Authorization: Token ' -``` - -```js -const axios = require('axios'); - -let config = { - method: 'get', - maxBodyLength: Infinity, - url: '/api/agent-network/settings', - headers: { - 'Accept': 'application/json', - 'Authorization': 'Token ' - } -}; - -axios(config) -.then((response) => { - console.log(JSON.stringify(response.data)); -}) -.catch((error) => { - console.log(error); -}); -``` - -```python -import requests -import json - -url = "https://api.netbird.io/api/agent-network/settings" - -headers = { - 'Accept': 'application/json', - 'Authorization': 'Token ' -} - -response = requests.request("GET", url, headers=headers) - -print(response.text) -``` - -```go -package main - -import ( - "fmt" - "strings" - "net/http" - "io/ioutil" -) - -func main() { - - url := "https://api.netbird.io/api/agent-network/settings" - method := "GET" - - client := &http.Client { - } - req, err := http.NewRequest(method, url, nil) - - if err != nil { - fmt.Println(err) - return - } - - - req.Header.Add("Accept", "application/json") - req.Header.Add("Authorization", "Token ") - - res, err := client.Do(req) - if err != nil { - fmt.Println(err) - return - } - defer res.Body.Close() - - body, err := ioutil.ReadAll(res.Body) - if err != nil { - fmt.Println(err) - return - } - fmt.Println(string(body)) -} -``` - -```ruby -require "uri" -require "json" -require "net/http" - -url = URI("https://api.netbird.io/api/agent-network/settings") - -https = Net::HTTP.new(url.host, url.port) -https.use_ssl = true - -request = Net::HTTP::Get.new(url) -request["Accept"] = "application/json" -request["Authorization"] = "Token " - -response = https.request(request) -puts response.read_body -``` - -```java -OkHttpClient client = new OkHttpClient().newBuilder() - .build(); - -Request request = new Request.Builder() - .url("https://api.netbird.io/api/agent-network/settings") - .method("GET") - .addHeader("Accept", "application/json") - .addHeader("Authorization: Token ") - .build(); -Response response = client.newCall(request).execute(); -``` - -```php - 'https://api.netbird.io/api/agent-network/settings', - CURLOPT_RETURNTRANSFER => true, - CURLOPT_ENCODING => '', - CURLOPT_MAXREDIRS => 10, - CURLOPT_TIMEOUT => 0, - CURLOPT_FOLLOWLOCATION => true, - CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, - CURLOPT_CUSTOMREQUEST => 'GET', - CURLOPT_HTTPHEADER => array( - 'Accept: application/json', - 'Authorization: Token ' - ), -)); - -$response = curl_exec($curl); - -curl_close($curl); -echo $response; -``` - - - - - -```json {{ title: 'Example' }} -{ - "cluster": "eu.proxy.netbird.io", - "subdomain": "violet", - "endpoint": "violet.eu.proxy.netbird.io", - "enable_log_collection": false, - "enable_prompt_collection": false, - "redact_pii": false, - "access_log_retention_days": 30, - "created_at": "2026-04-26T10:30:00Z", - "updated_at": "2026-04-26T10:30:00Z" -} -``` -```json {{ title: 'Schema' }} -{ - "cluster": "string", - "subdomain": "string", - "endpoint": "string", - "enable_log_collection": "boolean", - "enable_prompt_collection": "boolean", - "redact_pii": "boolean", - "access_log_retention_days": "integer", - "created_at": "string", - "updated_at": "string" -} -``` - - - - - - ---- - - -## Update Agent Network settings {{ tag: 'PUT' , label: '/api/agent-network/settings' }} - - - - Updates the mutable account-level Agent Network settings (collection toggles). Cluster and subdomain are immutable and ignored if sent. Returns 404 when settings have not been bootstrapped (no provider created yet). - - ### Request-Body Parameters - - - - Whether per-request access-log entries are collected for this account's agent-network traffic. - - - - - Master switch for request/response prompt capture. - - - - - Whether captured prompts have PII redacted. - - - - - Days to retain full access-log rows; older rows are swept. 0 or less means keep indefinitely. - - - - - - - - - -```bash {{ title: 'cURL' }} -curl -X PUT https://api.netbird.io/api/agent-network/settings \ --H 'Accept: application/json' \ --H 'Content-Type: application/json' \ --H 'Authorization: Token ' \ ---data-raw '{ - "enable_log_collection": true, - "enable_prompt_collection": true, - "redact_pii": true, - "access_log_retention_days": 30 -}' -``` - -```js -const axios = require('axios'); -let data = JSON.stringify({ - "enable_log_collection": true, - "enable_prompt_collection": true, - "redact_pii": true, - "access_log_retention_days": 30 -}); -let config = { - method: 'put', - maxBodyLength: Infinity, - url: '/api/agent-network/settings', - headers: { - 'Accept': 'application/json', - 'Content-Type': 'application/json', - 'Authorization': 'Token ' - }, - data : data -}; - -axios(config) -.then((response) => { - console.log(JSON.stringify(response.data)); -}) -.catch((error) => { - console.log(error); -}); -``` - -```python -import requests -import json - -url = "https://api.netbird.io/api/agent-network/settings" -payload = json.dumps({ - "enable_log_collection": true, - "enable_prompt_collection": true, - "redact_pii": true, - "access_log_retention_days": 30 -}) -headers = { - 'Content-Type': 'application/json', - 'Accept': 'application/json', - 'Authorization': 'Token ' -} - -response = requests.request("PUT", url, headers=headers, data=payload) - -print(response.text) -``` - -```go -package main - -import ( - "fmt" - "strings" - "net/http" - "io/ioutil" -) - -func main() { - - url := "https://api.netbird.io/api/agent-network/settings" - method := "PUT" - - payload := strings.NewReader(`{ - "enable_log_collection": true, - "enable_prompt_collection": true, - "redact_pii": true, - "access_log_retention_days": 30 -}`) - client := &http.Client { - } - req, err := http.NewRequest(method, url, payload) - - if err != nil { - fmt.Println(err) - return - } - - - req.Header.Add("Content-Type", "application/json") - req.Header.Add("Accept", "application/json") - req.Header.Add("Authorization", "Token ") - - res, err := client.Do(req) - if err != nil { - fmt.Println(err) - return - } - defer res.Body.Close() - - body, err := ioutil.ReadAll(res.Body) - if err != nil { - fmt.Println(err) - return - } - fmt.Println(string(body)) -} -``` - -```ruby -require "uri" -require "json" -require "net/http" - -url = URI("https://api.netbird.io/api/agent-network/settings") - -https = Net::HTTP.new(url.host, url.port) -https.use_ssl = true - -request = Net::HTTP::Put.new(url) -request["Content-Type"] = "application/json" -request["Accept"] = "application/json" -request["Authorization"] = "Token " - -request.body = JSON.dump({ - "enable_log_collection": true, - "enable_prompt_collection": true, - "redact_pii": true, - "access_log_retention_days": 30 -}) -response = https.request(request) -puts response.read_body -``` - -```java -OkHttpClient client = new OkHttpClient().newBuilder() - .build(); -MediaType mediaType = MediaType.parse("application/json"); -RequestBody body = RequestBody.create(mediaType, '{ - "enable_log_collection": true, - "enable_prompt_collection": true, - "redact_pii": true, - "access_log_retention_days": 30 -}'); -Request request = new Request.Builder() - .url("https://api.netbird.io/api/agent-network/settings") - .method("PUT", body) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json") - .addHeader("Authorization: Token ") - .build(); -Response response = client.newCall(request).execute(); -``` - -```php - 'https://api.netbird.io/api/agent-network/settings', - CURLOPT_RETURNTRANSFER => true, - CURLOPT_ENCODING => '', - CURLOPT_MAXREDIRS => 10, - CURLOPT_TIMEOUT => 0, - CURLOPT_FOLLOWLOCATION => true, - CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, - CURLOPT_CUSTOMREQUEST => 'PUT', - CURLOPT_POSTFIELDS => '{ - "enable_log_collection": true, - "enable_prompt_collection": true, - "redact_pii": true, - "access_log_retention_days": 30 -}', - CURLOPT_HTTPHEADER => array( - 'Content-Type: application/json', - 'Accept: application/json', - 'Authorization: Token ' - ), -)); - -$response = curl_exec($curl); - -curl_close($curl); -echo $response; -``` - - - - - -```json {{ title: 'Example' }} -{ - "cluster": "eu.proxy.netbird.io", - "subdomain": "violet", - "endpoint": "violet.eu.proxy.netbird.io", - "enable_log_collection": false, - "enable_prompt_collection": false, - "redact_pii": false, - "access_log_retention_days": 30, - "created_at": "2026-04-26T10:30:00Z", - "updated_at": "2026-04-26T10:30:00Z" -} -``` -```json {{ title: 'Schema' }} -{ - "cluster": "string", - "subdomain": "string", - "endpoint": "string", - "enable_log_collection": "boolean", - "enable_prompt_collection": "boolean", - "redact_pii": "boolean", - "access_log_retention_days": "integer", - "created_at": "string", - "updated_at": "string" -} -``` - - - - - - ---- - - -## List all Agent Network budget rules {{ tag: 'GET' , label: '/api/agent-network/budget-rules' }} - - - - Returns all account-level budget rules. - - - - -```bash {{ title: 'cURL' }} -curl -X GET https://api.netbird.io/api/agent-network/budget-rules \ --H 'Accept: application/json' \ --H 'Authorization: Token ' -``` - -```js -const axios = require('axios'); - -let config = { - method: 'get', - maxBodyLength: Infinity, - url: '/api/agent-network/budget-rules', - headers: { - 'Accept': 'application/json', - 'Authorization': 'Token ' - } -}; - -axios(config) -.then((response) => { - console.log(JSON.stringify(response.data)); -}) -.catch((error) => { - console.log(error); -}); -``` - -```python -import requests -import json - -url = "https://api.netbird.io/api/agent-network/budget-rules" - -headers = { - 'Accept': 'application/json', - 'Authorization': 'Token ' -} - -response = requests.request("GET", url, headers=headers) - -print(response.text) -``` - -```go -package main - -import ( - "fmt" - "strings" - "net/http" - "io/ioutil" -) - -func main() { - - url := "https://api.netbird.io/api/agent-network/budget-rules" - method := "GET" - - client := &http.Client { - } - req, err := http.NewRequest(method, url, nil) - - if err != nil { - fmt.Println(err) - return - } - - - req.Header.Add("Accept", "application/json") - req.Header.Add("Authorization", "Token ") - - res, err := client.Do(req) - if err != nil { - fmt.Println(err) - return - } - defer res.Body.Close() - - body, err := ioutil.ReadAll(res.Body) - if err != nil { - fmt.Println(err) - return - } - fmt.Println(string(body)) -} -``` - -```ruby -require "uri" -require "json" -require "net/http" - -url = URI("https://api.netbird.io/api/agent-network/budget-rules") - -https = Net::HTTP.new(url.host, url.port) -https.use_ssl = true - -request = Net::HTTP::Get.new(url) -request["Accept"] = "application/json" -request["Authorization"] = "Token " - -response = https.request(request) -puts response.read_body -``` - -```java -OkHttpClient client = new OkHttpClient().newBuilder() - .build(); - -Request request = new Request.Builder() - .url("https://api.netbird.io/api/agent-network/budget-rules") - .method("GET") - .addHeader("Accept", "application/json") - .addHeader("Authorization: Token ") - .build(); -Response response = client.newCall(request).execute(); -``` - -```php - 'https://api.netbird.io/api/agent-network/budget-rules', - CURLOPT_RETURNTRANSFER => true, - CURLOPT_ENCODING => '', - CURLOPT_MAXREDIRS => 10, - CURLOPT_TIMEOUT => 0, - CURLOPT_FOLLOWLOCATION => true, - CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, - CURLOPT_CUSTOMREQUEST => 'GET', - CURLOPT_HTTPHEADER => array( - 'Accept: application/json', - 'Authorization: Token ' - ), -)); - -$response = curl_exec($curl); - -curl_close($curl); -echo $response; -``` - - - - - -```json {{ title: 'Example' }} -[ - { - "id": "ainbud_d1m3kebd9pcs0c1pnu7g", - "name": "Org monthly ceiling", - "enabled": true, - "target_groups": [ - "ch8vp3o6lnna9hg0sd8g" - ], - "target_users": [], - "limits": { - "token_limit": { - "enabled": true, - "group_cap": 10000000, - "user_cap": 1000000, - "window_seconds": 2592000 - }, - "budget_limit": { - "enabled": true, - "group_cap_usd": 1000, - "user_cap_usd": 100, - "window_seconds": 2592000 - } - }, - "created_at": "2026-04-26T10:30:00Z", - "updated_at": "2026-04-26T10:30:00Z" - } -] -``` -```json {{ title: 'Schema' }} -[ - { - "id": "string", - "name": "string", - "enabled": "boolean", - "target_groups": [ - "string" - ], - "target_users": [ - "string" - ], - "limits": { - "token_limit": { - "enabled": "boolean", - "group_cap": "integer", - "user_cap": "integer", - "window_seconds": "integer" - }, - "budget_limit": { - "enabled": "boolean", - "group_cap_usd": "number", - "user_cap_usd": "number", - "window_seconds": "integer" - } - }, - "created_at": "string", - "updated_at": "string" - } -] -``` - - - - - - ---- - - -## Create an Agent Network budget rule {{ tag: 'POST' , label: '/api/agent-network/budget-rules' }} - - - - Creates a new account-level budget rule. - - ### Request-Body Parameters - - - - Display name for the budget rule. - - - - - Whether the rule is enforced. Defaults to true on create. - - - - - NetBird group ids the rule binds. Empty plus empty target_users means account-wide. - - - - - NetBird user ids the rule binds directly. - - - - -
- Token and budget caps attached directly to the policy. These compose with any guardrail-level checks. - - - - -
- Per-policy token cap. `group_cap` is applied to each source group independently — every group in the policy's `source_groups` gets its own bucket of this size. `user_cap` is applied independently to each individual user. Caps reset to zero at the start of each window. - - - - - - - - - - Tokens allowed per source group within the window (each group has its own bucket of this size). 0 means uncapped. - - - - - Tokens allowed per individual user within the window. 0 means uncapped. - - - - - Reset frequency in seconds. The cap counter resets to zero at the start of each window. Minimum 60 (one minute) when the limit is enabled. - - - - - -
- -
- - -
- Per-policy USD spend cap. `group_cap_usd` is applied to each source group independently — every group in the policy's `source_groups` gets its own bucket of this size. `user_cap_usd` is applied independently to each individual user. Caps reset to zero at the start of each window. - - - - - - - - - - USD allowed per source group within the window (each group has its own bucket of this size). 0 means uncapped. - - - - - USD allowed per individual user within the window. 0 means uncapped. - - - - - Reset frequency in seconds. Caps reset at the start of each window. Minimum 60 (one minute) when the limit is enabled. - - - - - -
- -
-
- -
-
- -
-
- - - - - - -```bash {{ title: 'cURL' }} -curl -X POST https://api.netbird.io/api/agent-network/budget-rules \ --H 'Accept: application/json' \ --H 'Content-Type: application/json' \ --H 'Authorization: Token ' \ ---data-raw '{ - "name": "Org monthly ceiling", - "enabled": true, - "target_groups": [ - "ch8vp3o6lnna9hg0sd8g" - ], - "target_users": [], - "limits": { - "token_limit": { - "enabled": true, - "group_cap": 10000000, - "user_cap": 1000000, - "window_seconds": 2592000 - }, - "budget_limit": { - "enabled": true, - "group_cap_usd": 1000, - "user_cap_usd": 100, - "window_seconds": 2592000 - } - } -}' -``` - -```js -const axios = require('axios'); -let data = JSON.stringify({ - "name": "Org monthly ceiling", - "enabled": true, - "target_groups": [ - "ch8vp3o6lnna9hg0sd8g" - ], - "target_users": [], - "limits": { - "token_limit": { - "enabled": true, - "group_cap": 10000000, - "user_cap": 1000000, - "window_seconds": 2592000 - }, - "budget_limit": { - "enabled": true, - "group_cap_usd": 1000, - "user_cap_usd": 100, - "window_seconds": 2592000 - } - } -}); -let config = { - method: 'post', - maxBodyLength: Infinity, - url: '/api/agent-network/budget-rules', - headers: { - 'Accept': 'application/json', - 'Content-Type': 'application/json', - 'Authorization': 'Token ' - }, - data : data -}; - -axios(config) -.then((response) => { - console.log(JSON.stringify(response.data)); -}) -.catch((error) => { - console.log(error); -}); -``` - -```python -import requests -import json - -url = "https://api.netbird.io/api/agent-network/budget-rules" -payload = json.dumps({ - "name": "Org monthly ceiling", - "enabled": true, - "target_groups": [ - "ch8vp3o6lnna9hg0sd8g" - ], - "target_users": [], - "limits": { - "token_limit": { - "enabled": true, - "group_cap": 10000000, - "user_cap": 1000000, - "window_seconds": 2592000 - }, - "budget_limit": { - "enabled": true, - "group_cap_usd": 1000, - "user_cap_usd": 100, - "window_seconds": 2592000 - } - } -}) -headers = { - 'Content-Type': 'application/json', - 'Accept': 'application/json', - 'Authorization': 'Token ' -} - -response = requests.request("POST", url, headers=headers, data=payload) - -print(response.text) -``` - -```go -package main - -import ( - "fmt" - "strings" - "net/http" - "io/ioutil" -) - -func main() { - - url := "https://api.netbird.io/api/agent-network/budget-rules" - method := "POST" - - payload := strings.NewReader(`{ - "name": "Org monthly ceiling", - "enabled": true, - "target_groups": [ - "ch8vp3o6lnna9hg0sd8g" - ], - "target_users": [], - "limits": { - "token_limit": { - "enabled": true, - "group_cap": 10000000, - "user_cap": 1000000, - "window_seconds": 2592000 - }, - "budget_limit": { - "enabled": true, - "group_cap_usd": 1000, - "user_cap_usd": 100, - "window_seconds": 2592000 - } - } -}`) - client := &http.Client { - } - req, err := http.NewRequest(method, url, payload) - - if err != nil { - fmt.Println(err) - return - } - - - req.Header.Add("Content-Type", "application/json") - req.Header.Add("Accept", "application/json") - req.Header.Add("Authorization", "Token ") - - res, err := client.Do(req) - if err != nil { - fmt.Println(err) - return - } - defer res.Body.Close() - - body, err := ioutil.ReadAll(res.Body) - if err != nil { - fmt.Println(err) - return - } - fmt.Println(string(body)) -} -``` - -```ruby -require "uri" -require "json" -require "net/http" - -url = URI("https://api.netbird.io/api/agent-network/budget-rules") - -https = Net::HTTP.new(url.host, url.port) -https.use_ssl = true - -request = Net::HTTP::Post.new(url) -request["Content-Type"] = "application/json" -request["Accept"] = "application/json" -request["Authorization"] = "Token " - -request.body = JSON.dump({ - "name": "Org monthly ceiling", - "enabled": true, - "target_groups": [ - "ch8vp3o6lnna9hg0sd8g" - ], - "target_users": [], - "limits": { - "token_limit": { - "enabled": true, - "group_cap": 10000000, - "user_cap": 1000000, - "window_seconds": 2592000 - }, - "budget_limit": { - "enabled": true, - "group_cap_usd": 1000, - "user_cap_usd": 100, - "window_seconds": 2592000 - } - } -}) -response = https.request(request) -puts response.read_body -``` - -```java -OkHttpClient client = new OkHttpClient().newBuilder() - .build(); -MediaType mediaType = MediaType.parse("application/json"); -RequestBody body = RequestBody.create(mediaType, '{ - "name": "Org monthly ceiling", - "enabled": true, - "target_groups": [ - "ch8vp3o6lnna9hg0sd8g" - ], - "target_users": [], - "limits": { - "token_limit": { - "enabled": true, - "group_cap": 10000000, - "user_cap": 1000000, - "window_seconds": 2592000 - }, - "budget_limit": { - "enabled": true, - "group_cap_usd": 1000, - "user_cap_usd": 100, - "window_seconds": 2592000 - } - } -}'); -Request request = new Request.Builder() - .url("https://api.netbird.io/api/agent-network/budget-rules") - .method("POST", body) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json") - .addHeader("Authorization: Token ") - .build(); -Response response = client.newCall(request).execute(); -``` - -```php - 'https://api.netbird.io/api/agent-network/budget-rules', - CURLOPT_RETURNTRANSFER => true, - CURLOPT_ENCODING => '', - CURLOPT_MAXREDIRS => 10, - CURLOPT_TIMEOUT => 0, - CURLOPT_FOLLOWLOCATION => true, - CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, - CURLOPT_CUSTOMREQUEST => 'POST', - CURLOPT_POSTFIELDS => '{ - "name": "Org monthly ceiling", - "enabled": true, - "target_groups": [ - "ch8vp3o6lnna9hg0sd8g" - ], - "target_users": [], - "limits": { - "token_limit": { - "enabled": true, - "group_cap": 10000000, - "user_cap": 1000000, - "window_seconds": 2592000 - }, - "budget_limit": { - "enabled": true, - "group_cap_usd": 1000, - "user_cap_usd": 100, - "window_seconds": 2592000 - } - } -}', - CURLOPT_HTTPHEADER => array( - 'Content-Type: application/json', - 'Accept: application/json', - 'Authorization: Token ' - ), -)); - -$response = curl_exec($curl); - -curl_close($curl); -echo $response; -``` - - - - - -```json {{ title: 'Example' }} -{ - "id": "ainbud_d1m3kebd9pcs0c1pnu7g", - "name": "Org monthly ceiling", - "enabled": true, - "target_groups": [ - "ch8vp3o6lnna9hg0sd8g" - ], - "target_users": [], - "limits": { - "token_limit": { - "enabled": true, - "group_cap": 10000000, - "user_cap": 1000000, - "window_seconds": 2592000 - }, - "budget_limit": { - "enabled": true, - "group_cap_usd": 1000, - "user_cap_usd": 100, - "window_seconds": 2592000 - } - }, - "created_at": "2026-04-26T10:30:00Z", - "updated_at": "2026-04-26T10:30:00Z" -} -``` -```json {{ title: 'Schema' }} -{ - "id": "string", - "name": "string", - "enabled": "boolean", - "target_groups": [ - "string" - ], - "target_users": [ - "string" - ], - "limits": { - "token_limit": { - "enabled": "boolean", - "group_cap": "integer", - "user_cap": "integer", - "window_seconds": "integer" - }, - "budget_limit": { - "enabled": "boolean", - "group_cap_usd": "number", - "user_cap_usd": "number", - "window_seconds": "integer" - } - }, - "created_at": "string", - "updated_at": "string" -} -``` - - - - -
- ---- - - -## Retrieve an Agent Network budget rule {{ tag: 'GET' , label: '/api/agent-network/budget-rules/{ruleId}' }} - - - - Get a specific account-level budget rule. - - ### Path Parameters - - - - The unique identifier of a budget rule - - - - - - -```bash {{ title: 'cURL' }} -curl -X GET https://api.netbird.io/api/agent-network/budget-rules/{ruleId} \ --H 'Accept: application/json' \ --H 'Authorization: Token ' -``` - -```js -const axios = require('axios'); - -let config = { - method: 'get', - maxBodyLength: Infinity, - url: '/api/agent-network/budget-rules/{ruleId}', - headers: { - 'Accept': 'application/json', - 'Authorization': 'Token ' - } -}; - -axios(config) -.then((response) => { - console.log(JSON.stringify(response.data)); -}) -.catch((error) => { - console.log(error); -}); -``` - -```python -import requests -import json - -url = "https://api.netbird.io/api/agent-network/budget-rules/{ruleId}" - -headers = { - 'Accept': 'application/json', - 'Authorization': 'Token ' -} - -response = requests.request("GET", url, headers=headers) - -print(response.text) -``` - -```go -package main - -import ( - "fmt" - "strings" - "net/http" - "io/ioutil" -) - -func main() { - - url := "https://api.netbird.io/api/agent-network/budget-rules/{ruleId}" - method := "GET" - - client := &http.Client { - } - req, err := http.NewRequest(method, url, nil) - - if err != nil { - fmt.Println(err) - return - } - - - req.Header.Add("Accept", "application/json") - req.Header.Add("Authorization", "Token ") - - res, err := client.Do(req) - if err != nil { - fmt.Println(err) - return - } - defer res.Body.Close() - - body, err := ioutil.ReadAll(res.Body) - if err != nil { - fmt.Println(err) - return - } - fmt.Println(string(body)) -} -``` - -```ruby -require "uri" -require "json" -require "net/http" - -url = URI("https://api.netbird.io/api/agent-network/budget-rules/{ruleId}") - -https = Net::HTTP.new(url.host, url.port) -https.use_ssl = true - -request = Net::HTTP::Get.new(url) -request["Accept"] = "application/json" -request["Authorization"] = "Token " - -response = https.request(request) -puts response.read_body -``` - -```java -OkHttpClient client = new OkHttpClient().newBuilder() - .build(); - -Request request = new Request.Builder() - .url("https://api.netbird.io/api/agent-network/budget-rules/{ruleId}") - .method("GET") - .addHeader("Accept", "application/json") - .addHeader("Authorization: Token ") - .build(); -Response response = client.newCall(request).execute(); -``` - -```php - 'https://api.netbird.io/api/agent-network/budget-rules/{ruleId}', - CURLOPT_RETURNTRANSFER => true, - CURLOPT_ENCODING => '', - CURLOPT_MAXREDIRS => 10, - CURLOPT_TIMEOUT => 0, - CURLOPT_FOLLOWLOCATION => true, - CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, - CURLOPT_CUSTOMREQUEST => 'GET', - CURLOPT_HTTPHEADER => array( - 'Accept: application/json', - 'Authorization: Token ' - ), -)); - -$response = curl_exec($curl); - -curl_close($curl); -echo $response; -``` - - - - - -```json {{ title: 'Example' }} -{ - "id": "ainbud_d1m3kebd9pcs0c1pnu7g", - "name": "Org monthly ceiling", - "enabled": true, - "target_groups": [ - "ch8vp3o6lnna9hg0sd8g" - ], - "target_users": [], - "limits": { - "token_limit": { - "enabled": true, - "group_cap": 10000000, - "user_cap": 1000000, - "window_seconds": 2592000 - }, - "budget_limit": { - "enabled": true, - "group_cap_usd": 1000, - "user_cap_usd": 100, - "window_seconds": 2592000 - } - }, - "created_at": "2026-04-26T10:30:00Z", - "updated_at": "2026-04-26T10:30:00Z" -} -``` -```json {{ title: 'Schema' }} -{ - "id": "string", - "name": "string", - "enabled": "boolean", - "target_groups": [ - "string" - ], - "target_users": [ - "string" - ], - "limits": { - "token_limit": { - "enabled": "boolean", - "group_cap": "integer", - "user_cap": "integer", - "window_seconds": "integer" - }, - "budget_limit": { - "enabled": "boolean", - "group_cap_usd": "number", - "user_cap_usd": "number", - "window_seconds": "integer" - } - }, - "created_at": "string", - "updated_at": "string" -} -``` - - - - - - ---- - - -## Update an Agent Network budget rule {{ tag: 'PUT' , label: '/api/agent-network/budget-rules/{ruleId}' }} - - - - Updates an existing account-level budget rule. - - ### Path Parameters - - - - The unique identifier of a budget rule - - - - ### Request-Body Parameters - - - - Display name for the budget rule. - - - - - Whether the rule is enforced. Defaults to true on create. - - - - - NetBird group ids the rule binds. Empty plus empty target_users means account-wide. - - - - - NetBird user ids the rule binds directly. - - - - -
- Token and budget caps attached directly to the policy. These compose with any guardrail-level checks. - - - - -
- Per-policy token cap. `group_cap` is applied to each source group independently — every group in the policy's `source_groups` gets its own bucket of this size. `user_cap` is applied independently to each individual user. Caps reset to zero at the start of each window. - - - - - - - - - - Tokens allowed per source group within the window (each group has its own bucket of this size). 0 means uncapped. - - - - - Tokens allowed per individual user within the window. 0 means uncapped. - - - - - Reset frequency in seconds. The cap counter resets to zero at the start of each window. Minimum 60 (one minute) when the limit is enabled. - - - - - -
- -
- - -
- Per-policy USD spend cap. `group_cap_usd` is applied to each source group independently — every group in the policy's `source_groups` gets its own bucket of this size. `user_cap_usd` is applied independently to each individual user. Caps reset to zero at the start of each window. - - - - - - - - - - USD allowed per source group within the window (each group has its own bucket of this size). 0 means uncapped. - - - - - USD allowed per individual user within the window. 0 means uncapped. - - - - - Reset frequency in seconds. Caps reset at the start of each window. Minimum 60 (one minute) when the limit is enabled. - - - - - -
- -
-
- -
-
- -
-
- - - - - - -```bash {{ title: 'cURL' }} -curl -X PUT https://api.netbird.io/api/agent-network/budget-rules/{ruleId} \ --H 'Accept: application/json' \ --H 'Content-Type: application/json' \ --H 'Authorization: Token ' \ ---data-raw '{ - "name": "Org monthly ceiling", - "enabled": true, - "target_groups": [ - "ch8vp3o6lnna9hg0sd8g" - ], - "target_users": [], - "limits": { - "token_limit": { - "enabled": true, - "group_cap": 10000000, - "user_cap": 1000000, - "window_seconds": 2592000 - }, - "budget_limit": { - "enabled": true, - "group_cap_usd": 1000, - "user_cap_usd": 100, - "window_seconds": 2592000 - } - } -}' -``` - -```js -const axios = require('axios'); -let data = JSON.stringify({ - "name": "Org monthly ceiling", - "enabled": true, - "target_groups": [ - "ch8vp3o6lnna9hg0sd8g" - ], - "target_users": [], - "limits": { - "token_limit": { - "enabled": true, - "group_cap": 10000000, - "user_cap": 1000000, - "window_seconds": 2592000 - }, - "budget_limit": { - "enabled": true, - "group_cap_usd": 1000, - "user_cap_usd": 100, - "window_seconds": 2592000 - } - } -}); -let config = { - method: 'put', - maxBodyLength: Infinity, - url: '/api/agent-network/budget-rules/{ruleId}', - headers: { - 'Accept': 'application/json', - 'Content-Type': 'application/json', - 'Authorization': 'Token ' - }, - data : data -}; - -axios(config) -.then((response) => { - console.log(JSON.stringify(response.data)); -}) -.catch((error) => { - console.log(error); -}); -``` - -```python -import requests -import json - -url = "https://api.netbird.io/api/agent-network/budget-rules/{ruleId}" -payload = json.dumps({ - "name": "Org monthly ceiling", - "enabled": true, - "target_groups": [ - "ch8vp3o6lnna9hg0sd8g" - ], - "target_users": [], - "limits": { - "token_limit": { - "enabled": true, - "group_cap": 10000000, - "user_cap": 1000000, - "window_seconds": 2592000 - }, - "budget_limit": { - "enabled": true, - "group_cap_usd": 1000, - "user_cap_usd": 100, - "window_seconds": 2592000 - } - } -}) -headers = { - 'Content-Type': 'application/json', - 'Accept': 'application/json', - 'Authorization': 'Token ' -} - -response = requests.request("PUT", url, headers=headers, data=payload) - -print(response.text) -``` - -```go -package main - -import ( - "fmt" - "strings" - "net/http" - "io/ioutil" -) - -func main() { - - url := "https://api.netbird.io/api/agent-network/budget-rules/{ruleId}" - method := "PUT" - - payload := strings.NewReader(`{ - "name": "Org monthly ceiling", - "enabled": true, - "target_groups": [ - "ch8vp3o6lnna9hg0sd8g" - ], - "target_users": [], - "limits": { - "token_limit": { - "enabled": true, - "group_cap": 10000000, - "user_cap": 1000000, - "window_seconds": 2592000 - }, - "budget_limit": { - "enabled": true, - "group_cap_usd": 1000, - "user_cap_usd": 100, - "window_seconds": 2592000 - } - } -}`) - client := &http.Client { - } - req, err := http.NewRequest(method, url, payload) - - if err != nil { - fmt.Println(err) - return - } - - - req.Header.Add("Content-Type", "application/json") - req.Header.Add("Accept", "application/json") - req.Header.Add("Authorization", "Token ") - - res, err := client.Do(req) - if err != nil { - fmt.Println(err) - return - } - defer res.Body.Close() - - body, err := ioutil.ReadAll(res.Body) - if err != nil { - fmt.Println(err) - return - } - fmt.Println(string(body)) -} -``` - -```ruby -require "uri" -require "json" -require "net/http" - -url = URI("https://api.netbird.io/api/agent-network/budget-rules/{ruleId}") - -https = Net::HTTP.new(url.host, url.port) -https.use_ssl = true - -request = Net::HTTP::Put.new(url) -request["Content-Type"] = "application/json" -request["Accept"] = "application/json" -request["Authorization"] = "Token " - -request.body = JSON.dump({ - "name": "Org monthly ceiling", - "enabled": true, - "target_groups": [ - "ch8vp3o6lnna9hg0sd8g" - ], - "target_users": [], - "limits": { - "token_limit": { - "enabled": true, - "group_cap": 10000000, - "user_cap": 1000000, - "window_seconds": 2592000 - }, - "budget_limit": { - "enabled": true, - "group_cap_usd": 1000, - "user_cap_usd": 100, - "window_seconds": 2592000 - } - } -}) -response = https.request(request) -puts response.read_body -``` - -```java -OkHttpClient client = new OkHttpClient().newBuilder() - .build(); -MediaType mediaType = MediaType.parse("application/json"); -RequestBody body = RequestBody.create(mediaType, '{ - "name": "Org monthly ceiling", - "enabled": true, - "target_groups": [ - "ch8vp3o6lnna9hg0sd8g" - ], - "target_users": [], - "limits": { - "token_limit": { - "enabled": true, - "group_cap": 10000000, - "user_cap": 1000000, - "window_seconds": 2592000 - }, - "budget_limit": { - "enabled": true, - "group_cap_usd": 1000, - "user_cap_usd": 100, - "window_seconds": 2592000 - } - } -}'); -Request request = new Request.Builder() - .url("https://api.netbird.io/api/agent-network/budget-rules/{ruleId}") - .method("PUT", body) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json") - .addHeader("Authorization: Token ") - .build(); -Response response = client.newCall(request).execute(); -``` - -```php - 'https://api.netbird.io/api/agent-network/budget-rules/{ruleId}', - CURLOPT_RETURNTRANSFER => true, - CURLOPT_ENCODING => '', - CURLOPT_MAXREDIRS => 10, - CURLOPT_TIMEOUT => 0, - CURLOPT_FOLLOWLOCATION => true, - CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, - CURLOPT_CUSTOMREQUEST => 'PUT', - CURLOPT_POSTFIELDS => '{ - "name": "Org monthly ceiling", - "enabled": true, - "target_groups": [ - "ch8vp3o6lnna9hg0sd8g" - ], - "target_users": [], - "limits": { - "token_limit": { - "enabled": true, - "group_cap": 10000000, - "user_cap": 1000000, - "window_seconds": 2592000 - }, - "budget_limit": { - "enabled": true, - "group_cap_usd": 1000, - "user_cap_usd": 100, - "window_seconds": 2592000 - } - } -}', - CURLOPT_HTTPHEADER => array( - 'Content-Type: application/json', - 'Accept: application/json', - 'Authorization: Token ' - ), -)); - -$response = curl_exec($curl); - -curl_close($curl); -echo $response; -``` - - - - - -```json {{ title: 'Example' }} -{ - "id": "ainbud_d1m3kebd9pcs0c1pnu7g", - "name": "Org monthly ceiling", - "enabled": true, - "target_groups": [ - "ch8vp3o6lnna9hg0sd8g" - ], - "target_users": [], - "limits": { - "token_limit": { - "enabled": true, - "group_cap": 10000000, - "user_cap": 1000000, - "window_seconds": 2592000 - }, - "budget_limit": { - "enabled": true, - "group_cap_usd": 1000, - "user_cap_usd": 100, - "window_seconds": 2592000 - } - }, - "created_at": "2026-04-26T10:30:00Z", - "updated_at": "2026-04-26T10:30:00Z" -} -``` -```json {{ title: 'Schema' }} -{ - "id": "string", - "name": "string", - "enabled": "boolean", - "target_groups": [ - "string" - ], - "target_users": [ - "string" - ], - "limits": { - "token_limit": { - "enabled": "boolean", - "group_cap": "integer", - "user_cap": "integer", - "window_seconds": "integer" - }, - "budget_limit": { - "enabled": "boolean", - "group_cap_usd": "number", - "user_cap_usd": "number", - "window_seconds": "integer" - } - }, - "created_at": "string", - "updated_at": "string" -} -``` - - - - -
- ---- - - -## Delete an Agent Network budget rule {{ tag: 'DELETE' , label: '/api/agent-network/budget-rules/{ruleId}' }} - - - - Deletes an account-level budget rule. - - ### Path Parameters - - - - The unique identifier of a budget rule - - - - - - -```bash {{ title: 'cURL' }} -curl -X DELETE https://api.netbird.io/api/agent-network/budget-rules/{ruleId} \ --H 'Accept: application/json' \ --H 'Authorization: Token ' -``` - -```js -const axios = require('axios'); - -let config = { - method: 'delete', - maxBodyLength: Infinity, - url: '/api/agent-network/budget-rules/{ruleId}', - headers: { - 'Accept': 'application/json', - 'Authorization': 'Token ' - } -}; - -axios(config) -.then((response) => { - console.log(JSON.stringify(response.data)); -}) -.catch((error) => { - console.log(error); -}); -``` - -```python -import requests -import json - -url = "https://api.netbird.io/api/agent-network/budget-rules/{ruleId}" - -headers = { - 'Accept': 'application/json', - 'Authorization': 'Token ' -} - -response = requests.request("DELETE", url, headers=headers) - -print(response.text) -``` - -```go -package main - -import ( - "fmt" - "strings" - "net/http" - "io/ioutil" -) - -func main() { - - url := "https://api.netbird.io/api/agent-network/budget-rules/{ruleId}" - method := "DELETE" - - client := &http.Client { - } - req, err := http.NewRequest(method, url, nil) - - if err != nil { - fmt.Println(err) - return - } - - - req.Header.Add("Accept", "application/json") - req.Header.Add("Authorization", "Token ") - - res, err := client.Do(req) - if err != nil { - fmt.Println(err) - return - } - defer res.Body.Close() - - body, err := ioutil.ReadAll(res.Body) - if err != nil { - fmt.Println(err) - return - } - fmt.Println(string(body)) -} -``` - -```ruby -require "uri" -require "json" -require "net/http" - -url = URI("https://api.netbird.io/api/agent-network/budget-rules/{ruleId}") - -https = Net::HTTP.new(url.host, url.port) -https.use_ssl = true - -request = Net::HTTP::Delete.new(url) -request["Accept"] = "application/json" -request["Authorization"] = "Token " - -response = https.request(request) -puts response.read_body -``` - -```java -OkHttpClient client = new OkHttpClient().newBuilder() - .build(); - -Request request = new Request.Builder() - .url("https://api.netbird.io/api/agent-network/budget-rules/{ruleId}") - .method("DELETE") - .addHeader("Accept", "application/json") - .addHeader("Authorization: Token ") - .build(); -Response response = client.newCall(request).execute(); -``` - -```php - 'https://api.netbird.io/api/agent-network/budget-rules/{ruleId}', - CURLOPT_RETURNTRANSFER => true, - CURLOPT_ENCODING => '', - CURLOPT_MAXREDIRS => 10, - CURLOPT_TIMEOUT => 0, - CURLOPT_FOLLOWLOCATION => true, - CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, - CURLOPT_CUSTOMREQUEST => 'DELETE', - CURLOPT_HTTPHEADER => array( - 'Accept: application/json', - 'Authorization: Token ' - ), -)); - -$response = curl_exec($curl); - -curl_close($curl); -echo $response; -``` - - - - - -```json {{ title: 'Example' }} -{ - "type": "object" -} -``` -```json {{ title: 'Schema' }} -{ - "type": "object" -} -``` - - - - - - ---- - - -## List Agent Network catalog providers {{ tag: 'GET' , label: '/api/agent-network/catalog/providers' }} - - - - Returns the static catalog of supported Agent Network providers (OpenAI, Anthropic, …) along with their default upstream host, auth header template, brand color, and known models. - - - - -```bash {{ title: 'cURL' }} -curl -X GET https://api.netbird.io/api/agent-network/catalog/providers \ --H 'Accept: application/json' \ --H 'Authorization: Token ' -``` - -```js -const axios = require('axios'); - -let config = { - method: 'get', - maxBodyLength: Infinity, - url: '/api/agent-network/catalog/providers', - headers: { - 'Accept': 'application/json', - 'Authorization': 'Token ' - } -}; - -axios(config) -.then((response) => { - console.log(JSON.stringify(response.data)); -}) -.catch((error) => { - console.log(error); -}); -``` - -```python -import requests -import json - -url = "https://api.netbird.io/api/agent-network/catalog/providers" - -headers = { - 'Accept': 'application/json', - 'Authorization': 'Token ' -} - -response = requests.request("GET", url, headers=headers) - -print(response.text) -``` - -```go -package main - -import ( - "fmt" - "strings" - "net/http" - "io/ioutil" -) - -func main() { - - url := "https://api.netbird.io/api/agent-network/catalog/providers" - method := "GET" - - client := &http.Client { - } - req, err := http.NewRequest(method, url, nil) - - if err != nil { - fmt.Println(err) - return - } - - - req.Header.Add("Accept", "application/json") - req.Header.Add("Authorization", "Token ") - - res, err := client.Do(req) - if err != nil { - fmt.Println(err) - return - } - defer res.Body.Close() - - body, err := ioutil.ReadAll(res.Body) - if err != nil { - fmt.Println(err) - return - } - fmt.Println(string(body)) -} -``` - -```ruby -require "uri" -require "json" -require "net/http" - -url = URI("https://api.netbird.io/api/agent-network/catalog/providers") - -https = Net::HTTP.new(url.host, url.port) -https.use_ssl = true - -request = Net::HTTP::Get.new(url) -request["Accept"] = "application/json" -request["Authorization"] = "Token " - -response = https.request(request) -puts response.read_body -``` - -```java -OkHttpClient client = new OkHttpClient().newBuilder() - .build(); - -Request request = new Request.Builder() - .url("https://api.netbird.io/api/agent-network/catalog/providers") - .method("GET") - .addHeader("Accept", "application/json") - .addHeader("Authorization: Token ") - .build(); -Response response = client.newCall(request).execute(); -``` - -```php - 'https://api.netbird.io/api/agent-network/catalog/providers', - CURLOPT_RETURNTRANSFER => true, - CURLOPT_ENCODING => '', - CURLOPT_MAXREDIRS => 10, - CURLOPT_TIMEOUT => 0, - CURLOPT_FOLLOWLOCATION => true, - CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, - CURLOPT_CUSTOMREQUEST => 'GET', - CURLOPT_HTTPHEADER => array( - 'Accept: application/json', - 'Authorization: Token ' - ), -)); - -$response = curl_exec($curl); - -curl_close($curl); -echo $response; -``` - - - - - -```json {{ title: 'Example' }} -[ - { - "id": "openai_api", - "name": "OpenAI API", - "description": "GPT, Responses API, and Embeddings", - "default_host": "api.openai.com", - "auth_header_template": "Bearer ${API_KEY}", - "default_content_type": "application/json", - "brand_color": "#10A37F", - "kind": "provider", - "extra_headers": [ - { - "name": "x-portkey-config" - } - ], - "identity_injection": { - "header_pair": { - "customizable": true, - "end_user_id_header": "x-bf-dim-netbird_user_id", - "tags_header": "x-bf-dim-netbird_groups" - }, - "json_metadata": { - "customizable": true, - "header": "cf-aig-metadata", - "user_key": "netbird_user_id", - "groups_key": "netbird_groups" - } - }, - "models": [ - { - "id": "gpt-4o", - "label": "GPT-4o", - "input_per_1k": 0.005, - "output_per_1k": 0.015, - "context_window": 128000 - } - ] - } -] -``` -```json {{ title: 'Schema' }} -[ - { - "id": "string", - "name": "string", - "description": "string", - "default_host": "string", - "auth_header_template": "string", - "default_content_type": "string", - "brand_color": "string", - "kind": "string", - "extra_headers": [ - { - "name": "string" - } - ], - "identity_injection": { - "header_pair": { - "customizable": "boolean", - "end_user_id_header": "string", - "tags_header": "string" - }, - "json_metadata": { - "customizable": "boolean", - "header": "string", - "user_key": "string", - "groups_key": "string" - } - }, - "models": [ - { - "id": "string", - "label": "string", - "input_per_1k": "number", - "output_per_1k": "number", - "context_window": "integer" - } - ] - } -] -``` - - - - - - ---- - - -## List all Agent Network Providers {{ tag: 'GET' , label: '/api/agent-network/providers' }} - - - - Returns a list of all Agent Network AI providers configured for the account. - - - - -```bash {{ title: 'cURL' }} -curl -X GET https://api.netbird.io/api/agent-network/providers \ --H 'Accept: application/json' \ --H 'Authorization: Token ' -``` - -```js -const axios = require('axios'); - -let config = { - method: 'get', - maxBodyLength: Infinity, - url: '/api/agent-network/providers', - headers: { - 'Accept': 'application/json', - 'Authorization': 'Token ' - } -}; - -axios(config) -.then((response) => { - console.log(JSON.stringify(response.data)); -}) -.catch((error) => { - console.log(error); -}); -``` - -```python -import requests -import json - -url = "https://api.netbird.io/api/agent-network/providers" - -headers = { - 'Accept': 'application/json', - 'Authorization': 'Token ' -} - -response = requests.request("GET", url, headers=headers) - -print(response.text) -``` - -```go -package main - -import ( - "fmt" - "strings" - "net/http" - "io/ioutil" -) - -func main() { - - url := "https://api.netbird.io/api/agent-network/providers" - method := "GET" - - client := &http.Client { - } - req, err := http.NewRequest(method, url, nil) - - if err != nil { - fmt.Println(err) - return - } - - - req.Header.Add("Accept", "application/json") - req.Header.Add("Authorization", "Token ") - - res, err := client.Do(req) - if err != nil { - fmt.Println(err) - return - } - defer res.Body.Close() - - body, err := ioutil.ReadAll(res.Body) - if err != nil { - fmt.Println(err) - return - } - fmt.Println(string(body)) -} -``` - -```ruby -require "uri" -require "json" -require "net/http" - -url = URI("https://api.netbird.io/api/agent-network/providers") - -https = Net::HTTP.new(url.host, url.port) -https.use_ssl = true - -request = Net::HTTP::Get.new(url) -request["Accept"] = "application/json" -request["Authorization"] = "Token " - -response = https.request(request) -puts response.read_body -``` - -```java -OkHttpClient client = new OkHttpClient().newBuilder() - .build(); - -Request request = new Request.Builder() - .url("https://api.netbird.io/api/agent-network/providers") - .method("GET") - .addHeader("Accept", "application/json") - .addHeader("Authorization: Token ") - .build(); -Response response = client.newCall(request).execute(); -``` - -```php - 'https://api.netbird.io/api/agent-network/providers', - CURLOPT_RETURNTRANSFER => true, - CURLOPT_ENCODING => '', - CURLOPT_MAXREDIRS => 10, - CURLOPT_TIMEOUT => 0, - CURLOPT_FOLLOWLOCATION => true, - CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, - CURLOPT_CUSTOMREQUEST => 'GET', - CURLOPT_HTTPHEADER => array( - 'Accept: application/json', - 'Authorization: Token ' - ), -)); - -$response = curl_exec($curl); - -curl_close($curl); -echo $response; -``` - - - - - -```json {{ title: 'Example' }} -[ - { - "id": "ainp_d1m3kebd9pcs0c1pnu7g", - "provider_id": "openai_api", - "name": "OpenAI API", - "upstream_url": "https://api.openai.com", - "models": [ - { - "id": "gpt-4o-mini", - "input_per_1k": 0.00015, - "output_per_1k": 0.0006 - } - ], - "extra_values": { - "x-portkey-config": "pc-prod-3f2a" - }, - "identity_header_user_id": "x-bf-dim-netbird_user_id", - "identity_header_groups": "x-bf-dim-netbird_groups", - "enabled": true, - "created_at": "2026-04-26T10:30:00Z", - "updated_at": "2026-04-26T10:30:00Z" - } -] -``` -```json {{ title: 'Schema' }} -[ - { - "id": "string", - "provider_id": "string", - "name": "string", - "upstream_url": "string", - "models": [ - { - "id": "string", - "input_per_1k": "number", - "output_per_1k": "number" - } - ], - "extra_values": { - "type": "object", - "description": "Operator-typed values for catalog-declared extra headers. Keys are wire header names (e.g. `x-portkey-config`); values are the strings the proxy stamps on every upstream request to this provider. Catalog (AgentNetworkCatalogProvider.extra_headers) declares which keys are accepted; values not declared by the catalog are ignored at synth time. Empty / missing values mean no header stamped.\n", - "additionalProperties": "string", - "example": { - "x-portkey-config": "pc-prod-3f2a" - } - }, - "identity_header_user_id": "string", - "identity_header_groups": "string", - "enabled": "boolean", - "created_at": "string", - "updated_at": "string" - } -] -``` - - - - - - ---- - - -## Create an Agent Network Provider {{ tag: 'POST' , label: '/api/agent-network/providers' }} - - - - Connects a new Agent Network AI provider for the account. - - ### Request-Body Parameters - - - - Catalog identifier for the upstream AI provider (e.g. openai_api, anthropic_api, azure_openai_api, bedrock_api, vertex_ai_api, mistral_api, custom). - - - - - Display name for the provider. - - - - - Full upstream URL (with scheme) that NetBird forwards traffic to. - - - - - Proxy cluster used to bootstrap the per-account agent-network endpoint when the first provider is created. Ignored on subsequent creates and on updates because the cluster is pinned on the account-level Settings row. - - - - - Upstream provider API key. Sealed at rest on the management server and never returned in responses. Required on create; optional on update (omit to keep the existing key). - - - - -
- Models exposed through this endpoint, with the operator's per-1k input/output prices. Empty means all catalog models are allowed at catalog prices. - - - - - Model identifier (e.g. "gpt-4o-mini"). - - - - - Cost per 1k input tokens, in USD. - - - - - Cost per 1k output tokens, in USD. - - - - - -
- -
- - - Operator-typed values for catalog-declared extra headers (see AgentNetworkProvider.extra_values). When present on a request, the whole map replaces the stored values. Empty strings drop the corresponding key. - - - - - - Wire header name for the caller's display identity. See AgentNetworkProvider.identity_header_user_id. When omitted on a request, the stored value is left unchanged; pass an empty string explicitly to clear it (which disables stamping for this dimension). - - - - - - Wire header name for the caller's groups CSV. See AgentNetworkProvider.identity_header_groups. Same omit / empty semantics as `identity_header_user_id`. - - - - - - Whether the provider is enabled. Defaults to true on create. - - -
- - - - - - -```bash {{ title: 'cURL' }} -curl -X POST https://api.netbird.io/api/agent-network/providers \ --H 'Accept: application/json' \ --H 'Content-Type: application/json' \ --H 'Authorization: Token ' \ ---data-raw '{ - "provider_id": "openai_api", - "name": "OpenAI API", - "upstream_url": "https://api.openai.com", - "bootstrap_cluster": "eu.proxy.netbird.io", - "api_key": "sk-...", - "models": [ - { - "id": "gpt-4o-mini", - "input_per_1k": 0.00015, - "output_per_1k": 0.0006 - } - ], - "extra_values": { - "x-portkey-config": "pc-prod-3f2a" - }, - "identity_header_user_id": "x-bf-dim-netbird_user_id", - "identity_header_groups": "x-bf-dim-netbird_groups", - "enabled": true -}' -``` - -```js -const axios = require('axios'); -let data = JSON.stringify({ - "provider_id": "openai_api", - "name": "OpenAI API", - "upstream_url": "https://api.openai.com", - "bootstrap_cluster": "eu.proxy.netbird.io", - "api_key": "sk-...", - "models": [ - { - "id": "gpt-4o-mini", - "input_per_1k": 0.00015, - "output_per_1k": 0.0006 - } - ], - "extra_values": { - "x-portkey-config": "pc-prod-3f2a" - }, - "identity_header_user_id": "x-bf-dim-netbird_user_id", - "identity_header_groups": "x-bf-dim-netbird_groups", - "enabled": true -}); -let config = { - method: 'post', - maxBodyLength: Infinity, - url: '/api/agent-network/providers', - headers: { - 'Accept': 'application/json', - 'Content-Type': 'application/json', - 'Authorization': 'Token ' - }, - data : data -}; - -axios(config) -.then((response) => { - console.log(JSON.stringify(response.data)); -}) -.catch((error) => { - console.log(error); -}); -``` - -```python -import requests -import json - -url = "https://api.netbird.io/api/agent-network/providers" -payload = json.dumps({ - "provider_id": "openai_api", - "name": "OpenAI API", - "upstream_url": "https://api.openai.com", - "bootstrap_cluster": "eu.proxy.netbird.io", - "api_key": "sk-...", - "models": [ - { - "id": "gpt-4o-mini", - "input_per_1k": 0.00015, - "output_per_1k": 0.0006 - } - ], - "extra_values": { - "x-portkey-config": "pc-prod-3f2a" - }, - "identity_header_user_id": "x-bf-dim-netbird_user_id", - "identity_header_groups": "x-bf-dim-netbird_groups", - "enabled": true -}) -headers = { - 'Content-Type': 'application/json', - 'Accept': 'application/json', - 'Authorization': 'Token ' -} - -response = requests.request("POST", url, headers=headers, data=payload) - -print(response.text) -``` - -```go -package main - -import ( - "fmt" - "strings" - "net/http" - "io/ioutil" -) - -func main() { - - url := "https://api.netbird.io/api/agent-network/providers" - method := "POST" - - payload := strings.NewReader(`{ - "provider_id": "openai_api", - "name": "OpenAI API", - "upstream_url": "https://api.openai.com", - "bootstrap_cluster": "eu.proxy.netbird.io", - "api_key": "sk-...", - "models": [ - { - "id": "gpt-4o-mini", - "input_per_1k": 0.00015, - "output_per_1k": 0.0006 - } - ], - "extra_values": { - "x-portkey-config": "pc-prod-3f2a" - }, - "identity_header_user_id": "x-bf-dim-netbird_user_id", - "identity_header_groups": "x-bf-dim-netbird_groups", - "enabled": true -}`) - client := &http.Client { - } - req, err := http.NewRequest(method, url, payload) - - if err != nil { - fmt.Println(err) - return - } - - - req.Header.Add("Content-Type", "application/json") - req.Header.Add("Accept", "application/json") - req.Header.Add("Authorization", "Token ") - - res, err := client.Do(req) - if err != nil { - fmt.Println(err) - return - } - defer res.Body.Close() - - body, err := ioutil.ReadAll(res.Body) - if err != nil { - fmt.Println(err) - return - } - fmt.Println(string(body)) -} -``` - -```ruby -require "uri" -require "json" -require "net/http" - -url = URI("https://api.netbird.io/api/agent-network/providers") - -https = Net::HTTP.new(url.host, url.port) -https.use_ssl = true - -request = Net::HTTP::Post.new(url) -request["Content-Type"] = "application/json" -request["Accept"] = "application/json" -request["Authorization"] = "Token " - -request.body = JSON.dump({ - "provider_id": "openai_api", - "name": "OpenAI API", - "upstream_url": "https://api.openai.com", - "bootstrap_cluster": "eu.proxy.netbird.io", - "api_key": "sk-...", - "models": [ - { - "id": "gpt-4o-mini", - "input_per_1k": 0.00015, - "output_per_1k": 0.0006 - } - ], - "extra_values": { - "x-portkey-config": "pc-prod-3f2a" - }, - "identity_header_user_id": "x-bf-dim-netbird_user_id", - "identity_header_groups": "x-bf-dim-netbird_groups", - "enabled": true -}) -response = https.request(request) -puts response.read_body -``` - -```java -OkHttpClient client = new OkHttpClient().newBuilder() - .build(); -MediaType mediaType = MediaType.parse("application/json"); -RequestBody body = RequestBody.create(mediaType, '{ - "provider_id": "openai_api", - "name": "OpenAI API", - "upstream_url": "https://api.openai.com", - "bootstrap_cluster": "eu.proxy.netbird.io", - "api_key": "sk-...", - "models": [ - { - "id": "gpt-4o-mini", - "input_per_1k": 0.00015, - "output_per_1k": 0.0006 - } - ], - "extra_values": { - "x-portkey-config": "pc-prod-3f2a" - }, - "identity_header_user_id": "x-bf-dim-netbird_user_id", - "identity_header_groups": "x-bf-dim-netbird_groups", - "enabled": true -}'); -Request request = new Request.Builder() - .url("https://api.netbird.io/api/agent-network/providers") - .method("POST", body) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json") - .addHeader("Authorization: Token ") - .build(); -Response response = client.newCall(request).execute(); -``` - -```php - 'https://api.netbird.io/api/agent-network/providers', - CURLOPT_RETURNTRANSFER => true, - CURLOPT_ENCODING => '', - CURLOPT_MAXREDIRS => 10, - CURLOPT_TIMEOUT => 0, - CURLOPT_FOLLOWLOCATION => true, - CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, - CURLOPT_CUSTOMREQUEST => 'POST', - CURLOPT_POSTFIELDS => '{ - "provider_id": "openai_api", - "name": "OpenAI API", - "upstream_url": "https://api.openai.com", - "bootstrap_cluster": "eu.proxy.netbird.io", - "api_key": "sk-...", - "models": [ - { - "id": "gpt-4o-mini", - "input_per_1k": 0.00015, - "output_per_1k": 0.0006 - } - ], - "extra_values": { - "x-portkey-config": "pc-prod-3f2a" - }, - "identity_header_user_id": "x-bf-dim-netbird_user_id", - "identity_header_groups": "x-bf-dim-netbird_groups", - "enabled": true -}', - CURLOPT_HTTPHEADER => array( - 'Content-Type: application/json', - 'Accept: application/json', - 'Authorization: Token ' - ), -)); - -$response = curl_exec($curl); - -curl_close($curl); -echo $response; -``` - - - - - -```json {{ title: 'Example' }} -{ - "id": "ainp_d1m3kebd9pcs0c1pnu7g", - "provider_id": "openai_api", - "name": "OpenAI API", - "upstream_url": "https://api.openai.com", - "models": [ - { - "id": "gpt-4o-mini", - "input_per_1k": 0.00015, - "output_per_1k": 0.0006 - } - ], - "extra_values": { - "x-portkey-config": "pc-prod-3f2a" - }, - "identity_header_user_id": "x-bf-dim-netbird_user_id", - "identity_header_groups": "x-bf-dim-netbird_groups", - "enabled": true, - "created_at": "2026-04-26T10:30:00Z", - "updated_at": "2026-04-26T10:30:00Z" -} -``` -```json {{ title: 'Schema' }} -{ - "id": "string", - "provider_id": "string", - "name": "string", - "upstream_url": "string", - "models": [ - { - "id": "string", - "input_per_1k": "number", - "output_per_1k": "number" - } - ], - "extra_values": { - "type": "object", - "description": "Operator-typed values for catalog-declared extra headers. Keys are wire header names (e.g. `x-portkey-config`); values are the strings the proxy stamps on every upstream request to this provider. Catalog (AgentNetworkCatalogProvider.extra_headers) declares which keys are accepted; values not declared by the catalog are ignored at synth time. Empty / missing values mean no header stamped.\n", - "additionalProperties": "string", - "example": { - "x-portkey-config": "pc-prod-3f2a" - } - }, - "identity_header_user_id": "string", - "identity_header_groups": "string", - "enabled": "boolean", - "created_at": "string", - "updated_at": "string" -} -``` - - - - -
- ---- - - -## Retrieve an Agent Network Provider {{ tag: 'GET' , label: '/api/agent-network/providers/{providerId}' }} - - - - Get information about a specific Agent Network AI provider. - - ### Path Parameters - - - - The unique identifier of an Agent Network provider - - - - - - -```bash {{ title: 'cURL' }} -curl -X GET https://api.netbird.io/api/agent-network/providers/{providerId} \ --H 'Accept: application/json' \ --H 'Authorization: Token ' -``` - -```js -const axios = require('axios'); - -let config = { - method: 'get', - maxBodyLength: Infinity, - url: '/api/agent-network/providers/{providerId}', - headers: { - 'Accept': 'application/json', - 'Authorization': 'Token ' - } -}; - -axios(config) -.then((response) => { - console.log(JSON.stringify(response.data)); -}) -.catch((error) => { - console.log(error); -}); -``` - -```python -import requests -import json - -url = "https://api.netbird.io/api/agent-network/providers/{providerId}" - -headers = { - 'Accept': 'application/json', - 'Authorization': 'Token ' -} - -response = requests.request("GET", url, headers=headers) - -print(response.text) -``` - -```go -package main - -import ( - "fmt" - "strings" - "net/http" - "io/ioutil" -) - -func main() { - - url := "https://api.netbird.io/api/agent-network/providers/{providerId}" - method := "GET" - - client := &http.Client { - } - req, err := http.NewRequest(method, url, nil) - - if err != nil { - fmt.Println(err) - return - } - - - req.Header.Add("Accept", "application/json") - req.Header.Add("Authorization", "Token ") - - res, err := client.Do(req) - if err != nil { - fmt.Println(err) - return - } - defer res.Body.Close() - - body, err := ioutil.ReadAll(res.Body) - if err != nil { - fmt.Println(err) - return - } - fmt.Println(string(body)) -} -``` - -```ruby -require "uri" -require "json" -require "net/http" - -url = URI("https://api.netbird.io/api/agent-network/providers/{providerId}") - -https = Net::HTTP.new(url.host, url.port) -https.use_ssl = true - -request = Net::HTTP::Get.new(url) -request["Accept"] = "application/json" -request["Authorization"] = "Token " - -response = https.request(request) -puts response.read_body -``` - -```java -OkHttpClient client = new OkHttpClient().newBuilder() - .build(); - -Request request = new Request.Builder() - .url("https://api.netbird.io/api/agent-network/providers/{providerId}") - .method("GET") - .addHeader("Accept", "application/json") - .addHeader("Authorization: Token ") - .build(); -Response response = client.newCall(request).execute(); -``` - -```php - 'https://api.netbird.io/api/agent-network/providers/{providerId}', - CURLOPT_RETURNTRANSFER => true, - CURLOPT_ENCODING => '', - CURLOPT_MAXREDIRS => 10, - CURLOPT_TIMEOUT => 0, - CURLOPT_FOLLOWLOCATION => true, - CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, - CURLOPT_CUSTOMREQUEST => 'GET', - CURLOPT_HTTPHEADER => array( - 'Accept: application/json', - 'Authorization: Token ' - ), -)); - -$response = curl_exec($curl); - -curl_close($curl); -echo $response; -``` - - - - - -```json {{ title: 'Example' }} -{ - "id": "ainp_d1m3kebd9pcs0c1pnu7g", - "provider_id": "openai_api", - "name": "OpenAI API", - "upstream_url": "https://api.openai.com", - "models": [ - { - "id": "gpt-4o-mini", - "input_per_1k": 0.00015, - "output_per_1k": 0.0006 - } - ], - "extra_values": { - "x-portkey-config": "pc-prod-3f2a" - }, - "identity_header_user_id": "x-bf-dim-netbird_user_id", - "identity_header_groups": "x-bf-dim-netbird_groups", - "enabled": true, - "created_at": "2026-04-26T10:30:00Z", - "updated_at": "2026-04-26T10:30:00Z" -} -``` -```json {{ title: 'Schema' }} -{ - "id": "string", - "provider_id": "string", - "name": "string", - "upstream_url": "string", - "models": [ - { - "id": "string", - "input_per_1k": "number", - "output_per_1k": "number" - } - ], - "extra_values": { - "type": "object", - "description": "Operator-typed values for catalog-declared extra headers. Keys are wire header names (e.g. `x-portkey-config`); values are the strings the proxy stamps on every upstream request to this provider. Catalog (AgentNetworkCatalogProvider.extra_headers) declares which keys are accepted; values not declared by the catalog are ignored at synth time. Empty / missing values mean no header stamped.\n", - "additionalProperties": "string", - "example": { - "x-portkey-config": "pc-prod-3f2a" - } - }, - "identity_header_user_id": "string", - "identity_header_groups": "string", - "enabled": "boolean", - "created_at": "string", - "updated_at": "string" -} -``` - - - - - - ---- - - -## Update an Agent Network Provider {{ tag: 'PUT' , label: '/api/agent-network/providers/{providerId}' }} - - - - Update an existing Agent Network AI provider. - - ### Path Parameters - - - - The unique identifier of an Agent Network provider - - - - ### Request-Body Parameters - - - - Catalog identifier for the upstream AI provider (e.g. openai_api, anthropic_api, azure_openai_api, bedrock_api, vertex_ai_api, mistral_api, custom). - - - - - Display name for the provider. - - - - - Full upstream URL (with scheme) that NetBird forwards traffic to. - - - - - Proxy cluster used to bootstrap the per-account agent-network endpoint when the first provider is created. Ignored on subsequent creates and on updates because the cluster is pinned on the account-level Settings row. - - - - - Upstream provider API key. Sealed at rest on the management server and never returned in responses. Required on create; optional on update (omit to keep the existing key). - - - - -
- Models exposed through this endpoint, with the operator's per-1k input/output prices. Empty means all catalog models are allowed at catalog prices. - - - - - Model identifier (e.g. "gpt-4o-mini"). - - - - - Cost per 1k input tokens, in USD. - - - - - Cost per 1k output tokens, in USD. - - - - - -
- -
- - - Operator-typed values for catalog-declared extra headers (see AgentNetworkProvider.extra_values). When present on a request, the whole map replaces the stored values. Empty strings drop the corresponding key. - - - - - - Wire header name for the caller's display identity. See AgentNetworkProvider.identity_header_user_id. When omitted on a request, the stored value is left unchanged; pass an empty string explicitly to clear it (which disables stamping for this dimension). - - - - - - Wire header name for the caller's groups CSV. See AgentNetworkProvider.identity_header_groups. Same omit / empty semantics as `identity_header_user_id`. - - - - - - Whether the provider is enabled. Defaults to true on create. - - -
- - - - - - -```bash {{ title: 'cURL' }} -curl -X PUT https://api.netbird.io/api/agent-network/providers/{providerId} \ --H 'Accept: application/json' \ --H 'Content-Type: application/json' \ --H 'Authorization: Token ' \ ---data-raw '{ - "provider_id": "openai_api", - "name": "OpenAI API", - "upstream_url": "https://api.openai.com", - "bootstrap_cluster": "eu.proxy.netbird.io", - "api_key": "sk-...", - "models": [ - { - "id": "gpt-4o-mini", - "input_per_1k": 0.00015, - "output_per_1k": 0.0006 - } - ], - "extra_values": { - "x-portkey-config": "pc-prod-3f2a" - }, - "identity_header_user_id": "x-bf-dim-netbird_user_id", - "identity_header_groups": "x-bf-dim-netbird_groups", - "enabled": true -}' -``` - -```js -const axios = require('axios'); -let data = JSON.stringify({ - "provider_id": "openai_api", - "name": "OpenAI API", - "upstream_url": "https://api.openai.com", - "bootstrap_cluster": "eu.proxy.netbird.io", - "api_key": "sk-...", - "models": [ - { - "id": "gpt-4o-mini", - "input_per_1k": 0.00015, - "output_per_1k": 0.0006 - } - ], - "extra_values": { - "x-portkey-config": "pc-prod-3f2a" - }, - "identity_header_user_id": "x-bf-dim-netbird_user_id", - "identity_header_groups": "x-bf-dim-netbird_groups", - "enabled": true -}); -let config = { - method: 'put', - maxBodyLength: Infinity, - url: '/api/agent-network/providers/{providerId}', - headers: { - 'Accept': 'application/json', - 'Content-Type': 'application/json', - 'Authorization': 'Token ' - }, - data : data -}; - -axios(config) -.then((response) => { - console.log(JSON.stringify(response.data)); -}) -.catch((error) => { - console.log(error); -}); -``` - -```python -import requests -import json - -url = "https://api.netbird.io/api/agent-network/providers/{providerId}" -payload = json.dumps({ - "provider_id": "openai_api", - "name": "OpenAI API", - "upstream_url": "https://api.openai.com", - "bootstrap_cluster": "eu.proxy.netbird.io", - "api_key": "sk-...", - "models": [ - { - "id": "gpt-4o-mini", - "input_per_1k": 0.00015, - "output_per_1k": 0.0006 - } - ], - "extra_values": { - "x-portkey-config": "pc-prod-3f2a" - }, - "identity_header_user_id": "x-bf-dim-netbird_user_id", - "identity_header_groups": "x-bf-dim-netbird_groups", - "enabled": true -}) -headers = { - 'Content-Type': 'application/json', - 'Accept': 'application/json', - 'Authorization': 'Token ' -} - -response = requests.request("PUT", url, headers=headers, data=payload) - -print(response.text) -``` - -```go -package main - -import ( - "fmt" - "strings" - "net/http" - "io/ioutil" -) - -func main() { - - url := "https://api.netbird.io/api/agent-network/providers/{providerId}" - method := "PUT" - - payload := strings.NewReader(`{ - "provider_id": "openai_api", - "name": "OpenAI API", - "upstream_url": "https://api.openai.com", - "bootstrap_cluster": "eu.proxy.netbird.io", - "api_key": "sk-...", - "models": [ - { - "id": "gpt-4o-mini", - "input_per_1k": 0.00015, - "output_per_1k": 0.0006 - } - ], - "extra_values": { - "x-portkey-config": "pc-prod-3f2a" - }, - "identity_header_user_id": "x-bf-dim-netbird_user_id", - "identity_header_groups": "x-bf-dim-netbird_groups", - "enabled": true -}`) - client := &http.Client { - } - req, err := http.NewRequest(method, url, payload) - - if err != nil { - fmt.Println(err) - return - } - - - req.Header.Add("Content-Type", "application/json") - req.Header.Add("Accept", "application/json") - req.Header.Add("Authorization", "Token ") - - res, err := client.Do(req) - if err != nil { - fmt.Println(err) - return - } - defer res.Body.Close() - - body, err := ioutil.ReadAll(res.Body) - if err != nil { - fmt.Println(err) - return - } - fmt.Println(string(body)) -} -``` - -```ruby -require "uri" -require "json" -require "net/http" - -url = URI("https://api.netbird.io/api/agent-network/providers/{providerId}") - -https = Net::HTTP.new(url.host, url.port) -https.use_ssl = true - -request = Net::HTTP::Put.new(url) -request["Content-Type"] = "application/json" -request["Accept"] = "application/json" -request["Authorization"] = "Token " - -request.body = JSON.dump({ - "provider_id": "openai_api", - "name": "OpenAI API", - "upstream_url": "https://api.openai.com", - "bootstrap_cluster": "eu.proxy.netbird.io", - "api_key": "sk-...", - "models": [ - { - "id": "gpt-4o-mini", - "input_per_1k": 0.00015, - "output_per_1k": 0.0006 - } - ], - "extra_values": { - "x-portkey-config": "pc-prod-3f2a" - }, - "identity_header_user_id": "x-bf-dim-netbird_user_id", - "identity_header_groups": "x-bf-dim-netbird_groups", - "enabled": true -}) -response = https.request(request) -puts response.read_body -``` - -```java -OkHttpClient client = new OkHttpClient().newBuilder() - .build(); -MediaType mediaType = MediaType.parse("application/json"); -RequestBody body = RequestBody.create(mediaType, '{ - "provider_id": "openai_api", - "name": "OpenAI API", - "upstream_url": "https://api.openai.com", - "bootstrap_cluster": "eu.proxy.netbird.io", - "api_key": "sk-...", - "models": [ - { - "id": "gpt-4o-mini", - "input_per_1k": 0.00015, - "output_per_1k": 0.0006 - } - ], - "extra_values": { - "x-portkey-config": "pc-prod-3f2a" - }, - "identity_header_user_id": "x-bf-dim-netbird_user_id", - "identity_header_groups": "x-bf-dim-netbird_groups", - "enabled": true -}'); -Request request = new Request.Builder() - .url("https://api.netbird.io/api/agent-network/providers/{providerId}") - .method("PUT", body) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json") - .addHeader("Authorization: Token ") - .build(); -Response response = client.newCall(request).execute(); -``` - -```php - 'https://api.netbird.io/api/agent-network/providers/{providerId}', - CURLOPT_RETURNTRANSFER => true, - CURLOPT_ENCODING => '', - CURLOPT_MAXREDIRS => 10, - CURLOPT_TIMEOUT => 0, - CURLOPT_FOLLOWLOCATION => true, - CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, - CURLOPT_CUSTOMREQUEST => 'PUT', - CURLOPT_POSTFIELDS => '{ - "provider_id": "openai_api", - "name": "OpenAI API", - "upstream_url": "https://api.openai.com", - "bootstrap_cluster": "eu.proxy.netbird.io", - "api_key": "sk-...", - "models": [ - { - "id": "gpt-4o-mini", - "input_per_1k": 0.00015, - "output_per_1k": 0.0006 - } - ], - "extra_values": { - "x-portkey-config": "pc-prod-3f2a" - }, - "identity_header_user_id": "x-bf-dim-netbird_user_id", - "identity_header_groups": "x-bf-dim-netbird_groups", - "enabled": true -}', - CURLOPT_HTTPHEADER => array( - 'Content-Type: application/json', - 'Accept: application/json', - 'Authorization: Token ' - ), -)); - -$response = curl_exec($curl); - -curl_close($curl); -echo $response; -``` - - - - - -```json {{ title: 'Example' }} -{ - "id": "ainp_d1m3kebd9pcs0c1pnu7g", - "provider_id": "openai_api", - "name": "OpenAI API", - "upstream_url": "https://api.openai.com", - "models": [ - { - "id": "gpt-4o-mini", - "input_per_1k": 0.00015, - "output_per_1k": 0.0006 - } - ], - "extra_values": { - "x-portkey-config": "pc-prod-3f2a" - }, - "identity_header_user_id": "x-bf-dim-netbird_user_id", - "identity_header_groups": "x-bf-dim-netbird_groups", - "enabled": true, - "created_at": "2026-04-26T10:30:00Z", - "updated_at": "2026-04-26T10:30:00Z" -} -``` -```json {{ title: 'Schema' }} -{ - "id": "string", - "provider_id": "string", - "name": "string", - "upstream_url": "string", - "models": [ - { - "id": "string", - "input_per_1k": "number", - "output_per_1k": "number" - } - ], - "extra_values": { - "type": "object", - "description": "Operator-typed values for catalog-declared extra headers. Keys are wire header names (e.g. `x-portkey-config`); values are the strings the proxy stamps on every upstream request to this provider. Catalog (AgentNetworkCatalogProvider.extra_headers) declares which keys are accepted; values not declared by the catalog are ignored at synth time. Empty / missing values mean no header stamped.\n", - "additionalProperties": "string", - "example": { - "x-portkey-config": "pc-prod-3f2a" - } - }, - "identity_header_user_id": "string", - "identity_header_groups": "string", - "enabled": "boolean", - "created_at": "string", - "updated_at": "string" -} -``` - - - - -
- ---- - - -## Delete an Agent Network Provider {{ tag: 'DELETE' , label: '/api/agent-network/providers/{providerId}' }} - - - - Delete an existing Agent Network AI provider. - - ### Path Parameters - - - - The unique identifier of an Agent Network provider - - - - - - -```bash {{ title: 'cURL' }} -curl -X DELETE https://api.netbird.io/api/agent-network/providers/{providerId} \ --H 'Authorization: Token ' -``` - -```js -const axios = require('axios'); - -let config = { - method: 'delete', - maxBodyLength: Infinity, - url: '/api/agent-network/providers/{providerId}', - headers: { - 'Authorization': 'Token ' - } -}; - -axios(config) -.then((response) => { - console.log(JSON.stringify(response.data)); -}) -.catch((error) => { - console.log(error); -}); -``` - -```python -import requests -import json - -url = "https://api.netbird.io/api/agent-network/providers/{providerId}" - -headers = { - 'Authorization': 'Token ' -} - -response = requests.request("DELETE", url, headers=headers) - -print(response.text) -``` - -```go -package main - -import ( - "fmt" - "strings" - "net/http" - "io/ioutil" -) - -func main() { - - url := "https://api.netbird.io/api/agent-network/providers/{providerId}" - method := "DELETE" - - client := &http.Client { - } - req, err := http.NewRequest(method, url, nil) - - if err != nil { - fmt.Println(err) - return - } - - - req.Header.Add("Authorization", "Token ") - - res, err := client.Do(req) - if err != nil { - fmt.Println(err) - return - } - defer res.Body.Close() - - body, err := ioutil.ReadAll(res.Body) - if err != nil { - fmt.Println(err) - return - } - fmt.Println(string(body)) -} -``` - -```ruby -require "uri" -require "json" -require "net/http" - -url = URI("https://api.netbird.io/api/agent-network/providers/{providerId}") - -https = Net::HTTP.new(url.host, url.port) -https.use_ssl = true - -request = Net::HTTP::Delete.new(url) -request["Authorization"] = "Token " - -response = https.request(request) -puts response.read_body -``` - -```java -OkHttpClient client = new OkHttpClient().newBuilder() - .build(); - -Request request = new Request.Builder() - .url("https://api.netbird.io/api/agent-network/providers/{providerId}") - .method("DELETE") - .addHeader("Authorization: Token ") - .build(); -Response response = client.newCall(request).execute(); -``` - -```php - 'https://api.netbird.io/api/agent-network/providers/{providerId}', - CURLOPT_RETURNTRANSFER => true, - CURLOPT_ENCODING => '', - CURLOPT_MAXREDIRS => 10, - CURLOPT_TIMEOUT => 0, - CURLOPT_FOLLOWLOCATION => true, - CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, - CURLOPT_CUSTOMREQUEST => 'DELETE', - CURLOPT_HTTPHEADER => array( - 'Authorization: Token ' - ), -)); - -$response = curl_exec($curl); - -curl_close($curl); -echo $response; -``` - - - - - - - - ---- - - -## List all Agent Network Policies {{ tag: 'GET' , label: '/api/agent-network/policies' }} - - - - Returns a list of all Agent Network policies for the account. - - - - -```bash {{ title: 'cURL' }} -curl -X GET https://api.netbird.io/api/agent-network/policies \ --H 'Accept: application/json' \ --H 'Authorization: Token ' -``` - -```js -const axios = require('axios'); - -let config = { - method: 'get', - maxBodyLength: Infinity, - url: '/api/agent-network/policies', - headers: { - 'Accept': 'application/json', - 'Authorization': 'Token ' - } -}; - -axios(config) -.then((response) => { - console.log(JSON.stringify(response.data)); -}) -.catch((error) => { - console.log(error); -}); -``` - -```python -import requests -import json - -url = "https://api.netbird.io/api/agent-network/policies" - -headers = { - 'Accept': 'application/json', - 'Authorization': 'Token ' -} - -response = requests.request("GET", url, headers=headers) - -print(response.text) -``` - -```go -package main - -import ( - "fmt" - "strings" - "net/http" - "io/ioutil" -) - -func main() { - - url := "https://api.netbird.io/api/agent-network/policies" - method := "GET" - - client := &http.Client { - } - req, err := http.NewRequest(method, url, nil) - - if err != nil { - fmt.Println(err) - return - } - - - req.Header.Add("Accept", "application/json") - req.Header.Add("Authorization", "Token ") - - res, err := client.Do(req) - if err != nil { - fmt.Println(err) - return - } - defer res.Body.Close() - - body, err := ioutil.ReadAll(res.Body) - if err != nil { - fmt.Println(err) - return - } - fmt.Println(string(body)) -} -``` - -```ruby -require "uri" -require "json" -require "net/http" - -url = URI("https://api.netbird.io/api/agent-network/policies") - -https = Net::HTTP.new(url.host, url.port) -https.use_ssl = true - -request = Net::HTTP::Get.new(url) -request["Accept"] = "application/json" -request["Authorization"] = "Token " - -response = https.request(request) -puts response.read_body -``` - -```java -OkHttpClient client = new OkHttpClient().newBuilder() - .build(); - -Request request = new Request.Builder() - .url("https://api.netbird.io/api/agent-network/policies") - .method("GET") - .addHeader("Accept", "application/json") - .addHeader("Authorization: Token ") - .build(); -Response response = client.newCall(request).execute(); -``` - -```php - 'https://api.netbird.io/api/agent-network/policies', - CURLOPT_RETURNTRANSFER => true, - CURLOPT_ENCODING => '', - CURLOPT_MAXREDIRS => 10, - CURLOPT_TIMEOUT => 0, - CURLOPT_FOLLOWLOCATION => true, - CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, - CURLOPT_CUSTOMREQUEST => 'GET', - CURLOPT_HTTPHEADER => array( - 'Accept: application/json', - 'Authorization: Token ' - ), -)); - -$response = curl_exec($curl); - -curl_close($curl); -echo $response; -``` - - - - - -```json {{ title: 'Example' }} -[ - { - "id": "ainpol_d1m3kebd9pcs0c1pnu7g", - "name": "Engineering → OpenAI", - "description": "Engineers can call OpenAI under production guardrails.", - "enabled": true, - "source_groups": [ - "ch8vp3o6lnna9hg0sd8g" - ], - "destination_provider_ids": [ - "ainp_d1m3kebd9pcs0c1pnu7g" - ], - "guardrail_ids": [], - "limits": { - "token_limit": { - "enabled": true, - "group_cap": 10000000, - "user_cap": 1000000, - "window_seconds": 2592000 - }, - "budget_limit": { - "enabled": true, - "group_cap_usd": 1000, - "user_cap_usd": 100, - "window_seconds": 2592000 - } - }, - "created_at": "2026-04-26T10:30:00Z", - "updated_at": "2026-04-26T10:30:00Z" - } -] -``` -```json {{ title: 'Schema' }} -[ - { - "id": "string", - "name": "string", - "description": "string", - "enabled": "boolean", - "source_groups": [ - "string" - ], - "destination_provider_ids": [ - "string" - ], - "guardrail_ids": [ - "string" - ], - "limits": { - "token_limit": { - "enabled": "boolean", - "group_cap": "integer", - "user_cap": "integer", - "window_seconds": "integer" - }, - "budget_limit": { - "enabled": "boolean", - "group_cap_usd": "number", - "user_cap_usd": "number", - "window_seconds": "integer" - } - }, - "created_at": "string", - "updated_at": "string" - } -] -``` - - - - - - ---- - - -## Create an Agent Network Policy {{ tag: 'POST' , label: '/api/agent-network/policies' }} - - - - Creates a new Agent Network policy binding source groups to destination providers, optionally enforced by guardrails. - - ### Request-Body Parameters - - - - Display name for the policy. - - - - - Optional human-readable description. - - - - - Whether the policy is enabled. Defaults to true on create. - - - - - NetBird group ids whose members are allowed to call the destination providers. - - - - - Agent Network provider ids the source groups can reach. - - - - - Agent Network guardrail ids to attach to this policy. - - - - -
- Token and budget caps attached directly to the policy. These compose with any guardrail-level checks. - - - - -
- Per-policy token cap. `group_cap` is applied to each source group independently — every group in the policy's `source_groups` gets its own bucket of this size. `user_cap` is applied independently to each individual user. Caps reset to zero at the start of each window. - - - - - - - - - - Tokens allowed per source group within the window (each group has its own bucket of this size). 0 means uncapped. - - - - - Tokens allowed per individual user within the window. 0 means uncapped. - - - - - Reset frequency in seconds. The cap counter resets to zero at the start of each window. Minimum 60 (one minute) when the limit is enabled. - - - - - -
- -
- - -
- Per-policy USD spend cap. `group_cap_usd` is applied to each source group independently — every group in the policy's `source_groups` gets its own bucket of this size. `user_cap_usd` is applied independently to each individual user. Caps reset to zero at the start of each window. - - - - - - - - - - USD allowed per source group within the window (each group has its own bucket of this size). 0 means uncapped. - - - - - USD allowed per individual user within the window. 0 means uncapped. - - - - - Reset frequency in seconds. Caps reset at the start of each window. Minimum 60 (one minute) when the limit is enabled. - - - - - -
- -
-
- -
-
- -
-
- - - - - - -```bash {{ title: 'cURL' }} -curl -X POST https://api.netbird.io/api/agent-network/policies \ --H 'Accept: application/json' \ --H 'Content-Type: application/json' \ --H 'Authorization: Token ' \ ---data-raw '{ - "name": "Engineering → OpenAI", - "description": "Engineers can call OpenAI under production guardrails.", - "enabled": true, - "source_groups": [ - "ch8vp3o6lnna9hg0sd8g" - ], - "destination_provider_ids": [ - "ainp_d1m3kebd9pcs0c1pnu7g" - ], - "guardrail_ids": [], - "limits": { - "token_limit": { - "enabled": true, - "group_cap": 10000000, - "user_cap": 1000000, - "window_seconds": 2592000 - }, - "budget_limit": { - "enabled": true, - "group_cap_usd": 1000, - "user_cap_usd": 100, - "window_seconds": 2592000 - } - } -}' -``` - -```js -const axios = require('axios'); -let data = JSON.stringify({ - "name": "Engineering → OpenAI", - "description": "Engineers can call OpenAI under production guardrails.", - "enabled": true, - "source_groups": [ - "ch8vp3o6lnna9hg0sd8g" - ], - "destination_provider_ids": [ - "ainp_d1m3kebd9pcs0c1pnu7g" - ], - "guardrail_ids": [], - "limits": { - "token_limit": { - "enabled": true, - "group_cap": 10000000, - "user_cap": 1000000, - "window_seconds": 2592000 - }, - "budget_limit": { - "enabled": true, - "group_cap_usd": 1000, - "user_cap_usd": 100, - "window_seconds": 2592000 - } - } -}); -let config = { - method: 'post', - maxBodyLength: Infinity, - url: '/api/agent-network/policies', - headers: { - 'Accept': 'application/json', - 'Content-Type': 'application/json', - 'Authorization': 'Token ' - }, - data : data -}; - -axios(config) -.then((response) => { - console.log(JSON.stringify(response.data)); -}) -.catch((error) => { - console.log(error); -}); -``` - -```python -import requests -import json - -url = "https://api.netbird.io/api/agent-network/policies" -payload = json.dumps({ - "name": "Engineering → OpenAI", - "description": "Engineers can call OpenAI under production guardrails.", - "enabled": true, - "source_groups": [ - "ch8vp3o6lnna9hg0sd8g" - ], - "destination_provider_ids": [ - "ainp_d1m3kebd9pcs0c1pnu7g" - ], - "guardrail_ids": [], - "limits": { - "token_limit": { - "enabled": true, - "group_cap": 10000000, - "user_cap": 1000000, - "window_seconds": 2592000 - }, - "budget_limit": { - "enabled": true, - "group_cap_usd": 1000, - "user_cap_usd": 100, - "window_seconds": 2592000 - } - } -}) -headers = { - 'Content-Type': 'application/json', - 'Accept': 'application/json', - 'Authorization': 'Token ' -} - -response = requests.request("POST", url, headers=headers, data=payload) - -print(response.text) -``` - -```go -package main - -import ( - "fmt" - "strings" - "net/http" - "io/ioutil" -) - -func main() { - - url := "https://api.netbird.io/api/agent-network/policies" - method := "POST" - - payload := strings.NewReader(`{ - "name": "Engineering → OpenAI", - "description": "Engineers can call OpenAI under production guardrails.", - "enabled": true, - "source_groups": [ - "ch8vp3o6lnna9hg0sd8g" - ], - "destination_provider_ids": [ - "ainp_d1m3kebd9pcs0c1pnu7g" - ], - "guardrail_ids": [], - "limits": { - "token_limit": { - "enabled": true, - "group_cap": 10000000, - "user_cap": 1000000, - "window_seconds": 2592000 - }, - "budget_limit": { - "enabled": true, - "group_cap_usd": 1000, - "user_cap_usd": 100, - "window_seconds": 2592000 - } - } -}`) - client := &http.Client { - } - req, err := http.NewRequest(method, url, payload) - - if err != nil { - fmt.Println(err) - return - } - - - req.Header.Add("Content-Type", "application/json") - req.Header.Add("Accept", "application/json") - req.Header.Add("Authorization", "Token ") - - res, err := client.Do(req) - if err != nil { - fmt.Println(err) - return - } - defer res.Body.Close() - - body, err := ioutil.ReadAll(res.Body) - if err != nil { - fmt.Println(err) - return - } - fmt.Println(string(body)) -} -``` - -```ruby -require "uri" -require "json" -require "net/http" - -url = URI("https://api.netbird.io/api/agent-network/policies") - -https = Net::HTTP.new(url.host, url.port) -https.use_ssl = true - -request = Net::HTTP::Post.new(url) -request["Content-Type"] = "application/json" -request["Accept"] = "application/json" -request["Authorization"] = "Token " - -request.body = JSON.dump({ - "name": "Engineering → OpenAI", - "description": "Engineers can call OpenAI under production guardrails.", - "enabled": true, - "source_groups": [ - "ch8vp3o6lnna9hg0sd8g" - ], - "destination_provider_ids": [ - "ainp_d1m3kebd9pcs0c1pnu7g" - ], - "guardrail_ids": [], - "limits": { - "token_limit": { - "enabled": true, - "group_cap": 10000000, - "user_cap": 1000000, - "window_seconds": 2592000 - }, - "budget_limit": { - "enabled": true, - "group_cap_usd": 1000, - "user_cap_usd": 100, - "window_seconds": 2592000 - } - } -}) -response = https.request(request) -puts response.read_body -``` - -```java -OkHttpClient client = new OkHttpClient().newBuilder() - .build(); -MediaType mediaType = MediaType.parse("application/json"); -RequestBody body = RequestBody.create(mediaType, '{ - "name": "Engineering → OpenAI", - "description": "Engineers can call OpenAI under production guardrails.", - "enabled": true, - "source_groups": [ - "ch8vp3o6lnna9hg0sd8g" - ], - "destination_provider_ids": [ - "ainp_d1m3kebd9pcs0c1pnu7g" - ], - "guardrail_ids": [], - "limits": { - "token_limit": { - "enabled": true, - "group_cap": 10000000, - "user_cap": 1000000, - "window_seconds": 2592000 - }, - "budget_limit": { - "enabled": true, - "group_cap_usd": 1000, - "user_cap_usd": 100, - "window_seconds": 2592000 - } - } -}'); -Request request = new Request.Builder() - .url("https://api.netbird.io/api/agent-network/policies") - .method("POST", body) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json") - .addHeader("Authorization: Token ") - .build(); -Response response = client.newCall(request).execute(); -``` - -```php - 'https://api.netbird.io/api/agent-network/policies', - CURLOPT_RETURNTRANSFER => true, - CURLOPT_ENCODING => '', - CURLOPT_MAXREDIRS => 10, - CURLOPT_TIMEOUT => 0, - CURLOPT_FOLLOWLOCATION => true, - CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, - CURLOPT_CUSTOMREQUEST => 'POST', - CURLOPT_POSTFIELDS => '{ - "name": "Engineering → OpenAI", - "description": "Engineers can call OpenAI under production guardrails.", - "enabled": true, - "source_groups": [ - "ch8vp3o6lnna9hg0sd8g" - ], - "destination_provider_ids": [ - "ainp_d1m3kebd9pcs0c1pnu7g" - ], - "guardrail_ids": [], - "limits": { - "token_limit": { - "enabled": true, - "group_cap": 10000000, - "user_cap": 1000000, - "window_seconds": 2592000 - }, - "budget_limit": { - "enabled": true, - "group_cap_usd": 1000, - "user_cap_usd": 100, - "window_seconds": 2592000 - } - } -}', - CURLOPT_HTTPHEADER => array( - 'Content-Type: application/json', - 'Accept: application/json', - 'Authorization: Token ' - ), -)); - -$response = curl_exec($curl); - -curl_close($curl); -echo $response; -``` - - - - - -```json {{ title: 'Example' }} -{ - "id": "ainpol_d1m3kebd9pcs0c1pnu7g", - "name": "Engineering → OpenAI", - "description": "Engineers can call OpenAI under production guardrails.", - "enabled": true, - "source_groups": [ - "ch8vp3o6lnna9hg0sd8g" - ], - "destination_provider_ids": [ - "ainp_d1m3kebd9pcs0c1pnu7g" - ], - "guardrail_ids": [], - "limits": { - "token_limit": { - "enabled": true, - "group_cap": 10000000, - "user_cap": 1000000, - "window_seconds": 2592000 - }, - "budget_limit": { - "enabled": true, - "group_cap_usd": 1000, - "user_cap_usd": 100, - "window_seconds": 2592000 - } - }, - "created_at": "2026-04-26T10:30:00Z", - "updated_at": "2026-04-26T10:30:00Z" -} -``` -```json {{ title: 'Schema' }} -{ - "id": "string", - "name": "string", - "description": "string", - "enabled": "boolean", - "source_groups": [ - "string" - ], - "destination_provider_ids": [ - "string" - ], - "guardrail_ids": [ - "string" - ], - "limits": { - "token_limit": { - "enabled": "boolean", - "group_cap": "integer", - "user_cap": "integer", - "window_seconds": "integer" - }, - "budget_limit": { - "enabled": "boolean", - "group_cap_usd": "number", - "user_cap_usd": "number", - "window_seconds": "integer" - } - }, - "created_at": "string", - "updated_at": "string" -} -``` - - - - -
- ---- - - -## Retrieve an Agent Network Policy {{ tag: 'GET' , label: '/api/agent-network/policies/{policyId}' }} - - - - Get information about a specific Agent Network policy. - - ### Path Parameters - - - - The unique identifier of an Agent Network policy - - - - - - -```bash {{ title: 'cURL' }} -curl -X GET https://api.netbird.io/api/agent-network/policies/{policyId} \ --H 'Accept: application/json' \ --H 'Authorization: Token ' -``` - -```js -const axios = require('axios'); - -let config = { - method: 'get', - maxBodyLength: Infinity, - url: '/api/agent-network/policies/{policyId}', - headers: { - 'Accept': 'application/json', - 'Authorization': 'Token ' - } -}; - -axios(config) -.then((response) => { - console.log(JSON.stringify(response.data)); -}) -.catch((error) => { - console.log(error); -}); -``` - -```python -import requests -import json - -url = "https://api.netbird.io/api/agent-network/policies/{policyId}" - -headers = { - 'Accept': 'application/json', - 'Authorization': 'Token ' -} - -response = requests.request("GET", url, headers=headers) - -print(response.text) -``` - -```go -package main - -import ( - "fmt" - "strings" - "net/http" - "io/ioutil" -) - -func main() { - - url := "https://api.netbird.io/api/agent-network/policies/{policyId}" - method := "GET" - - client := &http.Client { - } - req, err := http.NewRequest(method, url, nil) - - if err != nil { - fmt.Println(err) - return - } - - - req.Header.Add("Accept", "application/json") - req.Header.Add("Authorization", "Token ") - - res, err := client.Do(req) - if err != nil { - fmt.Println(err) - return - } - defer res.Body.Close() - - body, err := ioutil.ReadAll(res.Body) - if err != nil { - fmt.Println(err) - return - } - fmt.Println(string(body)) -} -``` - -```ruby -require "uri" -require "json" -require "net/http" - -url = URI("https://api.netbird.io/api/agent-network/policies/{policyId}") - -https = Net::HTTP.new(url.host, url.port) -https.use_ssl = true - -request = Net::HTTP::Get.new(url) -request["Accept"] = "application/json" -request["Authorization"] = "Token " - -response = https.request(request) -puts response.read_body -``` - -```java -OkHttpClient client = new OkHttpClient().newBuilder() - .build(); - -Request request = new Request.Builder() - .url("https://api.netbird.io/api/agent-network/policies/{policyId}") - .method("GET") - .addHeader("Accept", "application/json") - .addHeader("Authorization: Token ") - .build(); -Response response = client.newCall(request).execute(); -``` - -```php - 'https://api.netbird.io/api/agent-network/policies/{policyId}', - CURLOPT_RETURNTRANSFER => true, - CURLOPT_ENCODING => '', - CURLOPT_MAXREDIRS => 10, - CURLOPT_TIMEOUT => 0, - CURLOPT_FOLLOWLOCATION => true, - CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, - CURLOPT_CUSTOMREQUEST => 'GET', - CURLOPT_HTTPHEADER => array( - 'Accept: application/json', - 'Authorization: Token ' - ), -)); - -$response = curl_exec($curl); - -curl_close($curl); -echo $response; -``` - - - - - -```json {{ title: 'Example' }} -{ - "id": "ainpol_d1m3kebd9pcs0c1pnu7g", - "name": "Engineering → OpenAI", - "description": "Engineers can call OpenAI under production guardrails.", - "enabled": true, - "source_groups": [ - "ch8vp3o6lnna9hg0sd8g" - ], - "destination_provider_ids": [ - "ainp_d1m3kebd9pcs0c1pnu7g" - ], - "guardrail_ids": [], - "limits": { - "token_limit": { - "enabled": true, - "group_cap": 10000000, - "user_cap": 1000000, - "window_seconds": 2592000 - }, - "budget_limit": { - "enabled": true, - "group_cap_usd": 1000, - "user_cap_usd": 100, - "window_seconds": 2592000 - } - }, - "created_at": "2026-04-26T10:30:00Z", - "updated_at": "2026-04-26T10:30:00Z" -} -``` -```json {{ title: 'Schema' }} -{ - "id": "string", - "name": "string", - "description": "string", - "enabled": "boolean", - "source_groups": [ - "string" - ], - "destination_provider_ids": [ - "string" - ], - "guardrail_ids": [ - "string" - ], - "limits": { - "token_limit": { - "enabled": "boolean", - "group_cap": "integer", - "user_cap": "integer", - "window_seconds": "integer" - }, - "budget_limit": { - "enabled": "boolean", - "group_cap_usd": "number", - "user_cap_usd": "number", - "window_seconds": "integer" - } - }, - "created_at": "string", - "updated_at": "string" -} -``` - - - - - - ---- - - -## Update an Agent Network Policy {{ tag: 'PUT' , label: '/api/agent-network/policies/{policyId}' }} - - - - Update an existing Agent Network policy. - - ### Path Parameters - - - - The unique identifier of an Agent Network policy - - - - ### Request-Body Parameters - - - - Display name for the policy. - - - - - Optional human-readable description. - - - - - Whether the policy is enabled. Defaults to true on create. - - - - - NetBird group ids whose members are allowed to call the destination providers. - - - - - Agent Network provider ids the source groups can reach. - - - - - Agent Network guardrail ids to attach to this policy. - - - - -
- Token and budget caps attached directly to the policy. These compose with any guardrail-level checks. - - - - -
- Per-policy token cap. `group_cap` is applied to each source group independently — every group in the policy's `source_groups` gets its own bucket of this size. `user_cap` is applied independently to each individual user. Caps reset to zero at the start of each window. - - - - - - - - - - Tokens allowed per source group within the window (each group has its own bucket of this size). 0 means uncapped. - - - - - Tokens allowed per individual user within the window. 0 means uncapped. - - - - - Reset frequency in seconds. The cap counter resets to zero at the start of each window. Minimum 60 (one minute) when the limit is enabled. - - - - - -
- -
- - -
- Per-policy USD spend cap. `group_cap_usd` is applied to each source group independently — every group in the policy's `source_groups` gets its own bucket of this size. `user_cap_usd` is applied independently to each individual user. Caps reset to zero at the start of each window. - - - - - - - - - - USD allowed per source group within the window (each group has its own bucket of this size). 0 means uncapped. - - - - - USD allowed per individual user within the window. 0 means uncapped. - - - - - Reset frequency in seconds. Caps reset at the start of each window. Minimum 60 (one minute) when the limit is enabled. - - - - - -
- -
-
- -
-
- -
-
- - - - - - -```bash {{ title: 'cURL' }} -curl -X PUT https://api.netbird.io/api/agent-network/policies/{policyId} \ --H 'Accept: application/json' \ --H 'Content-Type: application/json' \ --H 'Authorization: Token ' \ ---data-raw '{ - "name": "Engineering → OpenAI", - "description": "Engineers can call OpenAI under production guardrails.", - "enabled": true, - "source_groups": [ - "ch8vp3o6lnna9hg0sd8g" - ], - "destination_provider_ids": [ - "ainp_d1m3kebd9pcs0c1pnu7g" - ], - "guardrail_ids": [], - "limits": { - "token_limit": { - "enabled": true, - "group_cap": 10000000, - "user_cap": 1000000, - "window_seconds": 2592000 - }, - "budget_limit": { - "enabled": true, - "group_cap_usd": 1000, - "user_cap_usd": 100, - "window_seconds": 2592000 - } - } -}' -``` - -```js -const axios = require('axios'); -let data = JSON.stringify({ - "name": "Engineering → OpenAI", - "description": "Engineers can call OpenAI under production guardrails.", - "enabled": true, - "source_groups": [ - "ch8vp3o6lnna9hg0sd8g" - ], - "destination_provider_ids": [ - "ainp_d1m3kebd9pcs0c1pnu7g" - ], - "guardrail_ids": [], - "limits": { - "token_limit": { - "enabled": true, - "group_cap": 10000000, - "user_cap": 1000000, - "window_seconds": 2592000 - }, - "budget_limit": { - "enabled": true, - "group_cap_usd": 1000, - "user_cap_usd": 100, - "window_seconds": 2592000 - } - } -}); -let config = { - method: 'put', - maxBodyLength: Infinity, - url: '/api/agent-network/policies/{policyId}', - headers: { - 'Accept': 'application/json', - 'Content-Type': 'application/json', - 'Authorization': 'Token ' - }, - data : data -}; - -axios(config) -.then((response) => { - console.log(JSON.stringify(response.data)); -}) -.catch((error) => { - console.log(error); -}); -``` - -```python -import requests -import json - -url = "https://api.netbird.io/api/agent-network/policies/{policyId}" -payload = json.dumps({ - "name": "Engineering → OpenAI", - "description": "Engineers can call OpenAI under production guardrails.", - "enabled": true, - "source_groups": [ - "ch8vp3o6lnna9hg0sd8g" - ], - "destination_provider_ids": [ - "ainp_d1m3kebd9pcs0c1pnu7g" - ], - "guardrail_ids": [], - "limits": { - "token_limit": { - "enabled": true, - "group_cap": 10000000, - "user_cap": 1000000, - "window_seconds": 2592000 - }, - "budget_limit": { - "enabled": true, - "group_cap_usd": 1000, - "user_cap_usd": 100, - "window_seconds": 2592000 - } - } -}) -headers = { - 'Content-Type': 'application/json', - 'Accept': 'application/json', - 'Authorization': 'Token ' -} - -response = requests.request("PUT", url, headers=headers, data=payload) - -print(response.text) -``` - -```go -package main - -import ( - "fmt" - "strings" - "net/http" - "io/ioutil" -) - -func main() { - - url := "https://api.netbird.io/api/agent-network/policies/{policyId}" - method := "PUT" - - payload := strings.NewReader(`{ - "name": "Engineering → OpenAI", - "description": "Engineers can call OpenAI under production guardrails.", - "enabled": true, - "source_groups": [ - "ch8vp3o6lnna9hg0sd8g" - ], - "destination_provider_ids": [ - "ainp_d1m3kebd9pcs0c1pnu7g" - ], - "guardrail_ids": [], - "limits": { - "token_limit": { - "enabled": true, - "group_cap": 10000000, - "user_cap": 1000000, - "window_seconds": 2592000 - }, - "budget_limit": { - "enabled": true, - "group_cap_usd": 1000, - "user_cap_usd": 100, - "window_seconds": 2592000 - } - } -}`) - client := &http.Client { - } - req, err := http.NewRequest(method, url, payload) - - if err != nil { - fmt.Println(err) - return - } - - - req.Header.Add("Content-Type", "application/json") - req.Header.Add("Accept", "application/json") - req.Header.Add("Authorization", "Token ") - - res, err := client.Do(req) - if err != nil { - fmt.Println(err) - return - } - defer res.Body.Close() - - body, err := ioutil.ReadAll(res.Body) - if err != nil { - fmt.Println(err) - return - } - fmt.Println(string(body)) -} -``` - -```ruby -require "uri" -require "json" -require "net/http" - -url = URI("https://api.netbird.io/api/agent-network/policies/{policyId}") - -https = Net::HTTP.new(url.host, url.port) -https.use_ssl = true - -request = Net::HTTP::Put.new(url) -request["Content-Type"] = "application/json" -request["Accept"] = "application/json" -request["Authorization"] = "Token " - -request.body = JSON.dump({ - "name": "Engineering → OpenAI", - "description": "Engineers can call OpenAI under production guardrails.", - "enabled": true, - "source_groups": [ - "ch8vp3o6lnna9hg0sd8g" - ], - "destination_provider_ids": [ - "ainp_d1m3kebd9pcs0c1pnu7g" - ], - "guardrail_ids": [], - "limits": { - "token_limit": { - "enabled": true, - "group_cap": 10000000, - "user_cap": 1000000, - "window_seconds": 2592000 - }, - "budget_limit": { - "enabled": true, - "group_cap_usd": 1000, - "user_cap_usd": 100, - "window_seconds": 2592000 - } - } -}) -response = https.request(request) -puts response.read_body -``` - -```java -OkHttpClient client = new OkHttpClient().newBuilder() - .build(); -MediaType mediaType = MediaType.parse("application/json"); -RequestBody body = RequestBody.create(mediaType, '{ - "name": "Engineering → OpenAI", - "description": "Engineers can call OpenAI under production guardrails.", - "enabled": true, - "source_groups": [ - "ch8vp3o6lnna9hg0sd8g" - ], - "destination_provider_ids": [ - "ainp_d1m3kebd9pcs0c1pnu7g" - ], - "guardrail_ids": [], - "limits": { - "token_limit": { - "enabled": true, - "group_cap": 10000000, - "user_cap": 1000000, - "window_seconds": 2592000 - }, - "budget_limit": { - "enabled": true, - "group_cap_usd": 1000, - "user_cap_usd": 100, - "window_seconds": 2592000 - } - } -}'); -Request request = new Request.Builder() - .url("https://api.netbird.io/api/agent-network/policies/{policyId}") - .method("PUT", body) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json") - .addHeader("Authorization: Token ") - .build(); -Response response = client.newCall(request).execute(); -``` - -```php - 'https://api.netbird.io/api/agent-network/policies/{policyId}', - CURLOPT_RETURNTRANSFER => true, - CURLOPT_ENCODING => '', - CURLOPT_MAXREDIRS => 10, - CURLOPT_TIMEOUT => 0, - CURLOPT_FOLLOWLOCATION => true, - CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, - CURLOPT_CUSTOMREQUEST => 'PUT', - CURLOPT_POSTFIELDS => '{ - "name": "Engineering → OpenAI", - "description": "Engineers can call OpenAI under production guardrails.", - "enabled": true, - "source_groups": [ - "ch8vp3o6lnna9hg0sd8g" - ], - "destination_provider_ids": [ - "ainp_d1m3kebd9pcs0c1pnu7g" - ], - "guardrail_ids": [], - "limits": { - "token_limit": { - "enabled": true, - "group_cap": 10000000, - "user_cap": 1000000, - "window_seconds": 2592000 - }, - "budget_limit": { - "enabled": true, - "group_cap_usd": 1000, - "user_cap_usd": 100, - "window_seconds": 2592000 - } - } -}', - CURLOPT_HTTPHEADER => array( - 'Content-Type: application/json', - 'Accept: application/json', - 'Authorization: Token ' - ), -)); - -$response = curl_exec($curl); - -curl_close($curl); -echo $response; -``` - - - - - -```json {{ title: 'Example' }} -{ - "id": "ainpol_d1m3kebd9pcs0c1pnu7g", - "name": "Engineering → OpenAI", - "description": "Engineers can call OpenAI under production guardrails.", - "enabled": true, - "source_groups": [ - "ch8vp3o6lnna9hg0sd8g" - ], - "destination_provider_ids": [ - "ainp_d1m3kebd9pcs0c1pnu7g" - ], - "guardrail_ids": [], - "limits": { - "token_limit": { - "enabled": true, - "group_cap": 10000000, - "user_cap": 1000000, - "window_seconds": 2592000 - }, - "budget_limit": { - "enabled": true, - "group_cap_usd": 1000, - "user_cap_usd": 100, - "window_seconds": 2592000 - } - }, - "created_at": "2026-04-26T10:30:00Z", - "updated_at": "2026-04-26T10:30:00Z" -} -``` -```json {{ title: 'Schema' }} -{ - "id": "string", - "name": "string", - "description": "string", - "enabled": "boolean", - "source_groups": [ - "string" - ], - "destination_provider_ids": [ - "string" - ], - "guardrail_ids": [ - "string" - ], - "limits": { - "token_limit": { - "enabled": "boolean", - "group_cap": "integer", - "user_cap": "integer", - "window_seconds": "integer" - }, - "budget_limit": { - "enabled": "boolean", - "group_cap_usd": "number", - "user_cap_usd": "number", - "window_seconds": "integer" - } - }, - "created_at": "string", - "updated_at": "string" -} -``` - - - - -
- ---- - - -## Delete an Agent Network Policy {{ tag: 'DELETE' , label: '/api/agent-network/policies/{policyId}' }} - - - - Delete an existing Agent Network policy. - - ### Path Parameters - - - - The unique identifier of an Agent Network policy - - - - - - -```bash {{ title: 'cURL' }} -curl -X DELETE https://api.netbird.io/api/agent-network/policies/{policyId} \ --H 'Authorization: Token ' -``` - -```js -const axios = require('axios'); - -let config = { - method: 'delete', - maxBodyLength: Infinity, - url: '/api/agent-network/policies/{policyId}', - headers: { - 'Authorization': 'Token ' - } -}; - -axios(config) -.then((response) => { - console.log(JSON.stringify(response.data)); -}) -.catch((error) => { - console.log(error); -}); -``` - -```python -import requests -import json - -url = "https://api.netbird.io/api/agent-network/policies/{policyId}" - -headers = { - 'Authorization': 'Token ' -} - -response = requests.request("DELETE", url, headers=headers) - -print(response.text) -``` - -```go -package main - -import ( - "fmt" - "strings" - "net/http" - "io/ioutil" -) - -func main() { - - url := "https://api.netbird.io/api/agent-network/policies/{policyId}" - method := "DELETE" - - client := &http.Client { - } - req, err := http.NewRequest(method, url, nil) - - if err != nil { - fmt.Println(err) - return - } - - - req.Header.Add("Authorization", "Token ") - - res, err := client.Do(req) - if err != nil { - fmt.Println(err) - return - } - defer res.Body.Close() - - body, err := ioutil.ReadAll(res.Body) - if err != nil { - fmt.Println(err) - return - } - fmt.Println(string(body)) -} -``` - -```ruby -require "uri" -require "json" -require "net/http" - -url = URI("https://api.netbird.io/api/agent-network/policies/{policyId}") - -https = Net::HTTP.new(url.host, url.port) -https.use_ssl = true - -request = Net::HTTP::Delete.new(url) -request["Authorization"] = "Token " - -response = https.request(request) -puts response.read_body -``` - -```java -OkHttpClient client = new OkHttpClient().newBuilder() - .build(); - -Request request = new Request.Builder() - .url("https://api.netbird.io/api/agent-network/policies/{policyId}") - .method("DELETE") - .addHeader("Authorization: Token ") - .build(); -Response response = client.newCall(request).execute(); -``` - -```php - 'https://api.netbird.io/api/agent-network/policies/{policyId}', - CURLOPT_RETURNTRANSFER => true, - CURLOPT_ENCODING => '', - CURLOPT_MAXREDIRS => 10, - CURLOPT_TIMEOUT => 0, - CURLOPT_FOLLOWLOCATION => true, - CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, - CURLOPT_CUSTOMREQUEST => 'DELETE', - CURLOPT_HTTPHEADER => array( - 'Authorization: Token ' - ), -)); - -$response = curl_exec($curl); - -curl_close($curl); -echo $response; -``` - - - - - - - - ---- - - -## List all Agent Network Guardrails {{ tag: 'GET' , label: '/api/agent-network/guardrails' }} - - - - Returns a list of all Agent Network guardrails for the account. - - - - -```bash {{ title: 'cURL' }} -curl -X GET https://api.netbird.io/api/agent-network/guardrails \ --H 'Accept: application/json' \ --H 'Authorization: Token ' -``` - -```js -const axios = require('axios'); - -let config = { - method: 'get', - maxBodyLength: Infinity, - url: '/api/agent-network/guardrails', - headers: { - 'Accept': 'application/json', - 'Authorization': 'Token ' - } -}; - -axios(config) -.then((response) => { - console.log(JSON.stringify(response.data)); -}) -.catch((error) => { - console.log(error); -}); -``` - -```python -import requests -import json - -url = "https://api.netbird.io/api/agent-network/guardrails" - -headers = { - 'Accept': 'application/json', - 'Authorization': 'Token ' -} - -response = requests.request("GET", url, headers=headers) - -print(response.text) -``` - -```go -package main - -import ( - "fmt" - "strings" - "net/http" - "io/ioutil" -) - -func main() { - - url := "https://api.netbird.io/api/agent-network/guardrails" - method := "GET" - - client := &http.Client { - } - req, err := http.NewRequest(method, url, nil) - - if err != nil { - fmt.Println(err) - return - } - - - req.Header.Add("Accept", "application/json") - req.Header.Add("Authorization", "Token ") - - res, err := client.Do(req) - if err != nil { - fmt.Println(err) - return - } - defer res.Body.Close() - - body, err := ioutil.ReadAll(res.Body) - if err != nil { - fmt.Println(err) - return - } - fmt.Println(string(body)) -} -``` - -```ruby -require "uri" -require "json" -require "net/http" - -url = URI("https://api.netbird.io/api/agent-network/guardrails") - -https = Net::HTTP.new(url.host, url.port) -https.use_ssl = true - -request = Net::HTTP::Get.new(url) -request["Accept"] = "application/json" -request["Authorization"] = "Token " - -response = https.request(request) -puts response.read_body -``` - -```java -OkHttpClient client = new OkHttpClient().newBuilder() - .build(); - -Request request = new Request.Builder() - .url("https://api.netbird.io/api/agent-network/guardrails") - .method("GET") - .addHeader("Accept", "application/json") - .addHeader("Authorization: Token ") - .build(); -Response response = client.newCall(request).execute(); -``` - -```php - 'https://api.netbird.io/api/agent-network/guardrails', - CURLOPT_RETURNTRANSFER => true, - CURLOPT_ENCODING => '', - CURLOPT_MAXREDIRS => 10, - CURLOPT_TIMEOUT => 0, - CURLOPT_FOLLOWLOCATION => true, - CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, - CURLOPT_CUSTOMREQUEST => 'GET', - CURLOPT_HTTPHEADER => array( - 'Accept: application/json', - 'Authorization: Token ' - ), -)); - -$response = curl_exec($curl); - -curl_close($curl); -echo $response; -``` - - - - - -```json {{ title: 'Example' }} -[ - { - "id": "ainguard_d1m3kebd9pcs0c1pnu7g", - "name": "Strict — Production", - "description": "Tight model allowlist, PII redaction, hard monthly budget.", - "checks": { - "model_allowlist": { - "enabled": true, - "models": [ - "gpt-4o-mini", - "claude-haiku-4-5" - ] - }, - "prompt_capture": { - "enabled": true, - "redact_pii": true - } - }, - "created_at": "2026-04-26T10:30:00Z", - "updated_at": "2026-04-26T10:30:00Z" - } -] -``` -```json {{ title: 'Schema' }} -[ - { - "id": "string", - "name": "string", - "description": "string", - "checks": { - "model_allowlist": { - "enabled": "boolean", - "models": [ - "string" - ] - }, - "prompt_capture": { - "enabled": "boolean", - "redact_pii": "boolean" - } - }, - "created_at": "string", - "updated_at": "string" - } -] -``` - - - - - - ---- - - -## Create an Agent Network Guardrail {{ tag: 'POST' , label: '/api/agent-network/guardrails' }} - - - - Creates a new Agent Network guardrail that can be attached to one or more policies. - - ### Request-Body Parameters - - - - Display name for the guardrail. - - - - - Optional human-readable description. - - - - -
- Guardrail check parameters. Each entry has an `enabled` flag plus per-check configuration; disabled entries are inert. - - - - -
- More Information - - - - - - - - - - Allowed catalog model ids. Requests for any other model are denied. - - - - - -
- -
- - -
- More Information - - - - - - - - - - - - - - - -
- -
-
- -
-
- -
-
- - - - - - -```bash {{ title: 'cURL' }} -curl -X POST https://api.netbird.io/api/agent-network/guardrails \ --H 'Accept: application/json' \ --H 'Content-Type: application/json' \ --H 'Authorization: Token ' \ ---data-raw '{ - "name": "Strict — Production", - "description": "Tight model allowlist, PII redaction, hard monthly budget.", - "checks": { - "model_allowlist": { - "enabled": true, - "models": [ - "gpt-4o-mini", - "claude-haiku-4-5" - ] - }, - "prompt_capture": { - "enabled": true, - "redact_pii": true - } - } -}' -``` - -```js -const axios = require('axios'); -let data = JSON.stringify({ - "name": "Strict — Production", - "description": "Tight model allowlist, PII redaction, hard monthly budget.", - "checks": { - "model_allowlist": { - "enabled": true, - "models": [ - "gpt-4o-mini", - "claude-haiku-4-5" - ] - }, - "prompt_capture": { - "enabled": true, - "redact_pii": true - } - } -}); -let config = { - method: 'post', - maxBodyLength: Infinity, - url: '/api/agent-network/guardrails', - headers: { - 'Accept': 'application/json', - 'Content-Type': 'application/json', - 'Authorization': 'Token ' - }, - data : data -}; - -axios(config) -.then((response) => { - console.log(JSON.stringify(response.data)); -}) -.catch((error) => { - console.log(error); -}); -``` - -```python -import requests -import json - -url = "https://api.netbird.io/api/agent-network/guardrails" -payload = json.dumps({ - "name": "Strict — Production", - "description": "Tight model allowlist, PII redaction, hard monthly budget.", - "checks": { - "model_allowlist": { - "enabled": true, - "models": [ - "gpt-4o-mini", - "claude-haiku-4-5" - ] - }, - "prompt_capture": { - "enabled": true, - "redact_pii": true - } - } -}) -headers = { - 'Content-Type': 'application/json', - 'Accept': 'application/json', - 'Authorization': 'Token ' -} - -response = requests.request("POST", url, headers=headers, data=payload) - -print(response.text) -``` - -```go -package main - -import ( - "fmt" - "strings" - "net/http" - "io/ioutil" -) - -func main() { - - url := "https://api.netbird.io/api/agent-network/guardrails" - method := "POST" - - payload := strings.NewReader(`{ - "name": "Strict — Production", - "description": "Tight model allowlist, PII redaction, hard monthly budget.", - "checks": { - "model_allowlist": { - "enabled": true, - "models": [ - "gpt-4o-mini", - "claude-haiku-4-5" - ] - }, - "prompt_capture": { - "enabled": true, - "redact_pii": true - } - } -}`) - client := &http.Client { - } - req, err := http.NewRequest(method, url, payload) - - if err != nil { - fmt.Println(err) - return - } - - - req.Header.Add("Content-Type", "application/json") - req.Header.Add("Accept", "application/json") - req.Header.Add("Authorization", "Token ") - - res, err := client.Do(req) - if err != nil { - fmt.Println(err) - return - } - defer res.Body.Close() - - body, err := ioutil.ReadAll(res.Body) - if err != nil { - fmt.Println(err) - return - } - fmt.Println(string(body)) -} -``` - -```ruby -require "uri" -require "json" -require "net/http" - -url = URI("https://api.netbird.io/api/agent-network/guardrails") - -https = Net::HTTP.new(url.host, url.port) -https.use_ssl = true - -request = Net::HTTP::Post.new(url) -request["Content-Type"] = "application/json" -request["Accept"] = "application/json" -request["Authorization"] = "Token " - -request.body = JSON.dump({ - "name": "Strict — Production", - "description": "Tight model allowlist, PII redaction, hard monthly budget.", - "checks": { - "model_allowlist": { - "enabled": true, - "models": [ - "gpt-4o-mini", - "claude-haiku-4-5" - ] - }, - "prompt_capture": { - "enabled": true, - "redact_pii": true - } - } -}) -response = https.request(request) -puts response.read_body -``` - -```java -OkHttpClient client = new OkHttpClient().newBuilder() - .build(); -MediaType mediaType = MediaType.parse("application/json"); -RequestBody body = RequestBody.create(mediaType, '{ - "name": "Strict — Production", - "description": "Tight model allowlist, PII redaction, hard monthly budget.", - "checks": { - "model_allowlist": { - "enabled": true, - "models": [ - "gpt-4o-mini", - "claude-haiku-4-5" - ] - }, - "prompt_capture": { - "enabled": true, - "redact_pii": true - } - } -}'); -Request request = new Request.Builder() - .url("https://api.netbird.io/api/agent-network/guardrails") - .method("POST", body) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json") - .addHeader("Authorization: Token ") - .build(); -Response response = client.newCall(request).execute(); -``` - -```php - 'https://api.netbird.io/api/agent-network/guardrails', - CURLOPT_RETURNTRANSFER => true, - CURLOPT_ENCODING => '', - CURLOPT_MAXREDIRS => 10, - CURLOPT_TIMEOUT => 0, - CURLOPT_FOLLOWLOCATION => true, - CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, - CURLOPT_CUSTOMREQUEST => 'POST', - CURLOPT_POSTFIELDS => '{ - "name": "Strict — Production", - "description": "Tight model allowlist, PII redaction, hard monthly budget.", - "checks": { - "model_allowlist": { - "enabled": true, - "models": [ - "gpt-4o-mini", - "claude-haiku-4-5" - ] - }, - "prompt_capture": { - "enabled": true, - "redact_pii": true - } - } -}', - CURLOPT_HTTPHEADER => array( - 'Content-Type: application/json', - 'Accept: application/json', - 'Authorization: Token ' - ), -)); - -$response = curl_exec($curl); - -curl_close($curl); -echo $response; -``` - - - - - -```json {{ title: 'Example' }} -{ - "id": "ainguard_d1m3kebd9pcs0c1pnu7g", - "name": "Strict — Production", - "description": "Tight model allowlist, PII redaction, hard monthly budget.", - "checks": { - "model_allowlist": { - "enabled": true, - "models": [ - "gpt-4o-mini", - "claude-haiku-4-5" - ] - }, - "prompt_capture": { - "enabled": true, - "redact_pii": true - } - }, - "created_at": "2026-04-26T10:30:00Z", - "updated_at": "2026-04-26T10:30:00Z" -} -``` -```json {{ title: 'Schema' }} -{ - "id": "string", - "name": "string", - "description": "string", - "checks": { - "model_allowlist": { - "enabled": "boolean", - "models": [ - "string" - ] - }, - "prompt_capture": { - "enabled": "boolean", - "redact_pii": "boolean" - } - }, - "created_at": "string", - "updated_at": "string" -} -``` - - - - -
- ---- - - -## Retrieve an Agent Network Guardrail {{ tag: 'GET' , label: '/api/agent-network/guardrails/{guardrailId}' }} - - - - Get information about a specific Agent Network guardrail. - - ### Path Parameters - - - - The unique identifier of an Agent Network guardrail - - - - - - -```bash {{ title: 'cURL' }} -curl -X GET https://api.netbird.io/api/agent-network/guardrails/{guardrailId} \ --H 'Accept: application/json' \ --H 'Authorization: Token ' -``` - -```js -const axios = require('axios'); - -let config = { - method: 'get', - maxBodyLength: Infinity, - url: '/api/agent-network/guardrails/{guardrailId}', - headers: { - 'Accept': 'application/json', - 'Authorization': 'Token ' - } -}; - -axios(config) -.then((response) => { - console.log(JSON.stringify(response.data)); -}) -.catch((error) => { - console.log(error); -}); -``` - -```python -import requests -import json - -url = "https://api.netbird.io/api/agent-network/guardrails/{guardrailId}" - -headers = { - 'Accept': 'application/json', - 'Authorization': 'Token ' -} - -response = requests.request("GET", url, headers=headers) - -print(response.text) -``` - -```go -package main - -import ( - "fmt" - "strings" - "net/http" - "io/ioutil" -) - -func main() { - - url := "https://api.netbird.io/api/agent-network/guardrails/{guardrailId}" - method := "GET" - - client := &http.Client { - } - req, err := http.NewRequest(method, url, nil) - - if err != nil { - fmt.Println(err) - return - } - - - req.Header.Add("Accept", "application/json") - req.Header.Add("Authorization", "Token ") - - res, err := client.Do(req) - if err != nil { - fmt.Println(err) - return - } - defer res.Body.Close() - - body, err := ioutil.ReadAll(res.Body) - if err != nil { - fmt.Println(err) - return - } - fmt.Println(string(body)) -} -``` - -```ruby -require "uri" -require "json" -require "net/http" - -url = URI("https://api.netbird.io/api/agent-network/guardrails/{guardrailId}") - -https = Net::HTTP.new(url.host, url.port) -https.use_ssl = true - -request = Net::HTTP::Get.new(url) -request["Accept"] = "application/json" -request["Authorization"] = "Token " - -response = https.request(request) -puts response.read_body -``` - -```java -OkHttpClient client = new OkHttpClient().newBuilder() - .build(); - -Request request = new Request.Builder() - .url("https://api.netbird.io/api/agent-network/guardrails/{guardrailId}") - .method("GET") - .addHeader("Accept", "application/json") - .addHeader("Authorization: Token ") - .build(); -Response response = client.newCall(request).execute(); -``` - -```php - 'https://api.netbird.io/api/agent-network/guardrails/{guardrailId}', - CURLOPT_RETURNTRANSFER => true, - CURLOPT_ENCODING => '', - CURLOPT_MAXREDIRS => 10, - CURLOPT_TIMEOUT => 0, - CURLOPT_FOLLOWLOCATION => true, - CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, - CURLOPT_CUSTOMREQUEST => 'GET', - CURLOPT_HTTPHEADER => array( - 'Accept: application/json', - 'Authorization: Token ' - ), -)); - -$response = curl_exec($curl); - -curl_close($curl); -echo $response; -``` - - - - - -```json {{ title: 'Example' }} -{ - "id": "ainguard_d1m3kebd9pcs0c1pnu7g", - "name": "Strict — Production", - "description": "Tight model allowlist, PII redaction, hard monthly budget.", - "checks": { - "model_allowlist": { - "enabled": true, - "models": [ - "gpt-4o-mini", - "claude-haiku-4-5" - ] - }, - "prompt_capture": { - "enabled": true, - "redact_pii": true - } - }, - "created_at": "2026-04-26T10:30:00Z", - "updated_at": "2026-04-26T10:30:00Z" -} -``` -```json {{ title: 'Schema' }} -{ - "id": "string", - "name": "string", - "description": "string", - "checks": { - "model_allowlist": { - "enabled": "boolean", - "models": [ - "string" - ] - }, - "prompt_capture": { - "enabled": "boolean", - "redact_pii": "boolean" - } - }, - "created_at": "string", - "updated_at": "string" -} -``` - - - - - - ---- - - -## Update an Agent Network Guardrail {{ tag: 'PUT' , label: '/api/agent-network/guardrails/{guardrailId}' }} - - - - Update an existing Agent Network guardrail. - - ### Path Parameters - - - - The unique identifier of an Agent Network guardrail - - - - ### Request-Body Parameters - - - - Display name for the guardrail. - - - - - Optional human-readable description. - - - - -
- Guardrail check parameters. Each entry has an `enabled` flag plus per-check configuration; disabled entries are inert. - - - - -
- More Information - - - - - - - - - - Allowed catalog model ids. Requests for any other model are denied. - - - - - -
- -
- - -
- More Information - - - - - - - - - - - - - - - -
- -
-
- -
-
- -
-
- - - - - - -```bash {{ title: 'cURL' }} -curl -X PUT https://api.netbird.io/api/agent-network/guardrails/{guardrailId} \ --H 'Accept: application/json' \ --H 'Content-Type: application/json' \ --H 'Authorization: Token ' \ ---data-raw '{ - "name": "Strict — Production", - "description": "Tight model allowlist, PII redaction, hard monthly budget.", - "checks": { - "model_allowlist": { - "enabled": true, - "models": [ - "gpt-4o-mini", - "claude-haiku-4-5" - ] - }, - "prompt_capture": { - "enabled": true, - "redact_pii": true - } - } -}' -``` - -```js -const axios = require('axios'); -let data = JSON.stringify({ - "name": "Strict — Production", - "description": "Tight model allowlist, PII redaction, hard monthly budget.", - "checks": { - "model_allowlist": { - "enabled": true, - "models": [ - "gpt-4o-mini", - "claude-haiku-4-5" - ] - }, - "prompt_capture": { - "enabled": true, - "redact_pii": true - } - } -}); -let config = { - method: 'put', - maxBodyLength: Infinity, - url: '/api/agent-network/guardrails/{guardrailId}', - headers: { - 'Accept': 'application/json', - 'Content-Type': 'application/json', - 'Authorization': 'Token ' - }, - data : data -}; - -axios(config) -.then((response) => { - console.log(JSON.stringify(response.data)); -}) -.catch((error) => { - console.log(error); -}); -``` - -```python -import requests -import json - -url = "https://api.netbird.io/api/agent-network/guardrails/{guardrailId}" -payload = json.dumps({ - "name": "Strict — Production", - "description": "Tight model allowlist, PII redaction, hard monthly budget.", - "checks": { - "model_allowlist": { - "enabled": true, - "models": [ - "gpt-4o-mini", - "claude-haiku-4-5" - ] - }, - "prompt_capture": { - "enabled": true, - "redact_pii": true - } - } -}) -headers = { - 'Content-Type': 'application/json', - 'Accept': 'application/json', - 'Authorization': 'Token ' -} - -response = requests.request("PUT", url, headers=headers, data=payload) - -print(response.text) -``` - -```go -package main - -import ( - "fmt" - "strings" - "net/http" - "io/ioutil" -) - -func main() { - - url := "https://api.netbird.io/api/agent-network/guardrails/{guardrailId}" - method := "PUT" - - payload := strings.NewReader(`{ - "name": "Strict — Production", - "description": "Tight model allowlist, PII redaction, hard monthly budget.", - "checks": { - "model_allowlist": { - "enabled": true, - "models": [ - "gpt-4o-mini", - "claude-haiku-4-5" - ] - }, - "prompt_capture": { - "enabled": true, - "redact_pii": true - } - } -}`) - client := &http.Client { - } - req, err := http.NewRequest(method, url, payload) - - if err != nil { - fmt.Println(err) - return - } - - - req.Header.Add("Content-Type", "application/json") - req.Header.Add("Accept", "application/json") - req.Header.Add("Authorization", "Token ") - - res, err := client.Do(req) - if err != nil { - fmt.Println(err) - return - } - defer res.Body.Close() - - body, err := ioutil.ReadAll(res.Body) - if err != nil { - fmt.Println(err) - return - } - fmt.Println(string(body)) -} -``` - -```ruby -require "uri" -require "json" -require "net/http" - -url = URI("https://api.netbird.io/api/agent-network/guardrails/{guardrailId}") - -https = Net::HTTP.new(url.host, url.port) -https.use_ssl = true - -request = Net::HTTP::Put.new(url) -request["Content-Type"] = "application/json" -request["Accept"] = "application/json" -request["Authorization"] = "Token " - -request.body = JSON.dump({ - "name": "Strict — Production", - "description": "Tight model allowlist, PII redaction, hard monthly budget.", - "checks": { - "model_allowlist": { - "enabled": true, - "models": [ - "gpt-4o-mini", - "claude-haiku-4-5" - ] - }, - "prompt_capture": { - "enabled": true, - "redact_pii": true - } - } -}) -response = https.request(request) -puts response.read_body -``` - -```java -OkHttpClient client = new OkHttpClient().newBuilder() - .build(); -MediaType mediaType = MediaType.parse("application/json"); -RequestBody body = RequestBody.create(mediaType, '{ - "name": "Strict — Production", - "description": "Tight model allowlist, PII redaction, hard monthly budget.", - "checks": { - "model_allowlist": { - "enabled": true, - "models": [ - "gpt-4o-mini", - "claude-haiku-4-5" - ] - }, - "prompt_capture": { - "enabled": true, - "redact_pii": true - } - } -}'); -Request request = new Request.Builder() - .url("https://api.netbird.io/api/agent-network/guardrails/{guardrailId}") - .method("PUT", body) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json") - .addHeader("Authorization: Token ") - .build(); -Response response = client.newCall(request).execute(); -``` - -```php - 'https://api.netbird.io/api/agent-network/guardrails/{guardrailId}', - CURLOPT_RETURNTRANSFER => true, - CURLOPT_ENCODING => '', - CURLOPT_MAXREDIRS => 10, - CURLOPT_TIMEOUT => 0, - CURLOPT_FOLLOWLOCATION => true, - CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, - CURLOPT_CUSTOMREQUEST => 'PUT', - CURLOPT_POSTFIELDS => '{ - "name": "Strict — Production", - "description": "Tight model allowlist, PII redaction, hard monthly budget.", - "checks": { - "model_allowlist": { - "enabled": true, - "models": [ - "gpt-4o-mini", - "claude-haiku-4-5" - ] - }, - "prompt_capture": { - "enabled": true, - "redact_pii": true - } - } -}', - CURLOPT_HTTPHEADER => array( - 'Content-Type: application/json', - 'Accept: application/json', - 'Authorization: Token ' - ), -)); - -$response = curl_exec($curl); - -curl_close($curl); -echo $response; -``` - - - - - -```json {{ title: 'Example' }} -{ - "id": "ainguard_d1m3kebd9pcs0c1pnu7g", - "name": "Strict — Production", - "description": "Tight model allowlist, PII redaction, hard monthly budget.", - "checks": { - "model_allowlist": { - "enabled": true, - "models": [ - "gpt-4o-mini", - "claude-haiku-4-5" - ] - }, - "prompt_capture": { - "enabled": true, - "redact_pii": true - } - }, - "created_at": "2026-04-26T10:30:00Z", - "updated_at": "2026-04-26T10:30:00Z" -} -``` -```json {{ title: 'Schema' }} -{ - "id": "string", - "name": "string", - "description": "string", - "checks": { - "model_allowlist": { - "enabled": "boolean", - "models": [ - "string" - ] - }, - "prompt_capture": { - "enabled": "boolean", - "redact_pii": "boolean" - } - }, - "created_at": "string", - "updated_at": "string" -} -``` - - - - -
- ---- - - -## Delete an Agent Network Guardrail {{ tag: 'DELETE' , label: '/api/agent-network/guardrails/{guardrailId}' }} - - - - Delete an existing Agent Network guardrail. - - ### Path Parameters - - - - The unique identifier of an Agent Network guardrail - - - - - - -```bash {{ title: 'cURL' }} -curl -X DELETE https://api.netbird.io/api/agent-network/guardrails/{guardrailId} \ --H 'Authorization: Token ' -``` - -```js -const axios = require('axios'); - -let config = { - method: 'delete', - maxBodyLength: Infinity, - url: '/api/agent-network/guardrails/{guardrailId}', - headers: { - 'Authorization': 'Token ' - } -}; - -axios(config) -.then((response) => { - console.log(JSON.stringify(response.data)); -}) -.catch((error) => { - console.log(error); -}); -``` - -```python -import requests -import json - -url = "https://api.netbird.io/api/agent-network/guardrails/{guardrailId}" - -headers = { - 'Authorization': 'Token ' -} - -response = requests.request("DELETE", url, headers=headers) - -print(response.text) -``` - -```go -package main - -import ( - "fmt" - "strings" - "net/http" - "io/ioutil" -) - -func main() { - - url := "https://api.netbird.io/api/agent-network/guardrails/{guardrailId}" - method := "DELETE" - - client := &http.Client { - } - req, err := http.NewRequest(method, url, nil) - - if err != nil { - fmt.Println(err) - return - } - - - req.Header.Add("Authorization", "Token ") - - res, err := client.Do(req) - if err != nil { - fmt.Println(err) - return - } - defer res.Body.Close() - - body, err := ioutil.ReadAll(res.Body) - if err != nil { - fmt.Println(err) - return - } - fmt.Println(string(body)) -} -``` - -```ruby -require "uri" -require "json" -require "net/http" - -url = URI("https://api.netbird.io/api/agent-network/guardrails/{guardrailId}") - -https = Net::HTTP.new(url.host, url.port) -https.use_ssl = true - -request = Net::HTTP::Delete.new(url) -request["Authorization"] = "Token " - -response = https.request(request) -puts response.read_body -``` - -```java -OkHttpClient client = new OkHttpClient().newBuilder() - .build(); - -Request request = new Request.Builder() - .url("https://api.netbird.io/api/agent-network/guardrails/{guardrailId}") - .method("DELETE") - .addHeader("Authorization: Token ") - .build(); -Response response = client.newCall(request).execute(); -``` - -```php - 'https://api.netbird.io/api/agent-network/guardrails/{guardrailId}', - CURLOPT_RETURNTRANSFER => true, - CURLOPT_ENCODING => '', - CURLOPT_MAXREDIRS => 10, - CURLOPT_TIMEOUT => 0, - CURLOPT_FOLLOWLOCATION => true, - CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, - CURLOPT_CUSTOMREQUEST => 'DELETE', - CURLOPT_HTTPHEADER => array( - 'Authorization: Token ' - ), -)); - -$response = curl_exec($curl); - -curl_close($curl); -echo $response; -``` - - - - - - - - ----