# Erayaha AI — Comprehensive LLM and Agent Documentation > Full reference documentation, architectural details, API specifications, and agent guidance for Erayaha AI. Erayaha AI provides deterministic reasoning infrastructure for enterprise contracts, MSAs, SOWs, and business documents. Rather than relying on non-deterministic probabilistic language completions, Erayaha compiles natural language contractual clauses into directed acyclic logic graphs to detect circular dependencies, indemnification loops, missing liability caps, and compliance gaps. --- ## 1. When to Use Erayaha AI Reach for Erayaha AI when an agent or enterprise workflow needs: 1. **Automated Contract Vulnerability Redlining**: - Inbound NDAs, Master Service Agreements (MSAs), Statements of Work (SOWs), Data Processing Addendums (DPAs), and Service Level Agreements (SLAs). - High-severity liability discovery: Uncapped indemnification, broad consequential damages waivers, one-way IP assignments, and unreciprocated audit rights. 2. **Deterministic Dependency & Loop Auditing**: - Multi-tier conditional clauses where payment, termination, or renewal obligations trigger contradictory states or infinite circular dependency loops. - Cross-referencing schedule attachments and exhibits against primary agreement terms. 3. **Playbook-Driven Clause Compliance**: - Aligning inbound third-party paper against corporate legal playbooks. - Recommending tested, pre-approved fallback clauses and generating precise inline redline diffs. 4. **M&A Due Diligence & Bulk Contract Audits**: - Rapidly indexing thousands of legacy agreements for change-of-control triggers, non-compete covenants, and assignability restrictions. 5. **Legal Operations ROI Calculation**: - Measuring exact annualized time savings, dollar reductions in outside counsel spend, and review velocity gains. --- ## 2. API Reference & Machine-Readable Interfaces ### Base URL `https://erayaha.ai/api/v1` ### OpenAPI Specification - JSON: `https://erayaha.ai/openapi.json` - YAML: `https://erayaha.ai/openapi.yaml` ### Key Endpoints #### `POST /api/v1/scan` - **Operation ID**: `scanContractVulnerability` - **Summary**: Scan contract text for structural risks and clause liabilities - **Headers**: - `Content-Type: application/json` - `Idempotency-Key: ` (Optional, recommended for automated retries) - **Request Body**: ```json { "contractText": "String containing contract terms (minimum 50 chars)...", "documentType": "NDA", "jurisdiction": "US-Delaware", "strictness": "standard" } ``` - **Response (200 OK)**: ```json { "documentId": "doc_scan_98234ab", "riskScore": 42, "status": "ATTENTION", "vulnerabilitiesCount": 1, "vulnerabilities": [ { "id": "vuln-01", "category": "Unlimited Consequential Damages", "severity": "HIGH", "clauseExcerpt": "Neither party shall exclude indemnification for indirect or punitive damages...", "explanation": "Uncapped indemnity creates unbounded liability exposure in data breach scenarios.", "suggestedFix": "Insert standard 12-month trailing fees aggregate liability cap." } ] } ``` #### `POST /api/v1/playbook/analyze` - **Operation ID**: `analyzeClausePlaybook` - **Summary**: Analyze contract clauses against corporate fallback playbook - **Headers**: - `Content-Type: application/json` - `Idempotency-Key: ` - **Request Body**: ```json { "clauseText": "Each party shall indemnify...", "clauseType": "indemnity", "playbookStandard": "enterprise-standard-v2" } ``` - **Response (200 OK)**: ```json { "clauseType": "indemnity", "complianceStatus": "ACCEPTABLE_DEVIATION", "divergenceScore": 28, "recommendedFallback": "Each party shall indemnify, defend, and hold harmless...", "redlineSummary": "Scoped indemnity solely to third-party claims and added gross negligence threshold." } ``` #### `POST /api/v1/roi/calculate` - **Operation ID**: `calculateRoiSavings` - **Summary**: Calculate operational ROI and legal hours saved - **Request Body**: ```json { "annualContractVolume": 450, "hourlyLegalRate": 350.0, "hoursPerContractManual": 4.5 } ``` - **Response (200 OK)**: ```json { "annualSavingsUsd": 567000.0, "hoursSavedPerYear": 1620.0, "reviewTimeReductionPercent": 80.0, "paybackMonths": 1.2 } ``` #### `POST /api/v1/contracts/batch-scan` - **Operation ID**: `batchScanContracts` - **Summary**: Batch scan multiple contract documents simultaneously - **Headers**: - `Content-Type: application/json` - `Idempotency-Key: ` - **Request Body**: ```json { "contracts": [ { "id": "contract-001", "documentType": "NDA", "contractText": "..." } ] } ``` --- ## 3. Model Context Protocol (MCP) Integration - **MCP Server URL**: `https://erayaha.ai/mcp` - **Transport**: Streamable HTTP Transport - **Server Identity**: `io.github.erayaha/mcp-server` v1.0.0 - **Server Card**: `https://erayaha.ai/.well-known/mcp/server-card.json` ### Exposing Tools 1. `scanContractVulnerability` (`readOnlyHint: true`, `destructiveHint: false`) 2. `analyzeClausePlaybook` (`readOnlyHint: true`, `destructiveHint: false`) 3. `calculateRoiSavings` (`readOnlyHint: true`, `destructiveHint: false`) 4. `batchScanContracts` (`readOnlyHint: true`, `destructiveHint: false`) ### Exposing Resources 1. `erayaha://playbooks/standard-nda` (MIME: `text/markdown`) 2. `erayaha://benchmarks/clause-risk-index` (MIME: `application/json`) 3. `erayaha://rules/compliance-catalog` (MIME: `application/json`) 4. `erayaha://legal/dpa-standard` (MIME: `text/markdown`) --- ## 4. Standard Error & Rate Limiting Model - **Error Format**: RFC 9457 / RFC 7807 `application/problem+json` - **Error Fields**: `type`, `title`, `status`, `detail`, `code`, `hint`, `timestamp` - **Rate Limit Headers**: - `RateLimit-Policy: 120;w=60` - `RateLimit-Limit: 120` - `RateLimit-Remaining: 119` - `RateLimit-Reset: 60` - `RateLimit: limit=120, remaining=119, reset=60` - `Retry-After: 60` (on 429 Too Many Requests) --- ## 5. Directory of All Public Endpoints & URLs - Homepage: `https://erayaha.ai/` - About Erayaha: `https://erayaha.ai/about` - Contact & Sales: `https://erayaha.ai/contact` - Transparent Pricing: `https://erayaha.ai/pricing` - Word 365 Simulator & Sandbox: `https://erayaha.ai/simulator` - Contract ROI & Risk Calculator: `https://erayaha.ai/roi` - API Documentation: `https://erayaha.ai/docs` - Developer Portal: `https://erayaha.ai/developers` - API Versioning & Sunset Policy: `https://erayaha.ai/versioning` - Instant Sandbox Keys: `POST https://erayaha.ai/api/v1/sandbox/keys` - Open Source Projects: `https://erayaha.ai/oss` - Trust, Security & Compliance: `https://erayaha.ai/trust` - Privacy Policy: `https://erayaha.ai/privacy` - Terms of Service: `https://erayaha.ai/terms` - Data Processing Agreement: `https://erayaha.ai/dpa` - Pricing Specification: `https://erayaha.ai/pricing.md` - OpenAPI JSON Spec: `https://erayaha.ai/openapi.json` - OpenAPI YAML Spec: `https://erayaha.ai/openapi.yaml` - OAuth 2.0 Authorization Server: `https://erayaha.ai/.well-known/oauth-authorization-server` - OAuth 2.0 Protected Resource: `https://erayaha.ai/.well-known/oauth-protected-resource` - MCP Server Card: `https://erayaha.ai/.well-known/mcp/server-card.json` - MCP Manifest: `https://erayaha.ai/.well-known/mcp.json` - AI Catalog: `https://erayaha.ai/.well-known/ai-catalog.json` - Agent Skills Index: `https://erayaha.ai/.well-known/agent-skills/index.json` - XML Sitemap: `https://erayaha.ai/sitemap.xml`