본문으로 건너뛰기
API 레퍼런스
API 레퍼런스

가드레일 할당 만들기

가드레일을 표준 API 키, 계정 멤버 또는 공유 태그 예산에 할당합니다.

가드레일을 표준 API 키, 계정 멤버 또는 공유 태그 예산에 할당합니다.

엔드포인트

POST /api/v1/guardrail_assignments
Base URL
https://runapi.ai
API 버전
v1
인증
Authorization: Bearer YOUR_MANAGEMENT_API_KEY
Authorization
계정 관리자는 적격한 모든 대상을 할당할 수 있습니다. 관리자가 아닌 사용자는 자신의 표준 API 키만 할당할 수 있습니다.
02

요청

JSON 본문

나열된 요청 위치에만 값을 전송하세요.

JSON 본문필드 4개
account_user_idstring
선택

계정 구성원 접두사 ID. 이 대상을 지정하려면 계정 관리자 권한이 필요합니다.

api_token_idstring
선택

표준 API 키 접두사 ID입니다. api_token_id, account_user_id, tag 중 정확히 하나를 지정하세요.

guardrail_idstring
필수

Guardrail 접두사 ID.

tagstring
선택

공유 예산을 위한 대소문자를 구분하는 key:value 태그입니다. 계정 관리자와 양수 한도의 block 모드 가드레일이 필요합니다. 대상을 정확히 하나만 지정하세요.

03

성공 응답

HTTP 201

POST /api/v1/guardrail_assignments

JSON
{
  "account_user_id": null,
  "api_token_id": null,
  "created_at": "2026-07-27T10:00:00.000Z",
  "guardrail_id": "guardrail_123",
  "id": "guardrail_assignment_123",
  "tag": "dept:ml"
}
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

오류 응답 (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"
}
07

오류 응답 (403)

HTTP 403
응답 스키마
JSON
{
  "properties": {
    "error": {
      "description": "사람이 읽을 수 있는 오류 메시지.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}

응답 예시

JSON
{
  "error": "Forbidden"
}
08

오류 응답 (404)

HTTP 404
응답 스키마
JSON
{
  "properties": {
    "error": {
      "description": "사람이 읽을 수 있는 오류 메시지.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}

응답 예시

JSON
{
  "error": "Resource not found"
}
09

오류 응답 (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"
    ]
  }
}
10

cURL 예시

CURL
curl -X POST https://runapi.ai/api/v1/guardrail_assignments \
  -H 'Authorization: Bearer YOUR_MANAGEMENT_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{"guardrail_id":"guardrail_123","tag":"dept:ml"}'