コンテンツへスキップ
APIリファレンス
APIリファレンス

ガードレールの一覧取得

現在のアカウントのアクティブなガードレールの一覧を取得します。

現在のアカウントのアクティブなガードレールの一覧を取得します。

エンドポイント

GET /api/v1/guardrails
ベースURL
https://runapi.ai
API バージョン
v1
認証
Authorization: Bearer YOUR_MANAGEMENT_API_KEY
Authorization
アカウント管理者の Management API キーが必要です。
02

リクエスト

JSONボディ

指定されたリクエストの場所にのみ値を送信してください。

クエリパラメータフィールド2件
limitinteger
任意

1ページあたりに返されるガードレールの最大数。

デフォルト: 20 範囲: 1 - 100
pageinteger
任意

オフセットページ番号。値は1から始まります。

デフォルト: 1 範囲(固定): 1
03

成功レスポンス

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

エラーレスポンス (401)

HTTP 401
レスポンススキーマ
JSON
{
  "properties": {
    "error": {
      "description": "人が読めるエラーメッセージ。",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}

レスポンス例

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

エラーレスポンス (403)

HTTP 403
レスポンススキーマ
JSON
{
  "properties": {
    "error": {
      "description": "人が読めるエラーメッセージ。",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}

レスポンス例

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

エラーレスポンス (403)

HTTP 403
レスポンススキーマ
JSON
{
  "properties": {
    "error": {
      "description": "人が読めるエラーメッセージ。",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}

レスポンス例

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

エラーレスポンス (400)

HTTP 400
レスポンススキーマ
JSON
{
  "oneOf": [
    {
      "properties": {
        "error": {
          "description": "人が読めるエラーメッセージ。",
          "type": "string"
        }
      },
      "required": [
        "error"
      ],
      "type": "object",
      "unevaluatedProperties": false
    },
    {
      "properties": {
        "error": {
          "description": "人間が読める形式のバリデーションサマリー。",
          "type": "string"
        },
        "errors": {
          "additionalProperties": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "description": "公開リクエストフィールドをキーとするバリデーションメッセージ。各フィールドに対して人間が読める文字列の配列が含まれます。",
          "type": "object"
        }
      },
      "required": [
        "error",
        "errors"
      ],
      "type": "object",
      "unevaluatedProperties": false
    }
  ]
}

レスポンス例

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

cURLの例

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