İçeriğe geç
API Referansı
API Referansı

Koruyucuları listele

Mevcut hesaptaki etkin koruyucuları listeler.

Mevcut hesaptaki etkin koruyucuları listeler.

Uç Nokta

GET /api/v1/guardrails
Temel URL
https://runapi.ai
API sürümü
v1
Kimlik doğrulama
Authorization: Bearer YOUR_MANAGEMENT_API_KEY
Yetkilendirme
Hesap yöneticisi Yönetim API anahtarı gerektirir.
02

İstek

JSON gövdesi

Değerleri yalnızca listelenen istek konumunda gönderin.

Sorgu parametreleri2 alan
limitinteger
İsteğe bağlı

Sayfa başına döndürülen maksimum Koruyucu sayısı.

Varsayılan: 20 Aralık: 1 - 100
pageinteger
İsteğe bağlı

Offset sayfa numarası. Değerler 1'den başlar.

Varsayılan: 1 Sınır: 1
03

Başarılı yanıt

HTTP 200

GET /api/v1/guardrails

JSON
{
  "guardrails": [
    {
      "allowed_models": [
        "gpt-5.4"
      ],
      "allowed_providers": [],
      "assignment_count": 1,
      "blocked_models": [],
      "blocked_providers": [],
      "created_at": "2026-07-27T10:00:00.000Z",
      "credit_limit_cents": 50000,
      "credit_limit_reset_interval": "monthly",
      "description": "Production policy",
      "enabled": true,
      "id": "guardrail_123",
      "model_budgets": [
        {
          "credit_limit_cents": 10000,
          "credit_limit_reset_interval": "monthly",
          "match_mode": "include",
          "models": [
            "gpt-5.4"
          ]
        }
      ],
      "name": "Production budget"
    }
  ],
  "pagination": {
    "limit": 20,
    "page": 1,
    "pages": 1,
    "total": 1
  }
}
04

Hata yanıtı (401)

HTTP 401
Yanıt şeması
JSON
{
  "properties": {
    "error": {
      "description": "İnsan tarafından okunabilir hata mesajı.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}

Yanıt örneği

JSON
{
  "error": "Authentication required"
}
05

Hata yanıtı (403)

HTTP 403
Yanıt şeması
JSON
{
  "properties": {
    "error": {
      "description": "İnsan tarafından okunabilir hata mesajı.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}

Yanıt örneği

JSON
{
  "error": "Management API key required"
}
06

Hata yanıtı (403)

HTTP 403
Yanıt şeması
JSON
{
  "properties": {
    "error": {
      "description": "İnsan tarafından okunabilir hata mesajı.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}

Yanıt örneği

JSON
{
  "error": "Account admin required"
}
07

Hata yanıtı (400)

HTTP 400
Yanıt şeması
JSON
{
  "oneOf": [
    {
      "properties": {
        "error": {
          "description": "İnsan tarafından okunabilir hata mesajı.",
          "type": "string"
        }
      },
      "required": [
        "error"
      ],
      "type": "object",
      "unevaluatedProperties": false
    },
    {
      "properties": {
        "error": {
          "description": "İnsan tarafından okunabilir doğrulama özeti.",
          "type": "string"
        },
        "errors": {
          "additionalProperties": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "description": "Herkese açık istek alanına göre anahtarlanan doğrulama mesajları; her alan için insan tarafından okunabilir dizelerden oluşan bir dizi içerir.",
          "type": "object"
        }
      },
      "required": [
        "error",
        "errors"
      ],
      "type": "object",
      "unevaluatedProperties": false
    }
  ]
}

Yanıt örneği

JSON
{
  "error": "page must be an integer"
}
08

cURL örneği

CURL
curl -X GET https://runapi.ai/api/v1/guardrails?page=1&limit=20 \
  -H 'Authorization: Bearer YOUR_MANAGEMENT_API_KEY'