List workspace-wide policies
curl --request GET \
--url https://openrouter.ai/api/v1/guardrails/policies/account \
--header 'Authorization: Bearer <token>'import requests
url = "https://openrouter.ai/api/v1/guardrails/policies/account"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://openrouter.ai/api/v1/guardrails/policies/account', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://openrouter.ai/api/v1/guardrails/policies/account",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://openrouter.ai/api/v1/guardrails/policies/account"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://openrouter.ai/api/v1/guardrails/policies/account")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://openrouter.ai/api/v1/guardrails/policies/account")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": [
{
"config": {
"include_byok_in_budgets": false,
"limit_usd": 200,
"reset_interval": "monthly"
},
"created_at": "2025-08-24T10:30:00Z",
"id": "550e8400-e29b-41d4-a716-446655440000",
"is_default": true,
"is_synced": true,
"is_workspace_default_synced": true,
"name": "Engineering monthly budget",
"opted_out_workspace_ids": [
"0df9e665-d932-5740-b2c7-b52af166bc11"
],
"policy_type": "budget",
"updated_at": "<string>",
"workspace_count": 1,
"workspace_ids": [
"0df9e665-d932-5740-b2c7-b52af166bc11"
]
}
],
"total_count": 1
}{
"error": {
"code": 400,
"message": "Invalid request parameters"
}
}{
"error": {
"code": 401,
"message": "Missing Authentication header"
}
}{
"error": {
"code": 403,
"message": "Only management keys can perform this operation"
}
}{
"error": {
"code": 404,
"message": "Resource not found"
}
}{
"error": {
"code": 500,
"message": "Internal Server Error"
}
}Guardrail Policies
List workspace-wide policies
List the workspace-wide policies that apply across workspaces in the account. Management key required.
GET
/
guardrails
/
policies
/
account
List workspace-wide policies
curl --request GET \
--url https://openrouter.ai/api/v1/guardrails/policies/account \
--header 'Authorization: Bearer <token>'import requests
url = "https://openrouter.ai/api/v1/guardrails/policies/account"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://openrouter.ai/api/v1/guardrails/policies/account', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://openrouter.ai/api/v1/guardrails/policies/account",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://openrouter.ai/api/v1/guardrails/policies/account"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://openrouter.ai/api/v1/guardrails/policies/account")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://openrouter.ai/api/v1/guardrails/policies/account")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": [
{
"config": {
"include_byok_in_budgets": false,
"limit_usd": 200,
"reset_interval": "monthly"
},
"created_at": "2025-08-24T10:30:00Z",
"id": "550e8400-e29b-41d4-a716-446655440000",
"is_default": true,
"is_synced": true,
"is_workspace_default_synced": true,
"name": "Engineering monthly budget",
"opted_out_workspace_ids": [
"0df9e665-d932-5740-b2c7-b52af166bc11"
],
"policy_type": "budget",
"updated_at": "<string>",
"workspace_count": 1,
"workspace_ids": [
"0df9e665-d932-5740-b2c7-b52af166bc11"
]
}
],
"total_count": 1
}{
"error": {
"code": 400,
"message": "Invalid request parameters"
}
}{
"error": {
"code": 401,
"message": "Missing Authentication header"
}
}{
"error": {
"code": 403,
"message": "Only management keys can perform this operation"
}
}{
"error": {
"code": 404,
"message": "Resource not found"
}
}{
"error": {
"code": 500,
"message": "Internal Server Error"
}
}Authorizations
API key as bearer token in Authorization header
Query Parameters
Number of records to skip for pagination. When both offset and limit are omitted, the full list is returned
Required range:
x >= 0Example:
0
Maximum number of records to return (max 100). When both offset and limit are omitted, the full list is returned
Required range:
1 <= x <= 100Example:
50
Was this page helpful?