{
    "name": "Xandr API",
    "version": "1.0.0",
    "headline": "Xandr API powered by ALX Protocol",
    "subheadline": "Xandr captures successful AI work into referenceable, compoundable knowledge with ALX Protocol.",
    "overview": "Xandr API captures successful AI work as inspectable traces, referenceable knowledge blocks, and promotable assets. ALX Protocol provides the open, verifiable substrate for lineage, identity, and attribution.",
    "core_concepts": [
        "knowledge_blocks",
        "lineage_graph",
        "attribution",
        "deterministic_identity",
        "atomic_settlement"
    ],
    "capabilities": [
        "register_knowledge_block",
        "query_knowledge",
        "resolve_lineage",
        "settle_attribution"
    ],
    "guarantees": [
        "deterministic_identity_derivation",
        "immutable_registration",
        "verifiable_lineage",
        "atomic_attribution_settlement"
    ],
    "properties": [
        "verifiable",
        "composable",
        "deterministic",
        "economically_enforced"
    ],
    "endpoints": {
        "blocks": {
            "list": {
                "method": "GET",
                "path": "/api/blocks",
                "auth": true,
                "description": "List blocks with filtering and pagination"
            },
            "get": {
                "method": "GET",
                "path": "/api/blocks/:blockId",
                "auth": true,
                "description": "Get a single block by ID"
            },
            "search": {
                "method": "GET",
                "path": "/api/blocks?q=:query",
                "auth": true,
                "description": "Search blocks by keyword"
            }
        },
        "chains": {
            "list": {
                "method": "GET",
                "path": "/api/chains",
                "auth": true,
                "description": "List user chains + available starter workflows"
            },
            "create": {
                "method": "POST",
                "path": "/api/chains",
                "auth": true,
                "description": "Create chain from template, set, or scratch"
            },
            "get": {
                "method": "GET",
                "path": "/api/chains/:chainId",
                "auth": true,
                "description": "Get chain details"
            },
            "fork": {
                "method": "POST",
                "path": "/api/chains/:chainId",
                "auth": true,
                "description": "Fork an existing chain"
            },
            "delete": {
                "method": "DELETE",
                "path": "/api/chains/:chainId",
                "auth": true,
                "description": "Delete a chain"
            }
        },
        "runs": {
            "start": {
                "method": "POST",
                "path": "/api/chains/:chainId/run",
                "auth": true,
                "description": "Start a run on a chain"
            },
            "list": {
                "method": "GET",
                "path": "/api/chains/:chainId/run",
                "auth": true,
                "description": "List runs for a chain"
            },
            "get": {
                "method": "GET",
                "path": "/api/chains/:chainId/run/:runId",
                "auth": true,
                "description": "Get run details + block provenance"
            },
            "node": {
                "method": "POST",
                "path": "/api/chains/:chainId/run/:runId",
                "auth": true,
                "description": "Record a node execution with block attribution"
            },
            "complete": {
                "method": "POST",
                "path": "/api/chains/:chainId/run/:runId",
                "auth": true,
                "description": "Complete a run (action: complete)"
            },
            "fail": {
                "method": "POST",
                "path": "/api/chains/:chainId/run/:runId",
                "auth": true,
                "description": "Fail a run (action: fail)"
            },
            "abandon": {
                "method": "DELETE",
                "path": "/api/chains/:chainId/run/:runId",
                "auth": true,
                "description": "Abandon a run"
            }
        },
        "templates": {
            "list": {
                "method": "GET",
                "path": "/api/templates",
                "auth": true,
                "description": "List system templates with recommendations"
            },
            "get": {
                "method": "GET",
                "path": "/api/templates/:templateKey",
                "auth": true,
                "description": "Get template details with related templates"
            },
            "clone": {
                "method": "POST",
                "path": "/api/templates/:templateKey",
                "auth": true,
                "description": "Clone template into a personal chain"
            }
        },
        "sets": {
            "list": {
                "method": "GET",
                "path": "/api/sets",
                "auth": true,
                "description": "List template sets (workflows + toolkits)"
            },
            "get": {
                "method": "GET",
                "path": "/api/sets/:setKey",
                "auth": true,
                "description": "Get set details with resolved templates"
            }
        },
        "query": {
            "ask": {
                "method": "POST",
                "path": "/api/query",
                "auth": true,
                "description": "Ask a question — AI-powered answer with block retrieval"
            }
        },
        "system": {
            "root": {
                "method": "GET",
                "path": "/",
                "auth": false,
                "description": "Platform info + endpoint directory"
            },
            "api": {
                "method": "GET",
                "path": "/api",
                "auth": false,
                "description": "Same as root"
            },
            "status": {
                "method": "GET",
                "path": "/api/system/status",
                "auth": false,
                "description": "System status (ok / degraded)"
            },
            "health": {
                "method": "GET",
                "path": "/api/system/health",
                "auth": true,
                "description": "Detailed health checks (internal key)"
            }
        }
    },
    "auth": {
        "type": "Bearer token",
        "header": "Authorization: Bearer <your-api-key>",
        "note": "System endpoints (status) are unauthenticated. All other endpoints require a valid API key."
    },
    "links": {
        "documentation": "https://docs.xandrlabs.ai",
        "api_base_url": "https://api.xandrlabs.ai"
    }
}