openaiguardrails-sdk
Official Python client for the Open AI Guardrails runtime API.
The PyPI distribution is published as openaiguardrails-sdk while PyPI reviews the canonical openaiguardrails project name. Import from openaiguardrails:
from openaiguardrails import OpenAIGuardrailsClient
Install
pip install openaiguardrails-sdk
Quick start
from openaiguardrails import OpenAIGuardrailsClient
client = OpenAIGuardrailsClient(
base_url="https://openaiguardrails.org",
token="YOUR_OPENAIGUARDRAILS_API_TOKEN",
)
policy = client.get_policy("prod-safety-alpha")
skills = client.list_skills()
Pass a bearer token for protected routes (policy manager, blog review, admin publish). Public catalog and health endpoints work without a token on the hosted API.
NoirGuardrailsClient and NoirGuardrailsError remain available as aliases.
API surface
Core
| Method | HTTP | Auth |
|---|---|---|
health() |
GET /health |
— |
get_openapi() |
GET /openapi.json |
— |
list_entries() |
GET /api/entries |
— |
list_discussions() |
GET /api/discussions |
— |
Policy manager & OPA
| Method | HTTP | Auth |
|---|---|---|
list_policies() |
GET /api/policies |
optional* |
get_policy(policy_id) |
GET /v1/policy/:id |
— |
toggle_policy_control(policy_id, key, value) |
POST /api/policies/:id/toggles |
policy manager |
run_policy_action(policy_id, action, **payload) |
POST /api/policies/:id/actions |
policy manager |
export_audit(policy_id) |
GET /api/policies/:id/audit-export |
policy manager |
list_opa_imports() |
GET /api/opa/imports |
policy manager |
import_opa_policy(payload) |
POST /api/opa/imports |
policy manager |
simulate_opa_import(import_id, input) |
POST /api/opa/imports/:id/simulate |
policy manager |
export_opa_import(import_id, target) |
GET .../export/:target |
policy manager |
publish_opa_import(import_id, payload) |
POST .../publish |
policy manager |
*Hosted production may require Auth0 when POLICY_MANAGER_REQUIRE_AUTH=true.
Agent Skills platform
| Method | HTTP |
|---|---|
list_skills() |
GET /api/skills |
get_skill(skill_id) |
GET /api/skills/:id |
list_professions() |
GET /api/professions |
get_profession(profession_id) |
GET /api/professions/:id |
get_mcp_registry() |
GET /api/mcp/registry |
get_mcp_tool(skill_id) |
GET /api/mcp/tools/:skillId |
Blog workflow
| Method | HTTP | Auth |
|---|---|---|
list_blog_pending_posts() |
GET /api/blog/pending-posts |
read:blog_submissions or admin |
submit_blog_post(payload) |
POST /api/blog/pending-posts |
submit:blog or user/admin |
get_blog_review(review_id) |
GET /api/blog/reviews/:id |
read:blog_submissions or admin |
approve_blog_review(review_id, payload) |
POST .../approve |
manage:blog or admin |
reject_blog_review(review_id, payload) |
POST .../reject |
manage:blog or admin |
publish_blog_review(review_id, payload) |
POST .../publish |
manage:blog or admin |
publish_blog_post(payload) |
POST /api/blog/publish |
manage:blog or admin |
Operations
| Method | HTTP | Auth |
|---|---|---|
get_smtp_status() |
GET /api/ops/smtp-status |
manage:system or admin |
Use request(path, method=..., body=...) for forward-compatible access to new OpenAPI routes.
Errors
Failed responses raise OpenAIGuardrailsError with status and parsed body.
Requirements
- Python 3.9+
- Standard library only (no third-party dependencies)
Links
Changelog
See CHANGELOG.md.
Release files for openaiguardrails-sdk 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| openaiguardrails_sdk-0.2.0.tar.gz | 5.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| openaiguardrails_sdk-0.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 11.8 kB
Release files / openaiguardrails_sdk-0.2.0.tar.gz
| Download URL | openaiguardrails_sdk-0.2.0.tar.gz |
|---|---|
| Size | 5.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4dad9e5fc108b2f783cd0b49f56b3086a719e2d3be212ffd1b51d525416fa64f
|
|
BLAKE2b-256 checksum How to use checksums |
b04baa618b6db99ec2167e215e1ce94dbe160df3de46ccc1b1fe5515d6297cea
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.2
|
Release files / openaiguardrails_sdk-0.2.0-py3-none-any.whl
| Download URL | openaiguardrails_sdk-0.2.0-py3-none-any.whl |
|---|---|
| Size | 6.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
92c32d142112e6eaea656895d2325338d4414c80ee640f2d9ad6853d7109e0ae
|
|
BLAKE2b-256 checksum How to use checksums |
27d05c0c435cf3234122480e16ea47d2d56f477d0a77bcb055b88a0b96722358
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.2
|