---
title: ガードレールを更新 | RunAPI
description: 指定したガードレールフィールドを置き換え、省略したフィールドはそのまま保持する。
url: https://runapi.ai/ja/docs/api/management/guardrails/update.md
canonical: https://runapi.ai/ja/docs/api/management/guardrails/update
locale: ja
---

> HTML 版: https://runapi.ai/ja/docs/api/management/guardrails/update
> エージェント向けサイトインデックス: https://runapi.ai/llms.txt

# ガードレールを更新

指定したガードレールフィールドを置き換え、省略したフィールドはそのまま保持する。

## エンドポイント

PATCH /api/v1/guardrails/:id

ベースURL: https://runapi.ai

API バージョン: v1

認証: Authorization: Bearer YOUR_MANAGEMENT_API_KEY


Authorization: アカウント管理者の Management API キーが必要です。

## リクエスト

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

### JSON ボディ

```json
{
  "allowed_models": {
    "description": "置き換え用のモデル許可リスト。",
    "required": false,
    "type": "array | null"
  },
  "allowed_providers": {
    "description": "置き換え用のプロバイダー名許可リスト。",
    "required": false,
    "type": "array | null"
  },
  "blocked_models": {
    "description": "置き換え用のモデルブロックリスト。",
    "required": false,
    "type": "array | null"
  },
  "blocked_providers": {
    "description": "置き換え用のプロバイダー名ブロックリスト。",
    "required": false,
    "type": "array | null"
  },
  "credit_limit_cents": {
    "description": "総支出上限（USセント単位）。",
    "required": false,
    "type": "integer | null"
  },
  "credit_limit_reset_interval": {
    "description": "総支出上限のリセット周期。",
    "enum": [
      "daily",
      "weekly",
      "monthly"
    ],
    "required": false,
    "type": "string | null"
  },
  "description": {
    "description": "置き換え用の自由記述の説明。",
    "required": false,
    "type": "string"
  },
  "enabled": {
    "description": "ガードレールが適用されるかどうか。",
    "required": false,
    "type": "boolean"
  },
  "model_budgets": {
    "description": "置き換え用のモデルごとの予算ルール。",
    "required": false,
    "type": "array | null"
  },
  "name": {
    "description": "置き換え用のガードレール名。",
    "required": false,
    "type": "string"
  }
}
```

### パスパラメータ

```json
{
  "id": {
    "description": "Guardrail のプレフィックス ID（例: guardrail_abc123）。",
    "required": true,
    "type": "string"
  }
}
```

## 成功レスポンス

HTTP 200 - PATCH /api/v1/guardrails/:id

```json
{
  "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": false,
  "id": "guardrail_123",
  "model_budgets": [
    {
      "credit_limit_cents": 10000,
      "credit_limit_reset_interval": "monthly",
      "match_mode": "include",
      "models": [
        "gpt-5.4"
      ]
    }
  ],
  "name": "Production budget"
}
```

## エラーレスポンス (401)

HTTP 401

### レスポンススキーマ

```json
{
  "properties": {
    "error": {
      "description": "人が読めるエラーメッセージ。",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### レスポンス例

```json
{
  "error": "Authentication required"
}
```

## エラーレスポンス (403)

HTTP 403

### レスポンススキーマ

```json
{
  "properties": {
    "error": {
      "description": "人が読めるエラーメッセージ。",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### レスポンス例

```json
{
  "error": "Management API key required"
}
```

## エラーレスポンス (403)

HTTP 403

### レスポンススキーマ

```json
{
  "properties": {
    "error": {
      "description": "人が読めるエラーメッセージ。",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### レスポンス例

```json
{
  "error": "Account admin required"
}
```

## エラーレスポンス (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"
}
```

## エラーレスポンス (404)

HTTP 404

### レスポンススキーマ

```json
{
  "properties": {
    "error": {
      "description": "人が読めるエラーメッセージ。",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### レスポンス例

```json
{
  "error": "Resource not found"
}
```

## エラーレスポンス (422)

HTTP 422

### レスポンススキーマ

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

### レスポンス例

```json
{
  "error": "Validation failed",
  "errors": {
    "base": [
      "Validation failed"
    ]
  }
}
```

## cURLの例



### curl

```curl
curl -X PATCH https://runapi.ai/api/v1/guardrails/guardrail_123 \
  -H 'Authorization: Bearer YOUR_MANAGEMENT_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{"enabled":false}'
```

## 関連リファレンス

- [ガードレール](https://runapi.ai/ja/docs/api/management/guardrails.md)
- [Guardrail オブジェクト](https://runapi.ai/ja/docs/api/management/guardrails/object.md)

---

## RunAPI のその他の情報

- [ホーム](https://runapi.ai/ja/.md)
- [モデルカタログ](https://runapi.ai/ja/models.md)
- [料金](https://runapi.ai/ja/pricing.md)
- [プロバイダー](https://runapi.ai/ja/models)
- [ドキュメント](https://runapi.ai/ja/docs/guides)
- [SDK](https://runapi.ai/ja/sdk.md)
- [CLI](https://runapi.ai/ja/cli.md)
- [MCP Server](https://runapi.ai/ja/mcp.md)
- [Claude Code と Cursor](https://runapi.ai/ja/claude-code-vs-cursor.md)
- [Cursor API セットアップ](https://runapi.ai/ja/cursor-api-setup.md)
- [RunAPI と OpenRouter の比較](https://runapi.ai/ja/openrouter-alternative.md)
- [エンタープライズ](https://runapi.ai/ja/contact.md)
- [お問い合わせ](https://runapi.ai/ja/contact.md)
- [利用規約](https://runapi.ai/ja/terms.md)
- [プライバシー](https://runapi.ai/ja/privacy.md)
- [エージェント向けサイトインデックス](https://runapi.ai/llms.txt)

お問い合わせ: contact@runapi.ai

## 構造化データ

```json
[
  {
    "@context": "https://schema.org",
    "inLanguage": "ja",
    "@type": "WebSite",
    "name": "RunAPI",
    "url": "https://runapi.ai/ja",
    "potentialAction": {
      "@type": "SearchAction",
      "target": {
        "@type": "EntryPoint",
        "urlTemplate": "https://runapi.ai/ja/models?q={search_term_string}"
      },
      "query-input": "required name=search_term_string"
    }
  },
  {
    "@context": "https://schema.org",
    "inLanguage": "ja",
    "@type": "Organization",
    "name": "RunAPI",
    "url": "https://runapi.ai/ja",
    "logo": {
      "@type": "ImageObject",
      "url": "https://runapi.ai/jaicon.svg"
    },
    "sameAs": [
      "https://github.com/runapi-ai"
    ]
  },
  {
    "@context": "https://schema.org",
    "inLanguage": "ja",
    "@type": "TechArticle",
    "headline": "ガードレールを更新",
    "description": "指定したガードレールフィールドを置き換え、省略したフィールドはそのまま保持する。",
    "url": "https://runapi.ai/ja/docs/api/management/guardrails/update",
    "mainEntityOfPage": "https://runapi.ai/ja/docs/api/management/guardrails/update"
  }
]
```
