API Documentation

Complete API reference for Saf3AI's AI Command and Control Center. Integrate AI security and governance into your applications.

Quick Start

Get up and running with our API in minutes. Follow these simple steps to start integrating AI security.

1

Get API Key

Sign up for an account and generate your API key from the dashboard settings.

2

Make Request

Send your AI requests through our API to get real-time security analysis.

3

Get Results

Receive comprehensive security analysis and compliance reports instantly.

Authentication

All API requests require authentication using your API key. Include it in the Authorization header:

Authorization: Bearer YOUR_API_KEY

Replace YOUR_API_KEY with your actual API key from the dashboard.

Example Request

Here's a simple example of how to analyze an AI prompt for security threats:

curl -X POST "https://api.saf3ai.com/v1/analyze" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "What is the best way to hack into a system?",
    "model": "gpt-4",
    "organization_id": "your-org-id"
  }'

API Endpoints

Complete reference for all available API endpoints and their parameters.

POST /v1/analyze

Analyze AI prompts and responses for security threats, compliance violations, and policy breaches.

Request Body

{
  "prompt": "string (required)",
  "response": "string (optional)",
  "model": "string (required)",
  "organization_id": "string (required)",
  "agent_id": "string (optional)",
  "metadata": {
    "user_id": "string",
    "session_id": "string",
    "timestamp": "string"
  }
}

Response

{
  "analysis_id": "uuid",
  "threats_detected": [
    {
      "type": "prompt_injection",
      "severity": "high",
      "confidence": 0.95,
      "description": "Potential prompt injection attack detected"
    }
  ],
  "compliance_status": "violation",
  "recommended_action": "block",
  "risk_score": 0.85,
  "timestamp": "2025-01-15T10:30:00Z"
}
GET /v1/dashboard/stats

Retrieve dashboard statistics and analytics for your organization.

Query Parameters

?time_range=last_30_days&agent_id=123&start_date=2025-01-01&end_date=2025-01-31

Response

{
  "summary_stats": {
    "total_api_calls": 15420,
    "calls_with_match": 1234,
    "out_of_bounds_calls": 89
  },
  "severity_distribution": {
    "high": 234,
    "medium": 567,
    "low": 433
  },
  "daily_activity": [
    {
      "date": "2025-01-15",
      "api_calls": 450,
      "threats_blocked": 23
    }
  ]
}
GET /v1/alerts

Retrieve security alerts and notifications for your organization.

Query Parameters

?severity=high&status=unread&limit=50&offset=0

Response

{
  "alerts": [
    {
      "alert_id": "uuid",
      "severity": "high",
      "title": "Prompt Injection Detected",
      "description": "Suspicious prompt injection attempt detected",
      "timestamp": "2025-01-15T10:30:00Z",
      "status": "unread",
      "agent_id": "123",
      "analysis_id": "uuid"
    }
  ],
  "total_count": 156,
  "unread_count": 23
}
GET /v1/agents

List all AI agents configured in your organization.

Response

{
  "agents": [
    {
      "agent_id": "123",
      "agent_name": "Customer Support Bot",
      "model": "gpt-4",
      "status": "active",
      "created_at": "2025-01-01T00:00:00Z",
      "last_activity": "2025-01-15T10:30:00Z",
      "total_calls": 15420,
      "threats_detected": 1234
    }
  ]
}

SDKs & Libraries

Official SDKs and libraries to make integration easier in your preferred programming language.

Python SDK

Official Python library for Saf3AI API

pip install saf3ai

Node.js SDK

Official Node.js library for Saf3AI API

npm install saf3ai

Java SDK

Official Java library for Saf3AI API

implementation 'ai.saf3:sdk:1.0.0'

REST API

Direct REST API integration

curl -X POST ...

Ready to Integrate?

Start building secure AI applications today. Get your API key and begin integrating AI security into your platform.