API Reference

The Open Interface to Autonomous Security

Programmatic access to SARA — your glass-box Co-Analyst. Drop in via the OpenAI-compatible endpoint, enrich IOCs, triage alerts, drive the Self-Driving SOC. Looking for the analyst surface? See /help.

What's new — last two weeks

Authentication

SARA Open exposes three auth tiers. The right one depends on which surface you're calling.

TierHeaderUse for
API keyx-api-key: sara_…Public /api/v1/* endpoints. Generate in Settings → API. Pro+ only.
Sessioncookie (OAuth)In-browser endpoints under /api/chat, /api/feedback, /api/agents. Sign in with Google.
AnonymousnoneFree-tools endpoints under /api/free-tools/* and read-only Pulse / CVE lookups. Hard-rate-limited.
curl -H "x-api-key: sara_your_key_here" \
     https://sara-open.sirp.io/api/v1/chat

Keys start with sara_. They are returned once at creation — save them immediately. Listed keys show only a prefix.

Rate limits & plan gates

Per-plan limits are defined in sara/security/feature_gate.py. The same gate enforces messages-per-hour, max API keys, attachment counts, and combined attachment text injection.

PlanChat /hrAPI keysAttachments / msgCombined text capAPI access
Free100240 K chars
Registered500360 K chars
Pro20035120 K charsYes
Team500 / seat1010200 K charsYes

Rate-limit headers on every response: X-RateLimit-Remaining, X-RateLimit-Limit, X-RateLimit-Reset (Unix seconds).

Public /api/v1 endpoints

API-key auth. Defined in sara/routes/api_v1.py.

POST /api/v1/chat/completions Pro+ OpenAI Compatible
Drop-in replacement for OpenAI's chat completions. Works with the OpenAI SDK, LangChain, LlamaIndex, or any SOAR integration. Same pipeline as /api/v1/chat.

Request

{
  "model": "sara",
  "messages": [
    {"role": "user", "content": "What is CVE-2024-3400?"}
  ]
}

Response

{
  "id": "chatcmpl-abc123",
  "object": "chat.completion",
  "created": 1711000000,
  "model": "sara",
  "choices": [{
    "index": 0,
    "message": {"role": "assistant", "content": "..."},
    "finish_reason": "stop"
  }],
  "usage": {"prompt_tokens": 150, "completion_tokens": 200, "total_tokens": 350}
}

Python (OpenAI SDK)

from openai import OpenAI

client = OpenAI(
    base_url="https://sara-open.sirp.io/api/v1",
    api_key="sara_your_key_here",
)

resp = client.chat.completions.create(
    model="sara",
    messages=[{"role": "user", "content": "Analyze IP 185.220.101.34"}],
)
print(resp.choices[0].message.content)

LangChain

from langchain_openai import ChatOpenAI

llm = ChatOpenAI(
    base_url="https://sara-open.sirp.io/api/v1",
    api_key="sara_your_key_here",
    model="sara",
)
print(llm.invoke("What is APT29?").content)
POST /api/v1/chat Pro+ SARA Native
SARA's native chat shape — exposes mode, sources, detected IOCs, and remaining rate-limit window. Same pipeline as chat/completions; use this when you want the structured fields.

Request — single turn

{
  "message": "What is CVE-2024-3400?",
  "web_browse": true
}

Request — multi-turn

{
  "messages": [
    {"role": "user", "content": "Tell me about APT28"},
    {"role": "assistant", "content": "APT28 is..."},
    {"role": "user", "content": "What TTPs do they use?"}
  ]
}

Response

{
  "response": "CVE-2024-3400 is a critical vulnerability in PAN-OS...",
  "mode": "threat_intel",
  "sources": ["Knowledge Base", "NVD"],
  "iocs_detected": [],
  "trace_id": "trc_8f3a...",
  "remaining_this_hour": 499,
  "hourly_limit": 500
}
FieldTypeDescription
responsestringSARA's full analysis (Markdown)
modestringSelected response mode (see Response Modes)
sourcesarrayData sources used (KB, NVD, EPSS, KEV, Web, OmniSense)
iocs_detectedarrayIOCs SARA extracted from the query
trace_idstringOpaque turn identifier — quote this in support requests if you need SARA's quality team to inspect the run
POST /api/v1/enrich Pro+
Enrich IOCs (IPs, hashes, domains, URLs) with deterministic verdicts from the configured threat-intel sources (8+).

Request

{
  "iocs": [
    {"value": "185.220.101.34", "type": "ip"},
    {"value": "44d88612fea8a8f36de82e1278abb02f", "type": "hash"}
  ]
}

Max 20 IOCs per request. Types: ip, hash, domain, url.

Response

{
  "results": "### 185.220.101.34\n**Verdict:** SUSPICIOUS...",
  "ioc_count": 2,
  "verdicts": [
    {"value": "185.220.101.34", "type": "ip", "verdict": "SUSPICIOUS", "score": 60},
    {"value": "44d886...", "type": "hash", "verdict": "MALICIOUS", "score": 90}
  ]
}

Verdict floors: KEV / abuse.ch confirmed-malicious feeds set a deterministic MALICIOUS floor that an LLM cannot override (see sara/core/observation_decoder.py).

POST /api/v1/analyze Pro+
Analyze structured security content — alerts, phishing emails, or CVEs. Same engine used by the free-tools surfaces.

Request

// Alert triage
{"content": "EventID=4625 LogonType=3 TargetUserName=admin...", "type": "alert"}

// Phishing email
{"content": "From: [email protected]\nReply-To: [email protected]...", "type": "email"}

// CVE lookup
{"content": "CVE-2024-3400", "type": "cve"}

// Auto-detect
{"content": "CEF:0|Palo Alto|Cortex XDR|...", "type": "auto"}

Types: alert (CEF, syslog, Kibana, JSON, Windows Event Log), email (phishing), cve, auto.

Response

{
  "analysis": "## Facts\n- Observed: EventID 4625...",
  "type": "windows_event"
}
POST /api/v1/keys Session
Create a new API key for the signed-in user.
{"name": "My SOAR Integration"}

The full key is returned once in the response — save it immediately. After this call the prefix is the only thing the API ever returns.

GET /api/v1/keys Session
List your API keys (prefix + metadata only — never the full secret).
DELETE /api/v1/keys/{key_id} Session
Revoke an API key. Integrations using it stop working immediately.

Free-Tools endpoints

Anonymous, hard-rate-limited surfaces that back the public free tools. No API key required. Defined in sara/routes/free_tools_*.py.

POST /api/free-tools/ioc-check Anonymous
One-shot IOC reputation lookup. Powers /free-tools/ioc-checker.
{"ioc": "185.220.101.34"}

Also supports GET /api/free-tools/ioc-check?ioc=… for embed-friendly use.

POST /api/free-tools/sigma Anonymous
Generate a Sigma detection rule from a natural-language description or pasted alert. Powers /free-tools/sigma-generator.
{"description": "Detect PowerShell with encoded command"}
POST /api/free-tools/phishing-analyze Anonymous
Phishing-email analyzer. Paste the full raw email (headers + body). Powers /free-tools/phishing-analyzer.
{"raw_email": "From: …\nSubject: …\n\n…"}

Runs 25+ checks (SPF / DKIM / DMARC, signing-domain mismatch, RFC 2047 encoding, invisible Unicode, Base64 URL decoding) and auto-generates a matching Sigma rule.

GET /api/cve/{cve_id} Anonymous
CVE detail lookup — NVD facts, EPSS percentile, KEV status, references. Backs /cve/{cve_id}.
GET /api/kev/{cve_id} Anonymous
CISA KEV-only lookup for a given CVE. Backs /kev/{cve_id}.

Agents

Agents are pluggable analysis units (Remediation, Alert Triage, IOC Enrichment, Phishing, Incident Orchestrator) registered in sara/agents/registry.py and surfaced under /api/agents. Session-auth.

GET /api/agents Session
List installed agents with their declared capabilities and required upstreams.
GET /api/agents/{name} Session
Single agent's manifest — inputs, outputs, the policy tier it runs under, and which upstreams are CRITICAL (hard-block) vs. optional.
POST /api/agents/{name}/invoke Session
Run an agent against a chat turn or incident. Agents respect _AGENT_CRITICAL_REQUIREMENTS — missing upstream returns UPSTREAM_UNAVAILABLE after a one-shot retry rather than soft-proceeding.
{"input": { /* agent-shape varies */ },
 "incident_id": "266279"}
