---
title: Guardrail 对象
url: https://runapi.ai/zh-CN/docs/api/management/guardrails/object.md
canonical: https://runapi.ai/zh-CN/docs/api/management/guardrails/object
locale: zh-CN
---

# Guardrail 对象

包含模型、提供方和支出控制的可复用策略。

## 对象字段

可复用资源对象共享的稳定字段。

### Guardrails

```json
{
  "allowed_models": {
    "description": "Allowed model identifiers.",
    "required": true,
    "type": "array"
  },
  "allowed_providers": {
    "description": "Allowed provider names.",
    "required": true,
    "type": "array"
  },
  "assignment_count": {
    "description": "Number of API keys or members assigned this guardrail.",
    "required": true,
    "type": "integer"
  },
  "blocked_models": {
    "description": "Blocked model identifiers.",
    "required": true,
    "type": "array"
  },
  "blocked_providers": {
    "description": "Blocked provider names.",
    "required": true,
    "type": "array"
  },
  "created_at": {
    "description": "Time the guardrail was created.",
    "required": true,
    "type": "string"
  },
  "credit_limit_cents": {
    "description": "Optional total spending cap in USD cents.",
    "required": true,
    "type": "integer | null"
  },
  "credit_limit_reset_interval": {
    "description": "Reset cadence for the total spending cap.",
    "enum": [
      "daily",
      "weekly",
      "monthly",
      null
    ],
    "required": true,
    "type": "string | null"
  },
  "description": {
    "description": "Optional guardrail description.",
    "required": true,
    "type": "string | null"
  },
  "enabled": {
    "description": "Whether the guardrail is enforced.",
    "required": true,
    "type": "boolean"
  },
  "id": {
    "description": "Guardrail prefix ID.",
    "required": true,
    "type": "string"
  },
  "model_budgets": {
    "description": "Per-model budget rules.",
    "required": true,
    "type": "array"
  },
  "name": {
    "description": "Guardrail name.",
    "required": true,
    "type": "string"
  }
}
```

## 相关参考

- [Guardrails](/docs/api/management/guardrails)
- [列出 Guardrails](/docs/api/management/guardrails/list)
- [获取 Guardrail](/docs/api/management/guardrails/retrieve)
- [创建 Guardrail](/docs/api/management/guardrails/create)
- [更新 Guardrail](/docs/api/management/guardrails/update)
- [删除 Guardrail](/docs/api/management/guardrails/delete)
