Authentication

RAGaaS uses API keys to authenticate requests and tenant headers for data isolation.

API Keys

Get your API key from the RAGaaS Dashboard. Include it in the Authorization header for all API requests:

Authorization Header

Authorization: Bearer your_api_key

Tenant Header

RAGaaS supports multitenancy through the X-Tenant-ID header. When provided, this header ensures automatic data isolation between tenants:

Tenant Header

X-Tenant-ID: tenant-123

Usage Guidelines

  1. Format:

    • Use URL-safe characters (alphanumeric, hyphens, underscores)
    • Keep IDs short but meaningful
    • Maximum length: 64 characters
    • Example: tenant-123, org-456-dept-789
  2. Behavior:

    • All document operations are automatically scoped to the tenant
    • Search results only include documents from the specified tenant
    • Document management operations are tenant-isolated
  3. Error Cases:

    Missing Header

    {
      "error": "missing_tenant_id",
      "message": "X-Tenant-ID header is required"
    }
    

    Invalid Tenant

    {
      "error": "invalid_tenant_id",
      "message": "Unknown tenant ID: tenant-456"
    }
    

Example Request

curl -X POST "https://api.ragaas.dev/v1/search" \
  -H "Authorization: Bearer $RAGAAS_API_KEY" \
  -H "X-Tenant-ID: tenant-123" \
  -H "Content-Type: application/json" \
  -d '{
    "query": "security policy",
    "namespaceId": "shared-namespace"
  }'

Making Requests

Example of an authenticated request:

curl -X GET "https://api.ragaas.dev/v1/ingest-job-runs/ijr_abc123?namespaceId=ns_abc123" \
  -H "Authorization: Bearer $RAGAAS_API_KEY"

Error Responses

Status CodeDescription
401Invalid or missing API key
403Valid key but insufficient permissions
429Rate limit exceeded

Rate Limits

The API has the following rate limits:

PlanRate Limit
Pilot~50 requests per minute
Pro~200 requests per minute
Team~500 requests per minute
EnterpriseCustom limits

Rate limit headers are included in all responses:

Response Headers

X-RateLimit-Limit: 200       # Your current rate limit
X-RateLimit-Remaining: 199   # Requests remaining
X-RateLimit-Reset: 1640995200 # Timestamp when limit resets