Skip to main content
POST
/
v2
/
policies
Create policy
curl --request POST \
  --url https://api.orq.ai/v2/policies \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "display_name": "<string>",
  "description": "<string>",
  "enabled": true,
  "evaluators": [
    {
      "execute_on": "<string>",
      "id": "<string>",
      "is_guardrail": true,
      "sample_rate": 123
    }
  ],
  "limits": {},
  "timeout": 123
}
'
{
  "_id": "<string>",
  "created_at": "2023-11-07T05:31:56Z",
  "created_by_id": "<string>",
  "display_name": "<string>",
  "enabled": true,
  "project_id": "<string>",
  "slug": "<string>",
  "timeout": 123,
  "updated_at": "2023-11-07T05:31:56Z",
  "updated_by_id": "<string>",
  "description": "<string>",
  "evaluators": [
    {
      "execute_on": "<string>",
      "id": "<string>",
      "is_guardrail": true,
      "sample_rate": 123
    }
  ],
  "limits": {
    "budget": {
      "amount": 123,
      "currency": "<string>",
      "period": "<string>"
    },
    "requests": {
      "amount": 123,
      "period": "<string>"
    },
    "tokens": {
      "amount": 123,
      "period": "<string>"
    }
  },
  "models_config": {
    "mode": "<string>",
    "models": [
      {
        "model": "<string>",
        "integration_id": "<string>",
        "weight": 123
      }
    ]
  },
  "retry_config": {
    "count": 123,
    "on_codes": [
      123
    ]
  }
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
display_name
string
required
description
string
enabled
boolean
evaluators
object[] | null
limits
object
models_config
object
retry_config
object
timeout
integer<int64>

Response

Policy created successfully

_id
string
required
created_at
string<date-time>
required
created_by_id
string
required
display_name
string
required
enabled
boolean
required
project_id
string
required
slug
string
required
timeout
integer<int64>
required
updated_at
string<date-time>
required
updated_by_id
string
required
description
string
evaluators
object[] | null
limits
object
models_config
object
retry_config
object