Skip to main content

Step 1: Set your API key

Use your Future AGI API key and secret to authenticate. Get them from the dashboard:
Click here to learn how to access your API key.

Step 2: Call the Protect API

The backend exposes a Standalone Protect Eval endpoint. There is no separate “Protect client” in this service; you call the REST API (or use an SDK that wraps it). Endpoint: POST /sdk/api/v1/eval/ Headers:
HeaderRequiredDescription
X-Api-KeyYesYour API key
X-Secret-KeyYesYour secret key
Content-TypeYesapplication/json
Request body:
FieldTypeRequiredDescription
inputsarrayYesList of one object. That object must have key input with the text (or URL/path) to evaluate.
configobjectYesEval config keyed by eval_id. For Protect Flash use "76"; value is the config object (e.g. {}).
protect_flashbooleanNotrue → Protect Flash (faster, billed as Protect Flash Evaluator). Omit or false → Protect (billed as Protect Evaluator).
Example (Python with requests):
import os
import requests

url = "https://<your-base-url>/sdk/api/v1/eval/"
headers = {
    "X-Api-Key": os.environ.get("FI_API_KEY"),
    "X-Secret-Key": os.environ.get("FI_SECRET_KEY"),
    "Content-Type": "application/json",
}
payload = {
    "inputs": [{"input": "Your text or content URL to evaluate"}],
    "config": {"76": {}},
    "protect_flash": True,
}

response = requests.post(url, json=payload, headers=headers)
data = response.json()
Using environment variables:
export FI_API_KEY="your_api_key_here"
export FI_SECRET_KEY="your_secret_key_here"
Then in Python use os.environ.get("FI_API_KEY") and os.environ.get("FI_SECRET_KEY") in the headers.

Step 3: Request and response reference

Request

  • inputs — Required. Must be a non-empty array. The first element must be an object with key input (string: plain text, image URL, audio URL, or file path, as supported by the evaluator).
  • config — Required. Must be an object. Exactly one key: the eval_id as a string (e.g. "76" for Protect Flash). The value is the eval config (e.g. {}).
  • protect_flash — Optional. Boolean. Default is false. true uses Protect Flash; false uses full Protect.

Response (success)

HTTP 200 with JSON body:
{
  "status": 1,
  "result": [
    {
      "evaluations": [
        {
          "name": "protect_flash",
          "reason": "...",
          "runtime": 0.234,
          "output": "Passed",
          "output_type": "...",
          "eval_id": "<sdk_uuid>"
        }
      ]
    }
  ]
}
The result is an array of output entries (one entry per input). Each entry has an evaluations array. For a single input you use result[0].evaluations[0].
KeyTypeDescription
namestringEval template name (e.g. protect_flash).
reasonstringExplanation when available (e.g. why content failed).
runtimenumberTime taken in seconds.
outputstring"Passed" or "Failed" — use this to enforce the guardrail.
output_typestringOutput type label.
eval_idstringsdk_uuid for this run (correlation/logging).
Use output to decide whether to block, flag, or allow content; use reason for logging or user-facing messages.

Pass example

# result[0]["evaluations"][0]
{
    "name": "protect_flash",
    "reason": "",
    "runtime": 0.234,
    "output": "Passed",
    "output_type": "Pass/Fail",
    "eval_id": "550e8400-e29b-41d4-a716-446655440000"
}

Fail example

# result[0]["evaluations"][0]
{
    "name": "protect_flash",
    "reason": "Content contains harmful or unsafe material.",
    "runtime": 0.156,
    "output": "Failed",
    "output_type": "Pass/Fail",
    "eval_id": "550e8400-e29b-41d4-a716-446655440000"
}

Example: text content

payload = {
    "inputs": [{"input": "This is a test message"}],
    "config": {"76": {}},
    "protect_flash": True,
}
response = requests.post(url, json=payload, headers=headers)
result = response.json()["result"][0]["evaluations"][0]
if result["output"] == "Failed":
    print("Blocked:", result["reason"])

Example: custom failure message in your app

The API does not accept a custom “action” message. You choose what to show when output is "Failed":
FAILURE_MESSAGE = "This content cannot be displayed."

if result["output"] == "Failed":
    return FAILURE_MESSAGE  # or log result["reason"] and block

Safety dimensions (evaluator behavior)

The Protect / Protect Flash evaluator (eval_id 76) checks for harmful or unsafe content. That includes the four dimensions described in the Protect overview: content moderation, bias detection, security (e.g. prompt injection), and data privacy compliance. You do not pass a list of “rules” or “metrics” in the request; a single call runs the evaluator and returns one Passed or Failed result and an optional reason.

Multi-modal support

You pass one input string per request. The evaluator accepts:
  • Text — Plain text.
  • Image — URL or file path (formats and size limits depend on the evaluator).
  • Audio — URL or file path (formats as supported).
Same endpoint and body shape; only the value of input changes. Text:
payload = {"inputs": [{"input": "Some text to check"}], "config": {"76": {}}, "protect_flash": True}
Image URL:
payload = {"inputs": [{"input": "https://example.com/image.jpg"}], "config": {"76": {}}, "protect_flash": True}
Audio URL:
payload = {"inputs": [{"input": "https://example.com/audio.wav"}], "config": {"76": {}}, "protect_flash": True}
Use direct URLs (not preview/viewer pages). Local file paths are supported when the evaluator runs in an environment that can read them.

Important notes

  • Eval ID — For Protect Flash the config key must be the template eval_id 76. The key must be a string that parses as an integer (e.g. "76").
  • One input per request — This endpoint accepts one object in inputs (one input value). For multiple items, call the API once per item or use a batch endpoint if available.
  • Billingprotect_flash: trueProtect Flash Evaluator; protect_flash: false (or omitted) → Protect Evaluator. Rate limits apply per product.
  • Errors — Missing inputs, empty inputs, or missing config return 400. Invalid config key (non-numeric) returns 400. Authentication failures return 401/403.