API 레퍼런스
가드레일 만들기
재사용 가능한 모델, 공급자, 예산 정책을 만듭니다.
재사용 가능한 모델, 공급자, 예산 정책을 만듭니다.
엔드포인트
- Base URL
https://runapi.ai- API 버전
v1- 인증
Authorization: Bearer YOUR_MANAGEMENT_API_KEY
02
JSON 본문요청
나열된 요청 위치에만 값을 전송하세요.
JSON 본문필드 10개
allowed_modelsarray | null
선택
모델 허용 목록.
allowed_providersarray | null
선택
공급자 이름 허용 목록.
blocked_modelsarray | null
선택
허용 목록보다 우선 적용되는 모델 차단 목록.
blocked_providersarray | null
선택
공급자 이름 차단 목록.
credit_limit_centsinteger | null
선택
총 지출 한도(USD 센트).
credit_limit_reset_intervalstring | null
선택
총 지출 한도 초기화 주기.
허용 값:daily, weekly, monthly
descriptionstring
선택
선택적 자유 형식 설명.
enabledboolean
선택
가드레일이 적용되는지 여부.
기본값:true
model_budgetsarray | null
선택
모델별 예산 규칙.
namestring
필수
계정 내에서 고유한 Guardrail 이름.
03
HTTP 201성공 응답
POST /api/v1/guardrails
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": 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"
}
04
HTTP 401오류 응답 (401)
응답 스키마
JSON
{
"properties": {
"error": {
"description": "사람이 읽을 수 있는 오류 메시지.",
"type": "string"
}
},
"required": [
"error"
],
"type": "object",
"unevaluatedProperties": false
}
응답 예시
JSON
{
"error": "Authentication required"
}
05
HTTP 403오류 응답 (403)
응답 스키마
JSON
{
"properties": {
"error": {
"description": "사람이 읽을 수 있는 오류 메시지.",
"type": "string"
}
},
"required": [
"error"
],
"type": "object",
"unevaluatedProperties": false
}
응답 예시
JSON
{
"error": "Management API key required"
}
06
HTTP 403오류 응답 (403)
응답 스키마
JSON
{
"properties": {
"error": {
"description": "사람이 읽을 수 있는 오류 메시지.",
"type": "string"
}
},
"required": [
"error"
],
"type": "object",
"unevaluatedProperties": false
}
응답 예시
JSON
{
"error": "Account admin required"
}
07
HTTP 400오류 응답 (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
HTTP 422오류 응답 (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"
]
}
}
09
cURL 예시
CURL
curl -X POST https://runapi.ai/api/v1/guardrails \
-H 'Authorization: Bearer YOUR_MANAGEMENT_API_KEY' \
-H 'Content-Type: application/json' \
-d '{"name":"Production budget","description":"Production policy","enabled":true,"credit_limit_cents":50000,"credit_limit_reset_interval":"monthly","allowed_models":["gpt-5.4"],"model_budgets":[{"match_mode":"include","models":["gpt-5.4"],"credit_limit_cents":10000,"credit_limit_reset_interval":"monthly"}]}'