Login
Get Started

REST API

Estimated reading: 1 minute 4 views

REST API

The Carlo REST API allows developers to integrate governance monitoring and ethical AI controls into any application, regardless of programming language.

You can send API requests to validate prompts, enforce governance policies, and monitor AI interactions.

Authentication

All API requests require an API key.

Include your API key in the Authorization header.

Authorization: Bearer YOUR_API_KEY

Example request:

curl https://api.carlo.ai/v1/validate \
-H “Authorization: Bearer YOUR_API_KEY”

Validate Prompt Endpoint

This endpoint checks whether a prompt complies with governance policies.
Endpoint:

POST /validate
Example request:

{
“prompt”: “Explain artificial intelligence”,
“model”: “gpt-4”
}

Example response:

{
“status”: “approved”,
“policy_triggered”: null
}

Policy Check Endpoint
This endpoint verifies if a prompt violates governance rules.
Endpoint:

POST /policy/check

Example request:
{
“input”: “Generate harmful instructions”}

Example response:
{
“status”: “blocked”,
“reason”: “policy violation detected”}

Error Codes

Common API errors include:

401 Unauthorized
API key missing or invalid.

429 Rate Limit Exceeded
Too many requests sent within a short time.

500 Internal Server Error
Unexpected system error.

Best Practices

• Always validate prompts before sending them to AI models
• Monitor API responses for policy violations
• Use audit logs for compliance tracking

Leave a Comment

Share this Doc

REST API

Or copy link

CONTENTS
Need Help? Chat with us
Compliance Intake

Talk to Compliance Support

Share a few details so we can route you to the right compliance expert.

This site is registered on wpml.org as a development site. Switch to a production site key to remove this banner.