POST /api/agents/{name}/upload Session
Attach a file to an agent invocation (e.g. .eml to PhishingAgent).

Feedback

POST /api/feedback Session Updated 2026-05
Thumbs up / down on any SARA response. Writes to the trace log and — when OmniFlex is enabled — to the per-tenant bandit's reward ledger with reward_source = "explicit_thumbs".
{
  "message_id": "msg_abc123",
  "feedback": "up",            // "up" | "down"
  "comment": "Citation was spot-on",  // optional, max 2000 chars
  "mode": "threat_intel",
  "agent": ""
}

Response Modes

SARA's mode resolver (sara/core/pipeline/resolve.py) picks a mode per turn. Each mode is a distinct prompt template + formatting contract; the chosen mode is returned on every response and bandit-tracked.

ModeSelected when
definition"What is X?" — short, plain-English glossary
generic_guidance"How do I…?" / "Steps to…" workflows
brief_conversationalGreetings, meta questions, very short answers
comparison"X vs Y" — side-by-side framing
product_explainerTool / vendor capability questions
threat_intelCVE lookups, threat-actor profiles, vulnerability research
ioc_enrichmentIP / hash / domain / URL detected — per-IOC verdict tables
url_analysisSingle URL deep-dive (defang, reputation, redirect chain)
phishing_analysisEmail headers + body pasted; 25+ checks
alert_triageAlert payload (CEF, syslog, Kibana, JSON, Windows Event Log)
detection_engineeringSigma / KQL / Splunk rule authoring
case_analysisReal incident with enrichment + doctrine, structured Facts / Assessment / Recommendation
action_proposalContainment actions awaiting confirmation
tenant_query"Show me my incidents" — OmniSense list / filter
tenant_overviewSOC briefing — MTTR / MTTD / SLA / workload roll-up
threat_pulseDaily threat-pulse briefing surface

