📡 Status: Preview Only
AYDA’s Phase 2 API offers sandboxed inference endpoints, persona-driven logic, and modular model licensing. All functionality is subject to change during preview.
🔧 Endpoint Overview
| Endpoint | Method | Description | Status | 
|---|---|---|---|
| /v2/infer | POST | Run inference using a licensed persona model | Preview | 
| /chat | POST | Stream persona-driven responses in real time | Preview | 
| /v2/persona/switch | POST | Switch active persona mid-session | Preview | 
| /v2/persona/list | GET | Retrieve available personas and model versions | Stable | 
| /v2/session/trace | GET | Fetch session metadata for audit and review | Preview | 
| /v2/license/validate | POST | Validate access to a model-version pair | Planned | 
🧠 Persona Switching Logic
AYDA supports dynamic persona switching via the /persona/switch endpoint. Each persona is scoped by:
- id: Unique identifier (e.g. forensic_analyst,script_coder)
- model: Associated model name (e.g. aydasilver)
- version: Active version (e.g. v1.5)
Note: Enrichment tags and switching trace logic are available in NDA-bound documentation.
🧪 Inference Preview
The /infer endpoint accepts modular payloads with persona context. Responses include:
- summary: High-level inference output
- confidence: Scored output (0–1)
- persona: Active persona metadata
- model: Model name and version used
Trace IDs and forensic enrichment paths are available in NDA-bound documentation.
💬 Streaming Chat Interface
AYDA’s /chat endpoint supports real-time persona-driven conversations using Server-Sent Events (SSE). Optimized for chatbot UIs and SOC dashboards.
Content-Type: application/json
Response: text/event-stream
{
  "prompt": "What are the risks of example-domain.net?",
  "persona": "predict",
  "context": "domain scan",
  "user_id": 42
}
  Optional headers and persona overrides are documented in the NDA package.
📦 Python Streaming Client (httpx)
import httpx, asyncio
async def stream_chat():
    url = "https://api.nattytech.com/chat"
    headers = {"Accept": "text/event-stream"}
    payload = {
        "prompt": "What are the risks of example-domain.net?",
        "persona": "soc",
        "context": "domain scan",
        "user_id": 42
    }
    async with httpx.AsyncClient(timeout=None) as client:
        async with client.stream("POST", url, headers=headers, json=payload) as response:
            async for line in response.aiter_lines():
                if line.startswith("data: "):
                    print("🔹", line[6:])
asyncio.run(stream_chat())
    ⚠️ Notes & Limitations
- All endpoints are sandboxed and rate-limited
- Persona switching is non-persistent unless explicitly tagged
- Trace data is stored temporarily for preview validation
- Licensing keys are tied to model-version pairs
- Airgapped deployments support offline upgrades and version pinning
🔖 AYDA API Documentation — Public Preview  v1.0
Last updated: August 2025 · Endpoint structure and payloads subject to change
For roadmap details and enrichment logic, refer to NDA-bound investor materials.

