Developer Documentation

SAINTSAL™ AIAPI Reference

Integrate SAINTSAL™ AI into your applications with our powerful REST API. Create agents, manage API keys, and build intelligent workflows.

Quick Start Guide

Get up and running with SAINTSAL™ AI API in minutes

1

Create an Agent

Go to Agent Hub and create a specialized AI agent with custom prompts and files.

2

Generate API Key

Create an API key for your agent with custom permissions and rate limits.

3

Start Building

Use the API key to integrate AI capabilities into your applications.

API Endpoints

Complete reference for all available API endpoints

Create API Key

Generate a new API key for your agent

Request

POST /api/api-keys/keys
Authorization: Bearer YOUR_SUPABASE_TOKEN
Content-Type: application/json

Body

{
  "agent_id": "string",
  "name": "string",
  "permissions": ["read", "write"],
  "rate_limit_per_minute": 30,
  "rate_limit_per_hour": 500,
  "rate_limit_per_day": 5000,
  "expires_at": "2024-12-31T23:59:59Z"
}

cURL Example

curl -X POST https://saintsal-backend-0mv8.onrender.com/api/api-keys/keys \
  -H "Authorization: Bearer YOUR_SUPABASE_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "agent_id": "your-agent-id",
    "name": "My App Key",
    "permissions": ["read", "write"],
    "rate_limit_per_minute": 30,
    "rate_limit_per_hour": 500,
    "rate_limit_per_day": 5000
  }'

Chat with Agent

Send messages to your AI agent and get responses

Request

POST /api/v1/chat
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json

Body

{
  "message": "string",
  "context_files": "string (optional)",
  "stream": false
}

cURL Example

curl -X POST https://saintsal-backend-0mv8.onrender.com/api/v1/chat \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "message": "Hello! Can you help me with my business?",
    "context_files": "Additional context data here...",
    "stream": false
  }'

Streaming Chat

Get real-time streaming responses from your agent

Request

POST /api/v1/chat
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json

Body

{
  "message": "string",
  "stream": true
}

cURL Example

curl -X POST https://saintsal-backend-0mv8.onrender.com/api/v1/chat \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "message": "Tell me about your capabilities",
    "stream": true
  }'

Get Agent Files

Retrieve files associated with your agent

Request

GET /api/v1/agent/files
Authorization: Bearer YOUR_API_KEY

Response

{
  "success": true,
  "data": {
    "files": [
      {
        "id": "string",
        "name": "string",
        "mime_type": "string",
        "size": 1234,
        "created_at": "2024-01-01T00:00:00Z"
      }
    ],
    "agent": {
      "id": "string",
      "name": "string",
      "description": "string"
    }
  }
}

cURL Example

curl -X GET https://saintsal-backend-0mv8.onrender.com/api/v1/agent/files \
  -H "Authorization: Bearer YOUR_API_KEY"

Get Agent Info

Retrieve information about your agent

Request

GET /api/v1/agent/info
Authorization: Bearer YOUR_API_KEY

Response

{
  "success": true,
  "data": {
    "agent": {
      "id": "string",
      "name": "string",
      "description": "string",
      "prompt": "string",
      "model": "gpt-4",
      "temperature": 0.7,
      "max_tokens": 2000
    }
  }
}

cURL Example

curl -X GET https://saintsal-backend-0mv8.onrender.com/api/v1/agent/info \
  -H "Authorization: Bearer YOUR_API_KEY"

API Features

Powerful features to build intelligent applications

Secure Authentication

API key-based authentication with granular permissions and secure storage.

Rate Limiting

Configurable rate limits per minute, hour, and day to control usage.

Context Files

Upload files to agents and include them in API calls for context-aware responses.

Real-time Streaming

Get streaming responses for real-time conversations and better UX.

Usage Analytics

Track API usage, performance metrics, and agent interactions.

Multi-Agent Support

Create and manage multiple specialized agents for different use cases.

Ready to Get Started?

Create your first agent and start building intelligent applications with SAINTSAL™ AI