Skip to Content
API ReferenceGuardrailsCreate Guardrail

Create a guardrail

POST

https://novapai.ai/api/v1/guardrails 

POST

/api/v1/guardrails

cURL
$curl -X POST https://novapai.ai/api/v1/guardrails \ >-H "Authorization: Bearer <token>" \ >-H "Content-Type: application/json" \ >-d '\{ >"name": "My New Guardrail", >"description": "A guardrail for limiting API usage", >"limit_usd": 50, >"reset_interval": "monthly", >"allowed_providers": [ >"openai", >"anthropic", >"deepseek" >], >"enforce_zdr": false >\}'
201 Created
reference-guardrails-create-guardrail-01.json
{ "data": { "id": "550e8400-e29b-41d4-a716-446655440000", "name": "My New Guardrail", "created_at": "2025-08-24T10:30:00Z", "description": "A guardrail for limiting API usage", "limit_usd": 50, "reset_interval": "monthly", "allowed_providers": ["openai", "anthropic", "google"], "enforce_zdr": false } }

Create a new guardrail for the authenticated user. Management key  required.

Authentication

Authorization Bearer

API key as bearer token in Authorization header

Request

This endpoint expects an object.

字段类型必填说明
namestring1-200 characters Name for the new guardrail
descriptionstring or null<=1000 characters Description of the guardrail
limit_usddouble or null>=0 Spending limit in USD
reset_intervalenum or nullInterval at which the limit resets (daily, weekly, monthly) Allowed values:daily weekly monthly
allowed_providerslist of strings or nullList of allowed provider IDs
ignored_providerslist of strings or nullList of provider IDs to exclude from routing
allowed_modelslist of strings or nullArray of model identifiers (slug or canonical_slug accepted)
enforce_zdrboolean or nullWhether to enforce zero data retention

Response

Guardrail created successfully

字段类型必填说明
dataobject-The created guardrail

Errors

状态码说明
400Bad Request Error
401Unauthorized Error
500Internal Server Error