Errors

CodeMeaning
400Bad request — missing or invalid parameters, oversized comment, attachment-count or text-cap exceeded
401Invalid or missing API key / session
403Plan doesn't support this endpoint, or tenant binding missing
413Payload too large (single attachment over 5 MB)
422Schema validation failed (FastAPI Pydantic)
429Rate limit exceeded — wait until X-RateLimit-Reset
503LLM, retrieval, or upstream agent temporarily unavailable
UPSTREAM_UNAVAILABLEAgent error payload — a CRITICAL upstream (e.g. IntelOwl) was unreachable after retry; no soft-proceed

Examples

Python — single turn

import requests

resp = requests.post(
    "https://sara-open.sirp.io/api/v1/chat",
    headers={"x-api-key": "sara_your_key"},
    json={"message": "What is CVE-2024-3400?"},
)
data = resp.json()
print(data["response"])
print("trace_id:", data["trace_id"])  # quote in support requests

JavaScript — IOC enrichment

const resp = await fetch("https://sara-open.sirp.io/api/v1/enrich", {
  method: "POST",
  headers: { "x-api-key": "sara_your_key", "Content-Type": "application/json" },
  body: JSON.stringify({ iocs: [{ value: "185.220.101.34", type: "ip" }] }),
});
const data = await resp.json();
console.log(data.verdicts);

curl — phishing analyzer (anonymous)

curl -X POST https://sara-open.sirp.io/api/free-tools/phishing-analyze \
  -H "Content-Type: application/json" \
  -d '{"raw_email": "From: ..."}'

For the analyst-facing surface (chat, agents in the UI, workspaces, Pulse), see /help. For the standalone free tools, see /free-tools/*.

Built by SIRP — SARA Open is the Open Interface to Autonomous Security, powered by OmniSense.