API Reference

Simple, powerful integration. Get started with Clestiq Shield in minutes.

1. Create Account

Sign up on the Clestiq Shield platform to access your dashboard.

2. Create App

Define your application to segregate traffic and analytics.

3. Get API Key

Generate a secure API key for your application to authenticate requests.

Chat Completions API

The core endpoint for secure LLM interactions.

Endpoint

POSThttps://api.shield.clestiq.com/chat

Headers

Content-Type:application/json
X-API-Key:<YOUR_API_KEY>

Request Body (Payload)

  • queryThe user prompt to be processed and sent to the LLM. (Required)
  • modelLLM model to use (e.g., gemini-3-flash-preview). (Required)
  • moderationLevel: strict, moderate, relaxed. (Required)
  • output_formatFormat: json or toon. (Required)
  • settingsConfiguration object for enabling specific security checks:
    detect_threatsBlocks SQLi, XSS, and injection attacks.
    pii_maskingRedacts sensitive PII data automatically.
    sanitize_inputCleans malicious control characters.
    content_filterBlocks toxic and harmful content.
    hallucination_checkVerifies factual consistency.
    citation_checkValidates sources and citations.
    tone_checkEnforces brand voice compliance.
    toon_modeConverts output to TOON format.
JSONStandard Request
All required fields
{
  "query": "Explain quantum computing.",
  "model": "gemini-3-flash-preview",
  "moderation": "moderate",
  "output_format": "json"
}
JSONFull Security Context
Max protection enabled
{
  "query": "Explain quantum computing.",
  "system_prompt": "You are a physics expert.",
  "model": "gemini-3-flash-preview",
  "moderation": "strict",
  "output_format": "json",
  "settings": {
    "pii_masking": true,
    "detect_threats": true,
    "sanitize_input": true,
    "content_filter": true,
    "hallucination_check": true,
    "citation_check": true,
    "tone_check": true,
    "toon_mode": false
  }
}
JSONResponse
{
  "response": "Quantum computing uses qubits...",
  "app": "my-app",
  "metrics": {
    "security_score": 0.05,
    "threats_detected": 0,
    "pii_redacted": 1,
    "guardian_metrics": {
       "hallucination_detected": false,
       "citations_verified": true
    },
    "token_usage": { "total_tokens": 150 }
  }
}

All requests are automatically guarded. Sentinel analyzes the input before it reaches the LLM, and Guardian validates the output.