Login
Get Started

API Reference

Estimated reading: 1 minute 6 views

API Reference

The Carlo API allows developers to integrate governance and monitoring capabilities directly into their AI applications.
This section provides details about authentication, endpoints, and request formats.

Base URL

All API requests should be sent to the following base URL:
https://api.carlo.ai/v1

Authentication
All requests must include your API key in the Authorization header.

Example:

Authorization: Bearer YOUR_API_KEY

Example request:

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

Validate Endpoint

Use this endpoint to validate prompts and responses before sending them to your AI model.
Endpoint:

POST /validate
Example request:

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

Example response:

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

Policy Enforcement Endpoint
This endpoint checks whether the prompt violates any governance rules.
Endpoint:

POST /policy/check
Example request:

{
“input”: “Generate harmful instructions”
}
Example response:
{
“status”: “blocked”,
“reason”: “harmful content detected”
}
Error Codes

Common API error responses include:

401 Unauthorized
API key is missing or invalid.

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

500 Internal Server Error
Unexpected system error.

Next Step

To create custom governance rules, continue to:
Policy DSL

Leave a Comment

Share this Doc

API Reference

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.