openapi: 3.1.0
info:
  title: AUROS Protocol
  version: "1.0"
  x-logo:
    url: https://getauros.com/auros-logo.svg
    altText: AUROS
  description: |
    The RWA Intelligence Layer — indicative MiCA scoring, RWA catalog, jurisdiction ranking,
    and compliance checklists. Not legal advice.

    **Base URLs (production):** `https://getauros.com` or `https://api.getauros.com` (API subdomain)

    **Authentication:** Bearer token (`auros_pk_live_*` or `auros_pk_test_*`). Demo key: `auros_pk_test_demo`.
    Scopes (least privilege): `protocol:read`, `intelligence:read`. Legacy keys without scopes keep both.
    Lifecycle: `POST /api/v1/keys` (create), `POST /api/v1/keys/revoke`, `POST /api/v1/keys/rotate`.

    **Free tier:** 1000 requests/month per minted key. Key creation via `POST /api/v1/keys` (no auth).
    Demo shared quota: 50/month. Public freemium tips also apply IP rate limits (default 60/min).

    **Response headers (every response):** `X-AUROS-Protocol-Version: 1.0`, `X-AUROS-Logo: https://getauros.com/auros-logo.svg`, `X-Response-Time` (request duration in ms). Authenticated routes and IP-limited endpoints also return `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset` (Unix timestamp — monthly key quota resets on the 1st UTC).

    **SDKs:** `@adrien1212balitrand/auros-protocol` (npm), `auros-protocol` (pip). Docs: `/developers/docs`.

    **Postman:** Import `/auros-postman.json` (collection v2.1 — all v1 endpoints, demo key pre-filled).
  contact:
    name: AUROS
    url: https://getauros.com/developers
    email: contact@getauros.com
  license:
    name: Proprietary
    url: https://getauros.com/trust
externalDocs:
  description: Developer hub, playground & Postman collection (/auros-postman.json)
  url: https://getauros.com/developers
servers:
  - url: https://getauros.com
    description: Production (main domain)
  - url: https://api.getauros.com
    description: Production (API subdomain — same endpoints under /api/v1/*)
  - url: http://localhost:3000
    description: Local development
security:
  - bearerAuth: []
tags:
  - name: Intelligence
    description: MiCA scoring and compliance
  - name: Desk
    description: Unfused Gap · Activity · Variance · annex briefs (Bearer) — never a mega-score
  - name: Catalog
    description: RWA product data
  - name: Keys
    description: API key management
  - name: Premium
    description: Monitor, dossier, attest, execution-proof, webhooks — requires paid tier
  - name: Status
    description: Public health checks — no auth
  - name: Public
    description: Public verify endpoints — no auth
  - name: Green
    description: AUROS Green scoring — Watt Score, Carbon Quality Score (CQS)
paths:
  /api/v1/status:
    get:
      tags: [Status]
      summary: API health status
      operationId: status
      security: []
      description: |
        Public health check — probes scoring engine, product catalog, jurisdiction ranking,
        and key storage. No authentication required.
      responses:
        "200":
          description: System status
          headers:
            X-AUROS-Protocol-Version:
              schema:
                type: string
                example: "1.0"
            X-AUROS-Logo:
              schema:
                type: string
                format: uri
            X-Response-Time:
              schema:
                type: string
                example: "12ms"
          content:
            application/json:
              schema:
                type: object
                required: [status, services, version, timestamp]
                properties:
                  status:
                    type: string
                    enum: [operational, degraded, down]
                  services:
                    type: object
                    additionalProperties:
                      type: object
                      properties:
                        status:
                          type: string
                        latency_ms:
                          type: integer
                        message:
                          type: string
                  version:
                    type: string
                  app_version:
                    type: string
                  timestamp:
                    type: string
                    format: date-time
                  deploy:
                    type: object
                    properties:
                      environment:
                        type: string
                      commit:
                        type: string
                        nullable: true
                      ref:
                        type: string
                        nullable: true
  /api/v1/score:
    post:
      tags: [Intelligence]
      summary: MiCA intelligence score
      operationId: score
      description: |
        Compute an indicative MiCA readiness score (0–100) with grade, five-dimension breakdown,
        classification, gaps, recommendations, and jurisdiction/platform suggestions.
        Accepts free-text `description` and/or structured compliance fields.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/ScoreRequest"
            examples:
              textOnly:
                summary: Free-text description
                value:
                  description: "Retail warehouse Luxembourg €2.5M SPV professional investors whitepaper draft"
              structured:
                summary: Structured fields
                value:
                  asset_type: real_estate
                  issuer_type: company_spv
                  investor_type: professional
                  whitepaper: draft
                  jurisdiction: luxembourg
                  value_eur: 2500000
                  has_kyc: true
                  has_data_room: false
      responses:
        "200":
          description: Score result
          headers:
            X-AUROS-Protocol-Version:
              schema:
                type: string
                example: "1.0"
            X-AUROS-Logo:
              schema:
                type: string
                format: uri
                example: https://getauros.com/auros-logo.svg
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ScoreResponse"
              example:
                disclaimer: "Indicative intelligence only — not legal, tax, or investment advice."
                score: 72
                grade: "B-"
                status: progress
                breakdown:
                  legal_structure: 78
                  kyc_aml: 65
                  mica_compliance: 70
                  data_room: 55
                  investor_protection: 80
                mica_classification: financial_instrument
                critical_gaps:
                  - "Complete whitepaper before retail distribution"
                recommendations:
                  - "Incorporate an EU SPV or regulated fund vehicle before retail distribution."
                recommended_jurisdictions:
                  - id: luxembourg
                    score: 88
                    rationale: "Strong fund/SPV framework for professional real estate RWA."
                recommended_platforms:
                  - id: maple
                    name: Maple
                    category: private_credit
                    apy: 8.2
                meta:
                  version: "1.0"
                  computed_at: "2026-06-11T10:00:00.000Z"
                  full_report_url: "https://getauros.com/wizard"
                  parsed_keywords: ["warehouse", "luxembourg", "spv"]
        "400":
          $ref: "#/components/responses/ValidationError"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimit"
  /api/v1/score/batch:
    post:
      tags: [Intelligence]
      summary: Batch MiCA intelligence scores
      operationId: scoreBatch
      description: |
        Score up to 20 assets in a single request for institutional portfolios.
        Each item accepts the same payload as POST /api/v1/score (free-text `description`
        and/or structured compliance fields).

        **Partial success:** invalid items return `{ ok: false, error }` at their index;
        valid items still receive full score results with `score_id`.

        **Quota:** counts as **1 request** against the monthly API key quota (not N items).
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/ScoreBatchRequest"
            example:
              record_history: true
              items:
                - description: "Retail warehouse Luxembourg €2.5M SPV professional investors"
                - asset_type: bonds
                  issuer_type: company_spv
                  whitepaper: draft
                  has_kyc: true
      responses:
        "200":
          description: Batch score results (may include per-item errors)
          headers:
            X-AUROS-Protocol-Version:
              schema:
                type: string
                example: "1.0"
            X-AUROS-Logo:
              schema:
                type: string
                format: uri
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ScoreBatchResponse"
              example:
                disclaimer: "Indicative intelligence only — not legal, tax, or investment advice."
                total: 2
                succeeded: 2
                failed: 0
                items:
                  - index: 0
                    ok: true
                    score_id: scr_a1b2c3d4e5f6789012345678
                    history_url: https://getauros.com/api/v1/score/scr_a1b2c3d4e5f6789012345678/history
                    score: 72
                    grade: "B-"
                    status: progress
                    mica_classification: financial_instrument
                    breakdown:
                      legal_structure: 78
                      kyc_aml: 65
                      mica_compliance: 70
                      data_room: 55
                      investor_protection: 80
                    critical_gaps: []
                    recommendations: []
                    recommended_jurisdictions: []
                    recommended_platforms: []
                    meta:
                      version: "1.0"
                      computed_at: "2026-06-12T12:00:00.000Z"
                      full_report_url: https://getauros.com/wizard
                      parsed_keywords: []
                  - index: 1
                    ok: false
                    error:
                      code: validation_error
                      message: "Provide description or structured asset/compliance fields"
                meta:
                  version: "1.0"
                  computed_at: "2026-06-12T12:00:00.000Z"
        "400":
          $ref: "#/components/responses/ValidationError"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimit"
  /api/v1/score/{id}/history:
    get:
      tags: [Intelligence]
      summary: Score history for a session or monitor
      operationId: scoreHistory
      description: |
        Return chronological score snapshots for a `scr_*` session (from POST /api/v1/score)
        or a premium `mon_*` monitor. Requires Bearer auth; scoped to the API key that created the session.
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            pattern: "^(scr|mon)_[a-f0-9]{24}$"
          description: Score session id (`scr_…`) or monitor id (`mon_…`)
      responses:
        "200":
          description: Score history entries
          headers:
            X-AUROS-Protocol-Version:
              schema:
                type: string
                example: "1.0"
            X-AUROS-Logo:
              schema:
                type: string
                format: uri
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ScoreHistoryResponse"
              example:
                disclaimer: "Indicative intelligence only — not legal, tax, or investment advice."
                score_id: scr_a1b2c3d4e5f6789012345678
                kind: session
                total: 2
                entries:
                  - id: 1
                    score: 68
                    grade: C+
                    status: progress
                    breakdown:
                      legal_structure: 70
                      kyc_aml: 60
                      mica_compliance: 65
                      data_room: 50
                      investor_protection: 75
                    mica_classification: financial_instrument
                    created_at: "2026-06-12T10:00:00.000Z"
                  - id: 2
                    score: 72
                    grade: B-
                    status: progress
                    breakdown:
                      legal_structure: 78
                      kyc_aml: 65
                      mica_compliance: 70
                      data_room: 55
                      investor_protection: 80
                    mica_classification: financial_instrument
                    created_at: "2026-06-12T11:00:00.000Z"
                meta:
                  version: "1.0"
                  computed_at: "2026-06-12T11:05:00.000Z"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "404":
          $ref: "#/components/responses/NotFound"
        "429":
          $ref: "#/components/responses/RateLimit"
  /api/v1/x402/catalog:
    get:
      tags: [Public]
      summary: x402 paid-route catalog for AI agents
      operationId: x402Catalog
      security: []
      description: |
        Public discovery of AUROS endpoints that accept x402 USDC payments.
        Includes USD prices, dual-access notes (Bearer OR x402), and founder setup
        hints when payments are not yet enabled (`X402_PAY_TO_EVM` unset).
      responses:
        "200":
          description: Catalog
          content:
            application/json:
              schema:
                type: object
                properties:
                  schema: { type: string }
                  enabled: { type: boolean }
                  network_mode: { type: string, enum: [testnet, mainnet] }
                  routes:
                    type: array
                    items:
                      type: object
  /api/v1/promise-gap/card:
    get:
      tags: [Public]
      summary: Freemium Promise Gap card (Verified by AUROS)
      operationId: promiseGapCard
      security: []
      description: |
        Public freemium card for embeds/badges — gap_score, tier, activity badge.
        Indicative only. Full machine brief via Bearer GET /api/v1/promise-gap/brief
        or paid POST /api/v1/promise-gap.

        TTFA agent flow (≤90s, Desk primary):
        1. GET this card (?slug=wepower)
        2. POST /api/v1/agent-toll/spend-gate
        3. GET /api/v1/intelligence/committee-packet?slug=powerledger
        Score remains secondary. invent_gmv=false · health_score=null · fused=false.
      parameters:
        - name: slug
          in: query
          required: true
          schema: { type: string, example: wepower }
      responses:
        "200":
          description: Public card
          content:
            application/json:
              example:
                slug: wepower
                fused: false
                health_score: null
                invent_gmv: false
        "404":
          $ref: "#/components/responses/NotFound"
  /api/v1/promise-gap:
    post:
      tags: [Intelligence]
      summary: Promise Gap machine brief storefront
      operationId: promiseGapStorefront
      description: |
        Paid/Bearer machine Promise Gap pack for a slug ($0.12 x402 when enabled).
        Gap ≠ fraud; Gap ≠ Activity ≠ Variance.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [slug]
              properties:
                slug: { type: string, example: wepower }
      responses:
        "200":
          description: Machine Gap brief
        "401":
          $ref: "#/components/responses/Unauthorized"
        "404":
          $ref: "#/components/responses/NotFound"
  /api/v1/promise-gap/batch:
    post:
      tags: [Intelligence]
      summary: Promise Gap batch screen storefront
      operationId: promiseGapBatch
      description: |
        Screen up to 5 Promise Gap slugs — tier matrix + machine briefs ($0.45 x402).
        Volume discount vs 5× singles. Gap ≠ fraud; Gap ≠ Activity ≠ Variance.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [slugs]
              properties:
                slugs:
                  type: array
                  minItems: 1
                  maxItems: 5
                  items: { type: string }
                  example: [wepower, powerledger, suncontract]
      responses:
        "200":
          description: Batch screen + briefs
        "401":
          $ref: "#/components/responses/Unauthorized"
  /api/v1/agent-toll/status:
    get:
      tags: [Public]
      summary: Agent toll health (storefronts + prepaid wiring)
      operationId: agentTollStatus
      security: []
      description: |
        Public coherence check of agent storefronts, discovery catalogs, and prepaid packs.
        No secrets. Indicative — not a Bazaar listing claim.
      responses:
        "200":
          description: Health snapshot
  /api/v1/agent-toll/market-watch:
    get:
      tags: [Public]
      summary: Free agent vitrine market-watch board
      operationId: agentMarketWatch
      security: []
      description: |
        Free affinity rankings, discovery status, RWA context, honesty layer, and upsell
        to the paid intel pack. Affinity ≠ observed sales. Indicative only.
      parameters:
        - name: refresh
          in: query
          schema: { type: string, enum: ["1"] }
          description: Force refresh when set to 1
      responses:
        "200":
          description: Market-watch board
  /api/v1/agent-toll/market-watch/report:
    post:
      tags: [Intelligence]
      summary: Paid agent-watch intel pack (content + GTM)
      operationId: agentMarketWatchReport
      description: |
        Storefront. Content briefs + anonymous demand heat + monetization plays.
        Dual access Bearer OR x402 ($0.18). No invented partnership claims.
        Indicative — not investment advice.
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                refresh: { type: boolean, example: false }
      responses:
        "200":
          description: Intel pack with content_briefs
        "401":
          $ref: "#/components/responses/Unauthorized"
  /api/v1/agent-toll/spend-gate:
    post:
      tags: [Intelligence]
      summary: Fail-closed Promise Gap spend gate
      operationId: agentSpendGate
      description: |
        Adjunct (not a Bazaar vitrine). ALLOW / CHALLENGE / BLOCK from Promise Gap
        before an agent settles on a slug. Unknown slug never ALLOW.
        Dual access Bearer OR x402 ($0.15). Gap ≠ Activity ≠ Variance.

        TTFA step 2 after freemium Gap card; then committee-packet (step 3).
        production_settlement=false until live settle receipt.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [slug]
              properties:
                slug: { type: string, example: wepower }
            example:
              slug: wepower
      responses:
        "200":
          description: Spend gate decision
          content:
            application/json:
              example:
                decision: CHALLENGE
                fused: false
                invent_gmv: false
                production_settlement: false
        "401":
          $ref: "#/components/responses/Unauthorized"
  /api/v1/green-signal:
    post:
      tags: [Intelligence]
      summary: Green energy/carbon signal storefront
      operationId: greenSignal
      description: |
        Agent storefront. Returns Green composite / Watt / CQS signal for a catalog id
        plus settlement_hint. Dual access Bearer OR x402 ($0.08).
        Indicative — not a certified GO/REC or ESG rating.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [id]
              properties:
                id: { type: string, example: powerledger }
      responses:
        "200":
          description: Green signal
        "401":
          $ref: "#/components/responses/Unauthorized"
        "404":
          $ref: "#/components/responses/NotFound"
  /api/v1/green-transparency/card:
    get:
      tags: [Public]
      summary: Freemium green transparency card
      operationId: greenTransparencyCard
      security: []
      description: |
        Public transparency_score · tier · signal coverage for a Green catalog id.
        Upgrade to POST /api/v1/green-transparency for MiCA-style climate proxies.
      parameters:
        - name: id
          in: query
          required: true
          schema: { type: string, example: powerledger }
      responses:
        "200":
          description: Transparency card
        "404":
          $ref: "#/components/responses/NotFound"
  /api/v1/green-transparency:
    post:
      tags: [Intelligence]
      summary: Green transparency pack (climate proxies)
      operationId: greenTransparency
      description: |
        Agent storefront. Weak-signal fusion (Watt · CQS · Taxonomy · Nature) plus
        MiCA-style climate disclosure proxies with provenance and explicit Scope gaps.
        Dual access Bearer OR x402 ($0.20). Indicative — not a CASP filing or audit.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [id]
              properties:
                id: { type: string, example: powerledger }
      responses:
        "200":
          description: Transparency pack
        "401":
          $ref: "#/components/responses/Unauthorized"
        "404":
          $ref: "#/components/responses/NotFound"
  /api/v1/attestation:
    post:
      tags: [Premium]
      summary: HMAC readiness attestation storefront
      operationId: attestationStorefront
      description: |
        Agent storefront alias of attest create. Dual access premium Bearer OR x402 ($0.15).
        Not a notary act or trade authorization. Optional X-AP2-Payment-Mandate.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/AttestCreateRequest"
      responses:
        "200":
          description: Signed attestation
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/PremiumRequired"
        "503":
          description: Attestation signing not configured
  /api/v1/reconcile:
    post:
      tags: [Premium]
      summary: On-chain / off-chain mismatch exception oracle
      operationId: reconcile
      description: |
        Agent storefront. Opens a HITL reconcile case when ledgers diverge.
        Does not auto-resolve or declare authority. Dual access premium Bearer OR x402 ($0.20).
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [on_chain_ref, observed_mismatch]
              properties:
                on_chain_ref: { type: string }
                observed_mismatch: { type: string }
                off_chain_system:
                  type: string
                  enum: [transfer_agency, custodian, portfolio, other]
                off_chain_ref: { type: string }
                asset_ref: { type: string }
                severity:
                  type: string
                  enum: [low, medium, high]
                authority_hint: { type: string }
      responses:
        "200":
          description: Exception opened
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/PremiumRequired"
  /api/v1/verdict:
    post:
      tags: [Intelligence]
      summary: Compliance decision gate (ALLOW / CHALLENGE / BLOCK)
      operationId: verdict
      description: |
        Issuer-prep decision layer on top of POST /api/v1/score.
        Returns ALLOW when status is ready with no critical gaps, CHALLENGE when
        progress or gaps remain, BLOCK when early. Includes settlement_hint for agent routers.
        Dual access: Bearer API key OR x402 payment ($0.25) when X402_PAY_TO_EVM is set.
        Optional header X-AP2-Payment-Mandate for institutional authorization trails.
        Indicative only — not a CRA rating, notary act, legal opinion, or authorization to trade.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/ScoreRequest"
            examples:
              structured:
                summary: Structured readiness fields
                value:
                  description: "Retail warehouse Luxembourg €2.5M SPV professional investors whitepaper ready"
                  asset_type: real_estate
                  issuer_type: company_spv
                  whitepaper: ready
                  has_kyc: true
                  has_data_room: true
                  documents_count: 6
      responses:
        "200":
          description: Decision gate result
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/VerdictResponse"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimit"
  /api/v1/execution-proof:
    post:
      tags: [Premium]
      summary: Verdict + HMAC attestation + execution recommendation
      operationId: executionProof
      description: |
        Premium. Combines the issuer-prep verdict with a signed readiness attestation
        and an execution recommendation (execute_now | wait | restructure) for the
        intended action. Dual access: premium Bearer OR x402 payment ($1.00) when enabled.
        Not a trade authorization or on-chain settlement instruction.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/ExecutionProofRequest"
      responses:
        "200":
          description: Execution-proof pack
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ExecutionProofResponse"
        "403":
          $ref: "#/components/responses/PremiumRequired"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "503":
          description: Attestation signing not configured
  /api/v1/products:
    get:
      tags: [Catalog]
      summary: RWA product catalog
      operationId: products
      description: Paginated catalog of 120+ tokenized RWA products with APY, TVL, chains, and jurisdiction.
      parameters:
        - name: category
          in: query
          schema:
            type: string
            enum: [stablecoins, real_estate, bonds, commodities, private_credit, all]
            default: all
        - name: jurisdiction
          in: query
          schema:
            type: string
            maxLength: 64
        - name: chain
          in: query
          schema:
            type: string
            maxLength: 64
        - name: yield_min
          in: query
          schema:
            type: number
            minimum: 0
        - name: yield_max
          in: query
          schema:
            type: number
            minimum: 0
        - name: page
          in: query
          schema:
            type: integer
            minimum: 1
            default: 1
        - name: limit
          in: query
          schema:
            type: integer
            minimum: 1
            maximum: 100
            default: 20
        - name: sort
          in: query
          schema:
            type: string
            enum: [apy, tvl, name]
            default: apy
      responses:
        "200":
          description: Paginated products
          headers:
            X-AUROS-Protocol-Version:
              schema:
                type: string
                example: "1.0"
            X-AUROS-Logo:
              schema:
                type: string
                format: uri
                example: https://getauros.com/auros-logo.svg
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ProductsResponse"
        "400":
          $ref: "#/components/responses/ValidationError"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimit"
  /api/v1/benchmarks:
    get:
      tags: [Catalog]
      summary: Sector RWA benchmarks
      operationId: benchmarks
      description: |
        Sector benchmarks (median APY, P25/P75 quartiles, product count) computed from the `/compare` hub.
        Optional `jurisdiction` filter. Falls back to curated static benchmarks when live yield data is sparse (< 3 products).
      security:
        - bearerAuth: []
      parameters:
        - name: category
          in: query
          required: true
          schema:
            type: string
            enum: [bonds, stablecoins, real_estate, private_credit, commodities]
        - name: jurisdiction
          in: query
          schema:
            type: string
            maxLength: 64
          description: Partial match on product jurisdiction (e.g. EU, US, CH, Luxembourg)
      responses:
        "200":
          description: Sector benchmark metrics
          headers:
            X-AUROS-Protocol-Version:
              schema:
                type: string
                example: "1.0"
            X-AUROS-Logo:
              schema:
                type: string
                format: uri
                example: https://getauros.com/auros-logo.svg
            X-Response-Time:
              schema:
                type: string
                example: "18ms"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/BenchmarksResponse"
              example:
                category: bonds
                jurisdiction: EU
                metrics:
                  median_apy: 4.45
                  p25_apy: 4.2
                  p75_apy: 4.7
                  product_count: 9
                as_of: "2026-06-30"
                disclaimer: Indicative intelligence only — not legal, tax, or investment advice.
        "400":
          $ref: "#/components/responses/ValidationError"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimit"
  /api/v1/compare:
    post:
      tags: [Catalog]
      summary: Side-by-side RWA product comparison
      operationId: compare
      description: |
        Compare 2–4 tokenized RWA products side-by-side — mirrors the `/compare` hub.
        Pass explicit `product_ids` or filter criteria (`category`, `yield_min`, `risk_tier`, `jurisdiction`, `limit`).
      security:
        - bearerAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CompareRequest"
            examples:
              byIds:
                summary: Compare by product IDs
                value:
                  product_ids: ["maple-usdc", "realt-portfolio", "backed-bib01"]
              byFilter:
                summary: Compare top matches by filter
                value:
                  category: bonds
                  yield_min: 4
                  risk_tier: core
                  limit: 3
      responses:
        "200":
          description: Structured comparison payload
          headers:
            X-AUROS-Protocol-Version:
              schema:
                type: string
                example: "1.0"
            X-AUROS-Logo:
              schema:
                type: string
                format: uri
                example: https://getauros.com/auros-logo.svg
            X-Response-Time:
              schema:
                type: string
                example: "42ms"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/CompareResponse"
        "400":
          $ref: "#/components/responses/ValidationError"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "404":
          description: Unknown product ID in product_ids mode
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ProtocolError"
        "429":
          $ref: "#/components/responses/RateLimit"
  /api/v1/intelligence:
    get:
      tags: [Desk]
      summary: Unified Intelligence machine index (Étape 13 + #248 entitlements)
      operationId: getIntelligenceIndex
      description: |
        `auros.intelligence.index.v1` — thin façade catalog of EXISTING unfused
        intelligence endpoints keyed by typed_id / desk slug. Public freemium.
        ask=false · seo_factory=false · mega_score=false · fused=false.
        #248 densify: response includes `usage_meter` + `entitlements`
        (`auros.entitlements.matrix.v1`) over existing freemium meter / quotas /
        scopes — invent_meter=false · invent_price=false · no /usage dump.
        Does not invent business logic or fuse Gap≠Activity≠Variance.
        Entity pack: GET /api/v1/intelligence/entity/{id} (Bearer).
      security: []
      responses:
        "200":
          description: Machine index of unfused intelligence endpoints
          content:
            application/json:
              schema:
                type: object
                properties:
                  schema:
                    type: string
                    example: auros.intelligence.index.v1
                  fused:
                    type: boolean
                    enum: [false]
                  ask:
                    type: boolean
                    enum: [false]
                  seo_factory:
                    type: boolean
                    enum: [false]
                  mega_score:
                    type: boolean
                    enum: [false]
                  endpoints:
                    type: array
                    items:
                      type: object
                  usage_meter:
                    type: object
                    description: auros.usage_meter.tip.v1 — fake_billing_product=false
                  entitlements:
                    $ref: "#/components/schemas/EntitlementMatrix"
                  example:
                    type: object
                    properties:
                      entity_id:
                        type: string
                        example: powerledger
                      typed_id:
                        type: string
                        example: "AUROS:ASSET:powerledger"
                      intelligence_entity:
                        type: string
                        example: /api/v1/intelligence/entity/powerledger
        "429":
          $ref: "#/components/responses/RateLimit"
  /api/v1/intelligence/corpus:
    get:
      tags: [Desk]
      summary: Enumerate known RWA corpus rows (agent discovery)
      operationId: getIntelligenceCorpus
      description: |
        `auros.rwa_corpus.v1` — warehouse of EXISTING desk/green rows + declared connectors.
        Agents can list assets AUROS actually knows without already knowing a slug.
        Ordered deterministically by `id` ascending. Not a global RWA universe.

        **Pagination (products convention):** `page` (≥1) + `limit` (1..100, default 20 when paginating).
        Omit both `page` and `limit` → full dump (backward compatible) with
        `pagination.full_dump=true` and honest `total` / `total_pages` (never silently truncated-as-complete).
        Optional `id` returns a single known row (404 if off-tape).

        **Auth:** public freemium (IP rate-limit) or optional Bearer for monthly quota.
        **Honesty:** world_complete=false · invent_coverage=false · invent_tvl=false · invent_apy=false ·
        swamp_scrape=false · tape_neq_world=true · fused=false.
      security: []
      parameters:
        - name: id
          in: query
          required: false
          description: Optional known desk/green id (lowercase). Single-row filter; 404 if absent from corpus.
          schema:
            type: string
            example: powerledger
        - name: page
          in: query
          required: false
          description: 1-based page. Provide with or without limit to enable pagination (vs full dump).
          schema:
            type: integer
            minimum: 1
            default: 1
        - name: limit
          in: query
          required: false
          description: Page size when paginating. Max 100. Default 20 if page is set without limit.
          schema:
            type: integer
            minimum: 1
            maximum: 100
            default: 20
      responses:
        "200":
          description: Corpus rows for this page (or full dump) plus honesty locks and pagination metadata
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/RwaCorpusResponse"
              example:
                schema: auros.rwa_corpus.v1
                world_complete: false
                invent_coverage: false
                fused: false
                swamp_scrape: false
                coverage:
                  row_n: 48
                  returned_n: 20
                  filtered: false
                pagination:
                  page: 1
                  limit: 20
                  total: 48
                  total_pages: 3
                  full_dump: false
                rows:
                  - id: arkreen
                    kind: desk_seed
                    name: Arkreen
                    invent_tvl: false
                    invent_apy: false
                next:
                  page_next: /api/v1/intelligence/corpus?page=2&limit=20
                  search: /api/v1/search?q=
                  resolve: /api/v1/intelligence/resolve?q=
        "400":
          $ref: "#/components/responses/ValidationError"
        "404":
          $ref: "#/components/responses/NotFound"
        "429":
          $ref: "#/components/responses/RateLimit"
  /api/v1/intelligence/v2:
    get:
      tags: [Desk]
      summary: Intelligence API v2 pack / bounded sync export (Phase 3 objects)
      operationId: getIntelligenceApiV2
      description: |
        `auros.intelligence.api.v2` — single freemium pack aggregating coverage · history ·
        changes · signal_candidates · signal_validation · confidence · risk_candidates · alerts
        plus the v1 agent subpack. Optional `sections` densifies a bounded sync export (#246)
        on this same path — no parallel `/export` dump, no warehouse, no invent_export.
        #248: `usage_meter` tip lists this path; Bearer monthly quota INCR at auth;
        inspect remaining via `X-RateLimit-*` + `/developers/dashboard` (no /usage API invent).

        **Auth:** public tip (IP rate-limit) **or** `Authorization: Bearer` with scope
        `intelligence:read`. Missing/invalid key or missing scope → 401 `unauthorized`.
        Monthly quota exceeded → 429 `quota_exceeded`. Public IP burst → 429 `rate_limit`.

        **Honesty locks:** invent_entity/coverage/signal/risk/export/endpoint/meter = false · winner=null ·
        health_score=null · composite=null · fused=false ·
        limits.experimental_explicit / unknown_explicit / conflicting_explicit = true.
        Signal candidates are not confirmed alerts; risk candidates have automatic_verdict=false.
        Example payload below is illustrative of field names — not a live scrape claim.
      parameters:
        - name: sections
          in: query
          required: false
          description: |
            Optional comma-separated or repeated exact v2 section keys
            (`coverage`,`history`,`changes`,`signal_candidates`,`signal_validation`,
            `confidence`,`risk_candidates`,`alerts`,`v1`). Empty/omitted → full pack.
            Unknown names appear in `sections_omitted` — never remapped. Same allowlist as
            MCP `intelligence_v2` / agent interface (#244).
          schema:
            type: string
          examples:
            full:
              summary: Full pack (omit param)
              value: ""
            subset:
              summary: Coverage + alerts only
              value: coverage,alerts
      security: []
      responses:
        "200":
          description: Intelligence API v2 pack with access + usage_meter tip
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/IntelligenceApiV2Response"
              example:
                disclaimer: "Indicative intelligence only — not legal, tax, or investment advice."
                schema: auros.intelligence.api.v2
                method_version: intelligence_api.v2.0
                invent_entity: false
                invent_coverage: false
                invent_signal: false
                invent_risk: false
                invent_export: false
                invent_endpoint: false
                health_score: null
                composite: null
                fused: false
                winner: null
                as_of: "2026-11-28"
                export_schema: auros.intelligence.export.v1
                exported_at: "2026-11-30T12:00:00.000Z"
                limits:
                  freemium: true
                  experimental_explicit: true
                  unknown_explicit: true
                  conflicting_explicit: true
                coverage:
                  schema: auros.intelligence.global_coverage.v1
                history:
                  schema: auros.intelligence.historical_metric.v1
                  series: []
                changes:
                  schema: auros.intelligence.cross_asset_change.v1
                  events: []
                signal_candidates:
                  schema: auros.intelligence.signal_candidate.v1
                  candidates: []
                signal_validation:
                  schema: auros.intelligence.signal_validation.v1
                confidence:
                  schema: auros.intelligence.confidence_evidence.v1
                risk_candidates:
                  schema: auros.intelligence.risk_anomaly.v1
                  candidates: []
                alerts:
                  schema: auros.intelligence.alerts_watchlists.v1
                  watches: []
                  alerts: []
                v1:
                  schema: auros.intelligence.agent_api.v1
                reason: intelligence_api_v2·phase3_objects·provenance_kept
                access: public
                usage_meter:
                  schema: auros.usage_meter.tip.v1
                  fake_billing_product: false
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimit"
  /api/v1/intelligence/committee-packet:
    get:
      tags: [Desk]
      summary: Committee packet (IC compose · not sealed)
      operationId: getCommitteePacket
      description: |
        Compose Gap · Activity · Variance + spend_gate + Evidence IC + cite_receipt.
        winner=null · committee_sealed=false · health_score=null · invent_casp=false.
        TTFA step 3 after Gap card → spend_gate. Not a sealed IC note.
      security: []
      parameters:
        - in: query
          name: slug
          required: true
          schema:
            type: string
          example: powerledger
      responses:
        "200":
          description: Unfused committee packet
          content:
            application/json:
              example:
                schema: auros.committee.packet.v1
                entity_id: powerledger
                fused: false
                winner: null
                health_score: null
                committee_sealed: false
                invent_gmv: false
                cite_receipt:
                  pointers: []
        "400":
          description: Missing slug
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ProtocolError"
        "429":
          $ref: "#/components/responses/RateLimit"
  /api/v1/intelligence/machine-brief:
    get:
      tags: [Desk]
      summary: One unfused machine brief (compact=1 optional)
      operationId: getMachineBrief
      description: |
        `auros.machine.brief.v1` — reading, UNKNOWN count, spend_gate, MiCA pointers, pay 402.
        `compact=1` returns state_phrase, spend_gate, unknowns_n, a short Gap/badge series, and upgrade_url.
        health_score stays null. fused=false. Off-tape is on_tape=false, not a world-404.
        Vague E densify: `eye_of_finance` carries cite_receipt_gate (refuse_until_cited when silent),
        twin_clock (claim×tape×market×physical · average=false), `auros.cite.v1` paste spec,
        absence_ledger, counterfactual mirror, reality_diff, witness_refusal, dual_eye, cite_reuse_n,
        friction settle companion. invent_*=false. No new MCP tool.
        Companion to TTFA: Gap card → spend_gate → committee-packet (this brief is one-hop secondary).
        Paste protocol: see /developers/for-agents · schema `auros.cite.v1`.
      security: []
      parameters:
        - in: query
          name: slug
          required: true
          schema:
            type: string
          example: powerledger
        - in: query
          name: compact
          required: false
          schema:
            type: string
            enum: ["1"]
      responses:
        "200":
          description: Unfused brief, or the compact projection
          content:
            application/json:
              schema:
                type: object
                properties:
                  schema:
                    type: string
                    example: auros.machine.brief.v1
                  fused:
                    type: boolean
                    enum: [false]
                  health_score:
                    nullable: true
                    example: null
                  compact:
                    type: boolean
        "400":
          description: Missing slug
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ProtocolError"
        "429":
          $ref: "#/components/responses/RateLimit"
  /api/v1/intelligence/asset-memory:
    get:
      tags: [Desk]
      summary: Asset Memory Change Dossier (V1–V3 change_brief)
      operationId: getAssetMemory
      description: |
        `auros.asset_memory.change.response.v1` — compose-only Change Dossier for one desk Gap slug.
        Includes V2 `observations[]` (`claim_recheck` ≠ `edition_tip`) and V3 `change_brief`
        (summary_line · claim_deltas · edition_deltas · citations).
        claim_vs_world=claim_observation_only · world_change=unknown · invent_claim_n2=false ·
        invent_world_change=false · independent_confirmation=false · health_score=null ·
        action_recommended=false · no fraud · no advice · Change Radar out of scope.
        Freemium meter. Absence ≠ world-absent.
      security: []
      parameters:
        - in: query
          name: slug
          required: true
          schema:
            type: string
          example: powerledger
      responses:
        "200":
          description: Change Dossier with change_brief
          content:
            application/json:
              schema:
                type: object
                properties:
                  schema:
                    type: string
                    example: auros.asset_memory.change.response.v1
                  invent_world_change:
                    type: boolean
                    enum: [false]
                  fused:
                    type: boolean
                    enum: [false]
                  health_score:
                    nullable: true
                    example: null
                  action_recommended:
                    type: boolean
                    enum: [false]
                  dossier:
                    type: object
                    description: auros.asset_memory.change.v1 including change_brief
        "400":
          description: Missing slug
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ProtocolError"
        "404":
          description: Slug not in desk Gap index
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ProtocolError"
        "429":
          $ref: "#/components/responses/RateLimit"
  /api/v1/intelligence/worker:
    get:
      tags: [Desk]
      summary: Intelligence Worker MVP (verify soft pointer)
      operationId: getIntelligenceWorker
      description: |
        Sync compose over resolve + existing packs. `mode=verify` is a soft pointer
        to Asset Memory change_brief — Worker does not pack or invent the brief.
        do_not_auto_execute · invent_*=false · action_recommended=false · fused=false.
        Freemium meter. Absence ≠ world-absent.
      security: []
      parameters:
        - in: query
          name: slug
          required: false
          schema:
            type: string
          example: powerledger
        - in: query
          name: mode
          required: false
          schema:
            type: string
            enum: [verify]
          example: verify
      responses:
        "200":
          description: Worker pack (verify pointer · no invented change_brief)
          content:
            application/json:
              schema:
                type: object
                properties:
                  invent_fetch:
                    type: boolean
                    enum: [false]
                  action_recommended:
                    type: boolean
                    enum: [false]
                  fused:
                    type: boolean
                    enum: [false]
        "429":
          $ref: "#/components/responses/RateLimit"
  /api/v1/intelligence/entity/{id}:
    get:
      tags: [Desk]
      summary: Unified Intelligence entity pack (Étape 13)
      operationId: getIntelligenceEntity
      description: |
        `auros.intelligence.unified.v1` — asset_profile tip + links to existing
        entity / events / search / gap / activity / variance / freshness / desk.
        Reuses assembleEntityV1 — no duplicate Gap/Activity/Variance logic.
        ask=false · seo_factory=false · mega_score=false · fused=false.
        Query-style agent bundle still at GET /api/v1/intelligence/entity?id=.
      security:
        - bearerAuth: []
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            example: powerledger
          description: Energy desk slug (or typed id segment)
      responses:
        "200":
          description: Unified entity pack — asset_profile tip + links
          content:
            application/json:
              schema:
                type: object
                properties:
                  schema:
                    type: string
                    example: auros.intelligence.unified.v1
                  fused:
                    type: boolean
                    enum: [false]
                  ask:
                    type: boolean
                    enum: [false]
                  seo_factory:
                    type: boolean
                    enum: [false]
                  mega_score:
                    type: boolean
                    enum: [false]
                  entity_id:
                    type: string
                    example: powerledger
                  typed_id:
                    type: string
                    example: "AUROS:ASSET:powerledger"
                  asset_profile:
                    type: object
                    description: auros.asset_profile.tip.v1 (reused)
                  signals:
                    type: array
                    description: Unfused Gap ≠ Activity ≠ Variance pointers
                  links:
                    type: object
                    description: Paths to existing entity/events/search/gap/activity/variance/freshness/desk
        "401":
          $ref: "#/components/responses/Unauthorized"
        "404":
          $ref: "#/components/responses/NotFound"
        "429":
          $ref: "#/components/responses/RateLimit"
  /api/v1/intelligence/agent-watt:
    get:
      tags: [Desk]
      summary: Agent Watt Expect (AI×spot×load)
      operationId: intelligenceAgentWatt
      description: |
        `auros.agent.watt.expect.pack.v1` — AI literature × spot × load × daylight.
        invent_live_dc_mw=false · market_ready=false · winner=null · health_score=null.
        format=brief for paste_line. feed_freshness · latency sample · attribution.
        Call after Gap→Activity→Variance tunnel. Adjunct · storefront=false until settle.
      security: []
      parameters:
        - name: slug
          in: query
          required: false
          schema:
            type: string
            example: auros-kwh-france-lab
        - name: format
          in: query
          required: false
          schema:
            type: string
            enum: [brief]
      responses:
        "200":
          description: Agent Watt Expect pack or brief
        "429":
          $ref: "#/components/responses/RateLimit"
  /api/v1/intelligence/planet-surface:
    get:
      tags: [Desk]
      summary: Planet surface (sky pins · utility matrix)
      operationId: intelligencePlanetSurface
      description: |
        Curated sky pins · unfused weather/daylight/spot/load layers.
        invent_quartier=false · invent_satellite=false · format=brief · paste_line.
        After Gap→Activity→Variance. Adjunct · storefront=false until settle.
      security: []
      parameters:
        - name: slug
          in: query
          required: false
          schema:
            type: string
            example: auros-kwh-france-lab
        - name: continent
          in: query
          required: false
          schema:
            type: string
        - name: format
          in: query
          required: false
          schema:
            type: string
            enum: [brief]
      responses:
        "200":
          description: Planet surface pack or brief
        "429":
          $ref: "#/components/responses/RateLimit"
  /api/v1/intelligence/physical-cross:
    get:
      tags: [Desk]
      summary: Physical Cross (unfused channels)
      operationId: intelligencePhysicalCross
      description: |
        Cumulate + cross Physical channels without Health_Score · winner=null.
        format=brief · paste_line · latency honesty tip.
        After Gap→Activity→Variance. Adjunct · storefront=false until settle.
      security: []
      parameters:
        - name: slug
          in: query
          required: false
          schema:
            type: string
            example: auros-kwh-france-lab
        - name: format
          in: query
          required: false
          schema:
            type: string
            enum: [brief]
      responses:
        "200":
          description: Physical Cross pack or brief
        "429":
          $ref: "#/components/responses/RateLimit"
  /api/v1/intelligence/weather-memory:
    get:
      tags: [Desk]
      summary: Weather Memory / Physical Expect
      operationId: intelligenceWeatherMemory
      description: |
        Physical Expect · 3 horizons · unfused tips. Silent without GPS stamp.
        weather≠variance≠gap · format=brief · paste_line · invent_satellite=false.
        After Gap→Activity→Variance. Adjunct · storefront=false until settle.
      security: []
      parameters:
        - name: slug
          in: query
          required: true
          schema:
            type: string
            example: auros-kwh-france-lab
        - name: format
          in: query
          required: false
          schema:
            type: string
            enum: [brief]
      responses:
        "200":
          description: Weather memory pack or brief
        "400":
          $ref: "#/components/responses/ValidationError"
        "429":
          $ref: "#/components/responses/RateLimit"
  /api/v1/intelligence/resolve:
    get:
      tags: [Desk]
      summary: Thin Search / AUROS ID resolve tip (Étape 10)
      operationId: resolveIntelligence
      description: |
        Alias of GET /api/v1/search — desk-seed alias ranks.
        ask=false · marketing_hero=false · never ticker auto-merge.
      security: []
      parameters:
        - name: q
          in: query
          required: true
          schema:
            type: string
            example: powerledger
          description: Desk slug · typed id · contract · coingecko id
      responses:
        "200":
          description: Resolve tip (resolved · ambiguous · candidates)
        "404":
          description: not_found
        "429":
          $ref: "#/components/responses/RateLimit"
  /api/v1/search:
    get:
      tags: [Desk]
      summary: Thin Search / resolve tip (Étape 10)
      operationId: searchIntelligence
      description: |
        Public freemium Search tip — same as /api/v1/intelligence/resolve.
        ask=false · marketing_hero=false. Prefer this path name for agents.
      security: []
      parameters:
        - name: q
          in: query
          required: true
          schema:
            type: string
            example: powerledger
      responses:
        "200":
          description: Resolve tip
        "404":
          description: not_found
        "429":
          $ref: "#/components/responses/RateLimit"
  /api/v1/desk/brief:
    get:
      tags: [Desk]
      summary: Unfused Gap · Activity · Variance lab pack (v3)
      operationId: deskBrief
      description: |
        Machine desk brief `auros.desk.brief.v3` — Promise Gap, Activity, and Variance lab
        as three signals with provenance (source · as_of · quality). Variance includes
        meter_profile and last_2/4/8 window rollups. `fused: false`.
        JSON Schema id `auros.desk.brief.v3` (edition_alignment plus the three signals).
        Docs: `/developers/docs/endpoint-desk-brief`.
      security:
        - bearerAuth: []
      parameters:
        - name: slug
          in: query
          required: false
          schema:
            type: string
            example: wepower
          description: Activity / Promise Gap energy slug (default = featured desk tour)
      responses:
        "200":
          description: Desk brief machine pack + content_hash
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/MachineBriefPack"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "404":
          $ref: "#/components/responses/NotFound"
        "429":
          $ref: "#/components/responses/RateLimit"
  /api/v1/promise-gap/brief:
    get:
      tags: [Desk]
      summary: Promise Gap machine brief
      operationId: promiseGapBrief
      description: |
        `auros.promise_gap.brief.v1` — claim intensity vs measured activity, provenance,
        LODO envelope, drivers, NLI claim_evidence. High gap ≠ fraud. Docs: `/developers/docs/endpoint-promise-gap-brief`.
      security:
        - bearerAuth: []
      parameters:
        - name: slug
          in: query
          required: true
          schema:
            type: string
            example: wepower
      responses:
        "200":
          description: Promise Gap machine pack
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/MachineBriefPack"
        "400":
          $ref: "#/components/responses/ValidationError"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "404":
          $ref: "#/components/responses/NotFound"
        "429":
          $ref: "#/components/responses/RateLimit"
  /api/v1/activity/brief:
    get:
      tags: [Desk]
      summary: Activity Index machine brief
      operationId: activityBrief
      description: |
        `auros.activity.brief.v1` — score, badge, LODO envelope, provenance, overlays.
        Wash detection off. Docs: `/developers/docs/endpoint-activity-brief`.
      security:
        - bearerAuth: []
      parameters:
        - name: slug
          in: query
          required: true
          schema:
            type: string
            example: powerledger
      responses:
        "200":
          description: Activity machine pack
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/MachineBriefPack"
        "400":
          $ref: "#/components/responses/ValidationError"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "404":
          $ref: "#/components/responses/NotFound"
        "429":
          $ref: "#/components/responses/RateLimit"
  /api/v1/variance/brief:
    get:
      tags: [Desk]
      summary: Variance Oracle lab brief (v2)
      operationId: varianceBrief
      description: |
        `auros.variance.brief.v2` — promised vs attested Wh, meter_profile, provenance,
        last_2/4/8 rollups, collateral factor. Lab window — not market Gap/Activity.
        Docs: `/developers/docs/endpoint-variance-brief`.
      security:
        - bearerAuth: []
      parameters:
        - name: token
          in: query
          required: false
          schema:
            type: string
          description: Optional 0x lab token; omit for AUROS demo window
      responses:
        "200":
          description: Variance lab machine pack
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/MachineBriefPack"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "404":
          $ref: "#/components/responses/NotFound"
        "429":
          $ref: "#/components/responses/RateLimit"
  /api/v1/freshness/brief:
    get:
      tags: [Desk]
      summary: Freshness Index machine brief (v2)
      operationId: freshnessBrief
      description: |
        `auros.freshness.brief.v2` — Compare cache age Fresh/Stale/Unknown + provenance.
        Not a trade clock. Docs: `/developers/docs/endpoint-freshness-brief`.
      security:
        - bearerAuth: []
      parameters:
        - name: id
          in: query
          required: true
          schema:
            type: string
            example: live::a
          description: Compare product id (URL-encode if contains ::)
      responses:
        "200":
          description: Freshness machine pack
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/MachineBriefPack"
        "400":
          $ref: "#/components/responses/ValidationError"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "404":
          $ref: "#/components/responses/NotFound"
        "429":
          $ref: "#/components/responses/RateLimit"
  /api/v1/transparency/brief:
    get:
      tags: [Desk]
      summary: Transparency Depth machine brief (v2)
      operationId: transparencyBrief
      description: |
        `auros.transparency.brief.v2` — Thin/Partial/Deep public-record depth + provenance.
        Docs: `/developers/docs/endpoint-transparency-brief`.
      security:
        - bearerAuth: []
      parameters:
        - name: id
          in: query
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Transparency machine pack
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/MachineBriefPack"
        "400":
          $ref: "#/components/responses/ValidationError"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "404":
          $ref: "#/components/responses/NotFound"
        "429":
          $ref: "#/components/responses/RateLimit"
  /api/v1/friction/brief:
    get:
      tags: [Desk]
      summary: Jurisdiction Friction machine brief (v2)
      operationId: frictionBrief
      description: |
        `auros.friction.brief.v2` — structuring friction (Lower/Moderate/Higher) + provenance.
        Not legal advice. Docs: `/developers/docs/endpoint-friction-brief`.
      security:
        - bearerAuth: []
      parameters:
        - name: id
          in: query
          required: true
          schema:
            type: string
            example: luxembourg
      responses:
        "200":
          description: Friction machine pack
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/MachineBriefPack"
        "400":
          $ref: "#/components/responses/ValidationError"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "404":
          $ref: "#/components/responses/NotFound"
        "429":
          $ref: "#/components/responses/RateLimit"
  /api/v1/jurisdictions:
    get:
      tags: [Intelligence]
      summary: Jurisdiction ranking
      operationId: jurisdictions
      description: Rank regulatory jurisdictions by asset type, investor profile, timeline, and budget.
      parameters:
        - name: asset_type
          in: query
          schema:
            type: string
            enum: [real_estate, bonds, private_credit, funds, all]
            default: all
        - name: investor_type
          in: query
          schema:
            type: string
            enum: [professional, retail, mixed, all]
            default: all
        - name: timeline_months
          in: query
          schema:
            type: integer
            minimum: 1
            maximum: 36
        - name: budget
          in: query
          schema:
            type: integer
            minimum: 0
      responses:
        "200":
          description: Ranked jurisdictions
          headers:
            X-AUROS-Protocol-Version:
              schema:
                type: string
                example: "1.0"
            X-AUROS-Logo:
              schema:
                type: string
                format: uri
                example: https://getauros.com/auros-logo.svg
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/JurisdictionsResponse"
        "400":
          $ref: "#/components/responses/ValidationError"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimit"
  /api/v1/agent-credits/checkout:
    post:
      tags: [Billing]
      summary: Prepaid Agent Credits / Pilot / auto-refill checkout
      operationId: agentCreditsCheckout
      description: |
        Create Stripe Checkout for Agent Credits packs (starter/growth/desk),
        monthly auto-refill, or Pilot Agent Readiness.
        Humans fund EUR; agents spend credits on storefronts via Bearer. Indicative toll only.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [email]
              properties:
                email: { type: string, format: email }
                product:
                  type: string
                  enum: [agent_credits_pack, agent_pilot_pack, agent_credits_refill]
                pack:
                  type: string
                  enum: [starter, growth, desk]
                locale: { type: string }
                company: { type: string }
                apiKey: { type: string }
      responses:
        "200":
          description: Checkout URL
        "503":
          description: Stripe unconfigured
  /api/v1/agent-credits/balance:
    get:
      tags: [Billing]
      summary: Prepaid Agent Credits balance
      operationId: agentCreditsBalance
      description: |
        Bearer — returns key + email credit balances (1 credit ≈ $0.01 catalog)
        plus low-balance upsell / refill hints when applicable.
      security:
        - BearerAuth: []
      responses:
        "200":
          description: Balance
        "401":
          $ref: "#/components/responses/Unauthorized"
  /api/v1/checklist:
    post:
      tags: [Intelligence]
      summary: Compliance checklist storefront
      operationId: checklist
      description: |
        Issuer-prep compliance checklist (20+ items). Dual access Bearer OR x402 ($0.10).
        Indicative — not legal advice.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/ChecklistRequest"
            example:
              asset_type: real_estate
              jurisdiction: luxembourg
              structure: spv
      responses:
        "200":
          description: Checklist items
          headers:
            X-AUROS-Protocol-Version:
              schema:
                type: string
                example: "1.0"
            X-AUROS-Logo:
              schema:
                type: string
                format: uri
                example: https://getauros.com/auros-logo.svg
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ChecklistResponse"
        "400":
          $ref: "#/components/responses/ValidationError"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimit"
  /api/v1/keys:
    post:
      tags: [Keys]
      summary: Create API key
      operationId: createKey
      security: []
      description: |
        Request a free-tier API key (1000 requests/month). No authentication required.
        Rate-limited by IP (5 requests/hour). The raw key is returned once — store securely.
        New keys receive status `active` and scopes `protocol:read` + `intelligence:read`.
        Duplicate email returns `already_exists` without replaying the secret.
        Revoke: `POST /api/v1/keys/revoke`. Rotate: `POST /api/v1/keys/rotate`.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CreateKeyRequest"
            example:
              email: developer@company.com
      responses:
        "200":
          description: Key created
          headers:
            X-AUROS-Protocol-Version:
              schema:
                type: string
                example: "1.0"
            X-AUROS-Logo:
              schema:
                type: string
                format: uri
                example: https://getauros.com/auros-logo.svg
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/CreateKeyResponse"
              example:
                disclaimer: "Indicative intelligence only — not legal, tax, or investment advice."
                ok: true
                api_key: auros_pk_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
                tier: free
                monthly_limit: 1000
                scopes: [protocol:read, intelligence:read]
                status: active
                message: "Store this key securely — it will not be shown again."
        "400":
          $ref: "#/components/responses/ValidationError"
        "429":
          $ref: "#/components/responses/RateLimit"
  /api/v1/keys/revoke:
    post:
      tags: [Keys]
      summary: Revoke the Bearer API key
      operationId: revokeKey
      description: |
        Revokes the caller's API key (`status=revoked`). Requires Bearer auth.
        Response is metadata only — never returns secret material.
        Demo key cannot be revoked. Already-revoked / invalid → 401 `unauthorized`.
      responses:
        "200":
          description: Key revoked
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/RevokeKeyResponse"
              example:
                disclaimer: "Indicative intelligence only — not legal, tax, or investment advice."
                ok: true
                status: revoked
                id: "0123456789abcdef0123456789abcdef"
                prefix: live
                message: "API key revoked. It can no longer authenticate requests."
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimit"
  /api/v1/keys/rotate:
    post:
      tags: [Keys]
      summary: Rotate the Bearer API key
      operationId: rotateKey
      description: |
        Revokes the caller's active key and mints a replacement for the same email/scopes/tier.
        New `api_key` is returned **once**. Previous hash becomes invalid immediately.
        Demo key cannot be rotated.
      responses:
        "200":
          description: New key minted; previous revoked
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/RotateKeyResponse"
              example:
                disclaimer: "Indicative intelligence only — not legal, tax, or investment advice."
                ok: true
                api_key: auros_pk_live_yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy
                tier: free
                monthly_limit: 1000
                scopes: [protocol:read, intelligence:read]
                prefix: live
                revoked: true
                message: "Store this key securely — it will not be shown again. The previous key is revoked."
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimit"
  /api/v1/monitor:
    post:
      tags: [Premium]
      summary: Register asset monitor
      operationId: monitor
      description: |
        Premium endpoint. Register an asset profile for regulatory monitoring.
        Requires `auros_pk_live_*` or premium tier. Pricing: 49€/mo (5 assets), 199€/mo (25 assets).
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/MonitorRequest"
      responses:
        "201":
          description: Monitor created
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/MonitorResponse"
        "403":
          $ref: "#/components/responses/PremiumRequired"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "400":
          $ref: "#/components/responses/ValidationError"
  /api/v1/monitor/{id}:
    get:
      tags: [Premium]
      summary: Get monitor status
      operationId: getMonitor
      parameters:
        - name: id
          in: path
          required: true
          schema: { type: string }
      responses:
        "200":
          description: Monitor status
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/MonitorResponse"
        "403":
          $ref: "#/components/responses/PremiumRequired"
        "404":
          description: Not found
    delete:
      tags: [Premium]
      summary: Delete monitor
      operationId: deleteMonitor
      parameters:
        - name: id
          in: path
          required: true
          schema: { type: string }
      responses:
        "200":
          description: Deleted
        "403":
          $ref: "#/components/responses/PremiumRequired"
        "404":
          description: Not found
  /api/v1/dossier:
    post:
      tags: [Premium]
      summary: Generate institutional dossier
      operationId: dossier
      description: |
        Premium endpoint. Generate PDF or JSON institutional MiCA readiness report.
        PDF returns HMAC-signed download_url valid 24h.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/DossierRequest"
      responses:
        "200":
          description: Dossier generated
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/DossierResponse"
        "403":
          $ref: "#/components/responses/PremiumRequired"
        "401":
          $ref: "#/components/responses/Unauthorized"
  /api/v1/attest:
    post:
      tags: [Premium]
      summary: Create readiness attestation
      operationId: createAttestation
      description: |
        Premium. SHA-256 of a canonical readiness snapshot + HMAC signature.
        Public verify via GET /api/v1/attest/verify and UI /attest/{id}.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/AttestCreateRequest"
      responses:
        "200":
          description: Attestation created
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/AttestResponse"
        "403":
          $ref: "#/components/responses/PremiumRequired"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "503":
          description: Signing key not configured
  /api/v1/attest/verify:
    get:
      tags: [Public]
      summary: Verify readiness attestation
      operationId: verifyAttestation
      security: []
      description: |
        Public. Query `id` for stored attestation, or `hash`+`sig` for stateless HMAC check.
      parameters:
        - name: id
          in: query
          schema: { type: string }
        - name: hash
          in: query
          schema: { type: string, pattern: "^[a-f0-9]{64}$" }
        - name: sig
          in: query
          schema: { type: string, pattern: "^[a-f0-9]{64}$" }
      responses:
        "200":
          description: Verification result
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/AttestVerifyResponse"
        "404":
          description: Attestation not found
  /api/v1/attest/{id}:
    get:
      tags: [Public]
      summary: Get attestation by id
      operationId: getAttestation
      security: []
      parameters:
        - name: id
          in: path
          required: true
          schema: { type: string }
      responses:
        "200":
          description: Attestation
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/AttestResponse"
        "404":
          description: Not found
  /api/v1/chargeflow:
    get:
      tags: [Premium]
      summary: List ChargeFlow units for API key
      operationId: listChargeflow
      description: |
        Premium. Returns CFU-E/W/F minted by this key. Filter with kind (e|w|f) and status (active|retired).
        Console UI: /green/chargeflow/console.
      parameters:
        - name: kind
          in: query
          schema: { type: string, enum: [e, w, f] }
        - name: status
          in: query
          schema: { type: string, enum: [active, retired] }
        - name: operator_id
          in: query
          schema: { type: string }
        - name: limit
          in: query
          schema: { type: integer, minimum: 1, maximum: 100, default: 50 }
        - name: offset
          in: query
          schema: { type: integer, minimum: 0, default: 0 }
      responses:
        "200":
          description: Unit list
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ChargeflowListResponse"
        "403":
          $ref: "#/components/responses/PremiumRequired"
        "401":
          $ref: "#/components/responses/Unauthorized"
    post:
      tags: [Premium]
      summary: Register CFU-E charge session unit
      operationId: createChargeflowCfuE
      description: |
        Premium. Off-chain ChargeFlow Unit Energy — SHA-256 + HMAC (`auros-cfu-e:v1:`).
        Rejects duplicate active mint for same key + operator + external_session_id (409).
        Public verify via GET /api/v1/chargeflow/verify and UI /chargeflow/{id}.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/ChargeflowCreateRequest"
      responses:
        "200":
          description: CFU-E registered
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ChargeflowResponse"
        "409":
          description: Active unit already exists for this session
        "403":
          $ref: "#/components/responses/PremiumRequired"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "503":
          description: Signing key not configured
  /api/v1/chargeflow/batch:
    post:
      tags: [Premium]
      summary: Batch register CFU-E units
      operationId: createChargeflowCfuEBatch
      description: |
        Premium. Up to 50 CFU-E mints per call. Partial success — per-item ok/error.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/ChargeflowEBatchRequest"
      responses:
        "200":
          description: Batch result
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ChargeflowBatchResponse"
        "403":
          $ref: "#/components/responses/PremiumRequired"
        "401":
          $ref: "#/components/responses/Unauthorized"
  /api/v1/chargeflow/from-ocpi:
    post:
      tags: [Premium]
      summary: Map offline OCPI CDR / CSV rows to CFU-E
      operationId: createChargeflowFromOcpi
      description: |
        Premium. Offline stub — accepts OCPI-like CDRs and/or CSV session rows (max 50 total).
        Not a live OCPI connection. Maps to CFU-E mint with source_format ocpi|csv.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/ChargeflowFromOcpiRequest"
      responses:
        "200":
          description: Batch mint result
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ChargeflowFromOcpiResponse"
        "403":
          $ref: "#/components/responses/PremiumRequired"
        "401":
          $ref: "#/components/responses/Unauthorized"
  /api/v1/chargeflow/partners:
    get:
      tags: [Public]
      summary: List ChargeFlow partner connectors
      operationId: listChargeflowPartners
      security: []
      description: |
        Public catalogue of format-compatible connectors (Tesla Fleet, TotalEnergies OCPI, generic OCPI).
        Not an official manufacturer partnership endorsement.
      responses:
        "200":
          description: Partner catalogue
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ChargeflowPartnersListResponse"
  /api/v1/chargeflow/partners/sync:
    post:
      tags: [Premium]
      summary: Sync partner sessions to CFU-E
      operationId: syncChargeflowPartner
      description: |
        Premium. Sandbox uses fixtures (no credentials). Live requires partner tokens (not stored).
        Compatible API/format adapters only — not an official Tesla or TotalEnergies partnership.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/ChargeflowPartnerSyncRequest"
      responses:
        "200":
          description: Batch mint result
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ChargeflowPartnerSyncResponse"
        "400":
          description: Validation or credentials_required
        "403":
          $ref: "#/components/responses/PremiumRequired"
        "401":
          $ref: "#/components/responses/Unauthorized"
  /api/v1/chargeflow/verify:
    get:
      tags: [Public]
      summary: Verify ChargeFlow unit (E or W)
      operationId: verifyChargeflow
      security: []
      parameters:
        - name: id
          in: query
          schema: { type: string }
        - name: hash
          in: query
          schema: { type: string, pattern: "^[a-f0-9]{64}$" }
        - name: sig
          in: query
          schema: { type: string, pattern: "^[a-f0-9]{64}$" }
      responses:
        "200":
          description: Verification result
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ChargeflowResponse"
        "404":
          description: Not found
  /api/v1/chargeflow/{id}:
    get:
      tags: [Public]
      summary: Get ChargeFlow unit by id
      operationId: getChargeflow
      security: []
      parameters:
        - name: id
          in: path
          required: true
          schema: { type: string }
      responses:
        "200":
          description: Unit
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ChargeflowResponse"
        "404":
          description: Not found
  /api/v1/chargeflow/{id}/retire:
    post:
      tags: [Premium]
      summary: Retire an active ChargeFlow unit
      operationId: retireChargeflow
      description: |
        Premium. Marks unit retired without re-signing the mint hash.
        Same API key that minted the unit required.
      parameters:
        - name: id
          in: path
          required: true
          schema: { type: string }
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                reason: { type: string, maxLength: 500 }
      responses:
        "200":
          description: Retired unit
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ChargeflowResponse"
        "403":
          $ref: "#/components/responses/PremiumRequired"
        "404":
          description: Not found
  /api/v1/chargeflow/demo:
    post:
      tags: [Public]
      summary: Sandbox CFU-E mint
      operationId: demoChargeflowCfuE
      security: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/ChargeflowCreateRequest"
      responses:
        "200":
          description: Demo unit
  /api/v1/chargeflow/w:
    post:
      tags: [Premium]
      summary: Register CFU-W hydrological flow unit
      operationId: createChargeflowCfuW
      description: |
        Premium. Off-chain ChargeFlow Unit Water — SHA-256 + HMAC (`auros-cfu-w:v1:`) + H₂O companion.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/ChargeflowWCreateRequest"
      responses:
        "200":
          description: CFU-W registered
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ChargeflowResponse"
        "409":
          description: Active unit already exists for this flow
        "403":
          $ref: "#/components/responses/PremiumRequired"
  /api/v1/chargeflow/w/batch:
    post:
      tags: [Premium]
      summary: Batch register CFU-W units
      operationId: createChargeflowCfuWBatch
      description: Premium. Up to 50 CFU-W mints; partial success.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/ChargeflowWBatchRequest"
      responses:
        "200":
          description: Batch result
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ChargeflowBatchResponse"
        "403":
          $ref: "#/components/responses/PremiumRequired"
  /api/v1/chargeflow/w/verify:
    get:
      tags: [Public]
      summary: Verify CFU-W unit
      operationId: verifyChargeflowW
      security: []
      parameters:
        - name: id
          in: query
          schema: { type: string }
        - name: hash
          in: query
          schema: { type: string }
        - name: sig
          in: query
          schema: { type: string }
      responses:
        "200":
          description: Verification result
  /api/v1/chargeflow/w/demo:
    post:
      tags: [Public]
      summary: Sandbox CFU-W mint
      operationId: demoChargeflowCfuW
      security: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/ChargeflowWCreateRequest"
      responses:
        "200":
          description: Demo unit
  /api/v1/chargeflow/f:
    post:
      tags: [Premium]
      summary: Register CFU-F flexibility window unit
      operationId: createChargeflowCfuF
      description: |
        Premium. Off-chain ChargeFlow Unit Flex — SHA-256 + HMAC (`auros-cfu-f:v1:`) + Watt companion.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/ChargeflowFCreateRequest"
      responses:
        "200":
          description: CFU-F registered
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ChargeflowResponse"
        "409":
          description: Active unit already exists for this window
        "403":
          $ref: "#/components/responses/PremiumRequired"
  /api/v1/chargeflow/f/batch:
    post:
      tags: [Premium]
      summary: Batch register CFU-F units
      operationId: createChargeflowCfuFBatch
      description: Premium. Up to 50 CFU-F mints; partial success.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/ChargeflowFBatchRequest"
      responses:
        "200":
          description: Batch result
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ChargeflowBatchResponse"
        "403":
          $ref: "#/components/responses/PremiumRequired"
  /api/v1/chargeflow/f/verify:
    get:
      tags: [Public]
      summary: Verify CFU-F unit
      operationId: verifyChargeflowF
      security: []
      parameters:
        - name: id
          in: query
          schema: { type: string }
        - name: hash
          in: query
          schema: { type: string }
        - name: sig
          in: query
          schema: { type: string }
      responses:
        "200":
          description: Verification result
  /api/v1/chargeflow/f/demo:
    post:
      tags: [Public]
      summary: Sandbox CFU-F mint
      operationId: demoChargeflowCfuF
      security: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/ChargeflowFCreateRequest"
      responses:
        "200":
          description: Demo unit
  /api/v1/shield/quota:
    get:
      operationId: shieldQuota
      summary: Shield tap quota and recent receipts
      tags: [Shield]
      security: [{ BearerAuth: [] }]
      responses:
        '200':
          description: Quota + receipts
  /api/v1/shield/audit:
    get:
      operationId: shieldAudit
      summary: Premium Shield audit log
      tags: [Shield]
      security: [{ BearerAuth: [] }]
      responses:
        '200':
          description: Audit events
  /api/v1/shield/reseal:
    post:
      operationId: shieldReseal
      summary: Premium schedule hybrid_pqc_ready reseal
      tags: [Shield]
      security: [{ BearerAuth: [] }]
      responses:
        '200':
          description: Reseal envelope
  /api/v1/shield/demo:
    post:
      operationId: shieldDemo
      summary: Zero-key sandbox Proof Tap
      description: POST any text body — no auth. Rate-limited. Payload discarded.
      tags: [Shield]
      requestBody:
        required: true
        content:
          text/plain:
            schema: { type: string }
      responses:
        '200':
          description: Demo receipt
  /api/v1/shield/ingest:
    post:
      operationId: shieldIngest
      summary: Raw ingest — easiest Proof Tap (no JSON schema)
      description: |
        POST any text/binary body. Hashed then discarded. Free 100/mo · Premium unlimited.
      tags: [Shield]
      security: [{ BearerAuth: [] }]
      parameters:
        - in: header
          name: X-AUROS-Shield-Label
          schema: { type: string }
      requestBody:
        required: true
        content:
          text/plain:
            schema: { type: string }
      responses:
        '200':
          description: Receipt
  /api/v1/shield/pack:
    post:
      operationId: shieldPack
      summary: Evidence Pack (Premium) — bank-ready CFU+taps
      tags: [Shield]
      security: [{ BearerAuth: [] }]
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                label: { type: string }
                cfu_limit: { type: integer }
                tap_limit: { type: integer }
      responses:
        '200':
          description: Sealed evidence pack
        '403':
          description: Premium required
  /api/v1/shield/tap:
    post:
      operationId: shieldTap
      summary: Proof Tap (freemium) — hash-only cloud anchor
      description: |
        Non-invasive RWA proof tap. Hashes body (or accepts content_hash), discards payload,
        issues public AUROS cloud co-seal. Free: 100/mo. Premium: unlimited.
        Never stores payload (payload_retained: false).
      tags: [Shield]
      security: [{ BearerAuth: [] }]
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                body: { type: string, description: Discarded after hashing }
                content_hash: { type: string }
                local_signature: { type: string }
                label: { type: string }
      responses:
        '200':
          description: Receipt with cloud_signature + verify_url
        '429':
          description: Free quota exceeded
  /api/v1/shield/verify:
    post:
      operationId: shieldVerify
      summary: Public counterparty verify (forever free)
      tags: [Shield]
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                id: { type: string }
                content_hash: { type: string }
                cloud_signature: { type: string }
      responses:
        '200':
          description: valid true/false
  /api/v1/shield/receipts/{id}:
    get:
      operationId: shieldReceipt
      summary: Public receipt by id (free)
      tags: [Shield]
      parameters:
        - name: id
          in: path
          required: true
          schema: { type: string }
      responses:
        '200':
          description: Public receipt
  /api/v1/shield/export:
    get:
      operationId: shieldExport
      summary: Export receipt registry (Premium)
      tags: [Shield]
      security: [{ BearerAuth: [] }]
      responses:
        '200':
          description: Hash-only receipt list
  /api/v1/shield/cbom:
    get:
      operationId: shieldCbom
      summary: Cryptographic Bill of Materials (sample)
      description: |
        Public sample CBOM for AUROS Shield on-prem underlayer.
        Production seals run on customer premises via npm @adrien1212balitrand/auros-shield.
        Not a NIST PQC certification.
      tags: [Shield]
      responses:
        '200':
          description: CBOM JSON inventory
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
  /api/v1/chargeflow/export:
    # Query shield=1 for opt-in Shield proof tap of the export body

    get:
      tags: [Premium]
      summary: Export ChargeFlow CFU portfolio (audit pack)
      operationId: exportChargeflow
      description: |
        Institutional CSV/JSON export of CFU units owned by the API key.
        Filters: kind, status, operator_id. Max 5000 rows per call.
        Not a regulated audit opinion — indicative off-chain proofs only.
      parameters:
        - name: format
          in: query
          schema: { type: string, enum: [json, csv], default: json }
        - name: kind
          in: query
          schema: { type: string, enum: [e, w, f] }
        - name: status
          in: query
          schema: { type: string, enum: [active, retired] }
        - name: operator_id
          in: query
          schema: { type: string }
        - name: limit
          in: query
          schema: { type: integer, minimum: 1, maximum: 5000, default: 1000 }
      responses:
        "200":
          description: Portfolio export
        "403":
          $ref: "#/components/responses/PremiumRequired"
  /api/v1/watts/reserve:
    post:
      tags: [Premium]
      summary: Create Watts Reserve intent
      operationId: wattsReserve
      description: |
        Deterministic match_score for an energy/capacity profile. Does not mint CFU.
        Confirm separately. UI: /green/watts · /green/chargeflow/reserve.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/WattsReserveRequest"
      responses:
        "200":
          description: Reservation intent
        "403":
          $ref: "#/components/responses/PremiumRequired"
  /api/v1/watts/reserve/{id}:
    get:
      tags: [Premium]
      summary: Get Watts reservation
      operationId: wattsReservation
      parameters:
        - name: id
          in: path
          required: true
          schema: { type: string, format: uuid }
      responses:
        "200":
          description: Reservation
        "403":
          $ref: "#/components/responses/PremiumRequired"
  /api/v1/watts/reserve/{id}/confirm:
    post:
      tags: [Premium]
      summary: Confirm Watts reservation (mint CFU)
      operationId: wattsConfirm
      description: Explicit mint CFU-E or CFU-F linked to reservation_id — no auto-mint.
      parameters:
        - name: id
          in: path
          required: true
          schema: { type: string, format: uuid }
      responses:
        "200":
          description: Confirmed reservation with CFU
        "403":
          $ref: "#/components/responses/PremiumRequired"
  /api/v1/watts/reserve/{id}/settle:
    post:
      tags: [Premium]
      summary: Settle Watts reservation (retire CFU)
      operationId: wattsSettle
      description: Explicit retire of linked CFU on delivery — no auto-retire.
      parameters:
        - name: id
          in: path
          required: true
          schema: { type: string, format: uuid }
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/WattsSettleRequest"
      responses:
        "200":
          description: Settled reservation
        "403":
          $ref: "#/components/responses/PremiumRequired"
  /api/v1/watts/offers:
    post:
      tags: [Premium]
      summary: Publish capacity offer
      operationId: wattsCreateOffer
      description: Indicative producer window — not a PPA.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/WattsOfferRequest"
      responses:
        "200":
          description: Offer created
        "403":
          $ref: "#/components/responses/PremiumRequired"
    get:
      tags: [Premium]
      summary: List capacity offers
      operationId: wattsOffers
      parameters:
        - name: country
          in: query
          schema: { type: string }
        - name: firmness
          in: query
          schema: { type: string, enum: [firm, flex] }
        - name: mine
          in: query
          schema: { type: boolean }
      responses:
        "200":
          description: Offers list
        "403":
          $ref: "#/components/responses/PremiumRequired"
  /api/v1/watts/offers/match:
    post:
      tags: [Premium]
      summary: Match buyer profile to open offers
      operationId: wattsMatchOffers
      description: Deterministic ranking — no auto-reserve.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/WattsReserveRequest"
      responses:
        "200":
          description: Ranked matches
        "403":
          $ref: "#/components/responses/PremiumRequired"
  /api/v1/watts/offers/{id}/withdraw:
    post:
      tags: [Premium]
      summary: Withdraw capacity offer
      operationId: wattsWithdrawOffer
      parameters:
        - name: id
          in: path
          required: true
          schema: { type: string, format: uuid }
      responses:
        "200":
          description: Withdrawn offer
        "403":
          $ref: "#/components/responses/PremiumRequired"
  /api/v1/watts/secondary:
    post:
      tags: [Premium]
      summary: Create secondary listing
      operationId: wattsSecondaryList
      description: Indicative listing + optional compare_ref_id — not a securities exchange.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/WattsSecondaryRequest"
      responses:
        "200":
          description: Listing created
        "403":
          $ref: "#/components/responses/PremiumRequired"
    get:
      tags: [Premium]
      summary: List secondary listings
      operationId: wattsSecondary
      parameters:
        - name: mine
          in: query
          schema: { type: boolean }
      responses:
        "200":
          description: Listings
        "403":
          $ref: "#/components/responses/PremiumRequired"
  /api/v1/watts/secondary/{id}/interest:
    post:
      tags: [Premium]
      summary: Express non-binding interest
      operationId: wattsSecondaryInterest
      parameters:
        - name: id
          in: path
          required: true
          schema: { type: string, format: uuid }
      responses:
        "200":
          description: Interest recorded
        "403":
          $ref: "#/components/responses/PremiumRequired"
  /api/v1/watts/secondary/{id}/withdraw:
    post:
      tags: [Premium]
      summary: Withdraw secondary listing
      operationId: wattsWithdrawSecondary
      parameters:
        - name: id
          in: path
          required: true
          schema: { type: string, format: uuid }
      responses:
        "200":
          description: Withdrawn
        "403":
          $ref: "#/components/responses/PremiumRequired"
  /api/v1/webhooks:
    post:
      tags: [Premium]
      summary: Register webhook
      operationId: registerWebhook
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/WebhookRegisterRequest"
      responses:
        "201":
          description: Webhook registered
        "403":
          $ref: "#/components/responses/PremiumRequired"
    get:
      tags: [Premium]
      summary: List webhooks
      operationId: listWebhooks
      responses:
        "200":
          description: Webhook list
        "403":
          $ref: "#/components/responses/PremiumRequired"
  /api/v1/webhooks/{id}:
    delete:
      tags: [Premium]
      summary: Delete webhook
      operationId: deleteWebhook
      parameters:
        - name: id
          in: path
          required: true
          schema: { type: string }
      responses:
        "200":
          description: Deleted
        "403":
          $ref: "#/components/responses/PremiumRequired"
  /api/v1/webhooks/{id}/deliveries:
    get:
      tags: [Premium]
      summary: List webhook delivery log
      operationId: listWebhookDeliveries
      description: |
        Paginated delivery log for a registered webhook — pending, delivered, failed, dead_letter.
      parameters:
        - name: id
          in: path
          required: true
          schema: { type: string }
        - name: limit
          in: query
          schema: { type: integer, minimum: 1, maximum: 100, default: 20 }
        - name: offset
          in: query
          schema: { type: integer, minimum: 0, default: 0 }
        - name: status
          in: query
          schema:
            type: string
            enum: [pending, delivered, failed, dead_letter]
      responses:
        "200":
          description: Delivery log page
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/WebhookDeliveriesResponse"
        "404":
          description: Webhook not found
        "403":
          $ref: "#/components/responses/PremiumRequired"
  /api/v1/webhooks/{id}/replay:
    post:
      tags: [Premium]
      summary: Replay webhook deliveries
      operationId: replayWebhookDeliveries
      description: |
        Replay dead-letter deliveries for a webhook. Optional body `{ "delivery_id": "whd_..." }`
        replays a single delivery instead of all dead_letter rows.
      parameters:
        - name: id
          in: path
          required: true
          schema: { type: string }
      requestBody:
        required: false
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/WebhookReplayRequest"
      responses:
        "200":
          description: Replay result
        "404":
          description: Webhook or delivery not found
        "403":
          $ref: "#/components/responses/PremiumRequired"
  /api/v1/webhooks/deliveries/{delivery_id}/replay:
    post:
      tags: [Premium]
      summary: Replay a single delivery
      operationId: replayWebhookDelivery
      parameters:
        - name: delivery_id
          in: path
          required: true
          schema: { type: string }
      responses:
        "200":
          description: Delivery replayed
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/WebhookReplayResponse"
        "404":
          description: Delivery not found
        "403":
          $ref: "#/components/responses/PremiumRequired"
  /api/v1/regulatory/feed:
    get:
      tags: [Premium]
      summary: Curated regulatory intelligence feed
      operationId: regulatoryFeed
      description: |
        Premium endpoint. Returns curated ESMA/AMF/BaFin/CSRD/energy references (static seed).
        Live regulator polling is not claimed. Filter by jurisdiction, tag, since date.
      parameters:
        - name: jurisdiction
          in: query
          schema: { type: string, example: france }
        - name: tag
          in: query
          schema:
            type: string
            enum: [mica, esma, amf, bafin, csrd, energy, aml]
        - name: since
          in: query
          schema: { type: string, format: date, example: "2025-01-01" }
        - name: limit
          in: query
          schema: { type: integer, minimum: 1, maximum: 100, default: 50 }
      responses:
        "200":
          description: Regulatory feed items
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/RegulatoryFeedResponse"
        "403":
          $ref: "#/components/responses/PremiumRequired"
        "401":
          $ref: "#/components/responses/Unauthorized"
  /api/v1/regulatory/watch:
    post:
      tags: [Intelligence]
      summary: Regulatory watch storefront
      operationId: regulatoryWatch
      description: |
        Curated MiCA/CSRD/energy/AML watch pack with deadlines digest.
        Dual access Bearer OR x402 ($0.10). Indicative Twin lite — not live scraping.
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                jurisdiction: { type: string, example: france }
                asset_type: { type: string, example: real_estate }
                tag:
                  type: string
                  enum: [mica, esma, amf, bafin, csrd, energy, aml]
                since: { type: string, format: date }
                limit: { type: integer }
                include_deadlines: { type: boolean }
      responses:
        "200":
          description: Regulatory watch pack
        "401":
          $ref: "#/components/responses/Unauthorized"
  /api/v1/norms/screen:
    post:
      tags: [Intelligence]
      summary: Norms screen storefront
      operationId: normsScreen
      description: |
        Which curated norms apply to asset_type + jurisdiction (MiCA titles, CSRD, GO/EECS refs, AML…).
        Dual access Bearer OR x402 ($0.08). Indicative — not legal advice.
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                asset_type: { type: string, example: real_estate }
                jurisdiction: { type: string, example: france }
                family:
                  type: string
                  enum: [mica, mifid, aml, csrd, energy, water, prospectus, dlt]
                limit: { type: integer }
      responses:
        "200":
          description: Norms screen pack
        "401":
          $ref: "#/components/responses/Unauthorized"
  /api/v1/regulatory/subscribe:
    post:
      tags: [Premium]
      summary: Subscribe to regulatory feed alerts
      operationId: regulatorySubscribe
      description: |
        Premium endpoint. Subscribe to `regulatory.update` webhook events filtered by
        jurisdiction and optional tags. Complements POST /api/v1/webhooks.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/RegulatorySubscribeRequest"
      responses:
        "201":
          description: Subscription created
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/RegulatorySubscribeResponse"
        "403":
          $ref: "#/components/responses/PremiumRequired"
        "429":
          $ref: "#/components/responses/RateLimit"
  /api/v1/regulatory/subscribe/{id}:
    get:
      tags: [Premium]
      summary: Get regulatory subscription
      operationId: getRegulatorySubscription
      parameters:
        - name: id
          in: path
          required: true
          schema: { type: string }
      responses:
        "200":
          description: Subscription status
        "404":
          description: Not found
        "403":
          $ref: "#/components/responses/PremiumRequired"
    delete:
      tags: [Premium]
      summary: Delete regulatory subscription
      operationId: deleteRegulatorySubscription
      parameters:
        - name: id
          in: path
          required: true
          schema: { type: string }
      responses:
        "200":
          description: Deleted
        "404":
          description: Not found
        "403":
          $ref: "#/components/responses/PremiumRequired"
  /api/green/watt/{id}:
    get:
      tags: [Green]
      summary: Public Watt Score by catalog id
      operationId: greenWattScore
      security: []
      description: |
        Free public read — indicative Watt Score (0–100) for an AUROS Green compare reference
        (solar, wind, REC, PPA). Returns `not_energy_asset` (422) for carbon-only references.

        **No authentication.** For portfolio batch scoring use `POST /api/v1/green/watt/batch`.
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
          example: sunexchange
      responses:
        "200":
          description: Watt Score result
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GreenWattPublicResponse"
        "404":
          description: Unknown compare reference id
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GreenNotFoundError"
        "422":
          description: Reference is not an energy asset
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GreenAssetTypeError"
  /api/v1/green/watt/batch:
    post:
      tags: [Green]
      summary: Batch Watt Scores
      operationId: greenWattBatch
      description: |
        Score up to **50 energy assets** in one call — solar portfolios, REC pipelines, PPA due diligence.

        Each item accepts either:
        - `id` — AUROS Green compare reference (e.g. `sunexchange`)
        - `text` — free-form description (min 10 chars; keywords solar, wind, PPA, REC, MWh…)

        **Partial success:** invalid items return `{ ok: false, error }` at their index.

        **Premium:** requires `auros_pk_live_*` or paid tier (Monitor / enterprise). Free test keys → 403.

        **Quota:** counts as **1 request** against the monthly API key quota.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/GreenWattBatchRequest"
            example:
              items:
                - id: sunexchange
                - text: "Solar farm 12 MW PPA signed production MWh France"
      responses:
        "200":
          description: Batch Watt Score results (may include per-item errors)
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GreenWattBatchResponse"
        "400":
          $ref: "#/components/responses/ValidationError"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/PremiumRequired"
        "429":
          $ref: "#/components/responses/RateLimit"
  /api/green/h2o/{id}:
    get:
      tags: [Green]
      summary: Public H₂O Score by hydrological catalog id
      operationId: greenH2oScore
      security: []
      description: |
        Free public read — indicative H₂O Score (0–100) for AUROS water compare references.
        Listing-grade attestation requires AUROS Hydrological Passport dossier (`passport_required`).
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
          example: pilot-concession-france
      responses:
        "200":
          description: H₂O Score result
        "404":
          description: Unknown water reference id
  /api/v1/green/h2o/batch:
    post:
      tags: [Green]
      summary: Batch H₂O Scores
      operationId: greenH2oBatch
      description: |
        Score up to 50 hydrological assets per call. Premium API key required.
      responses:
        "200":
          description: Batch H₂O Score results
        "403":
          $ref: "#/components/responses/PremiumRequired"
  /api/eau/check:
    post:
      tags: [Green]
      summary: Hydrological readiness check (embed)
      operationId: eauCheck
      security: []
      description: Free embeddable H₂O Score preview with passport unlock URL.
      responses:
        "200":
          description: H₂O preview result
        "422":
          description: Not a hydrological asset
  /api/green/carbon-quality/{id}:
    get:
      tags: [Green]
      summary: Public Carbon Quality Score by catalog id
      operationId: greenCarbonQuality
      security: []
      description: |
        Free public read — indicative Carbon Quality Score (CQS, 0–100) for an AUROS Green
        compare carbon reference. Returns `not_carbon_asset` (422) for energy-only references.

        **No authentication.** For portfolio batch scoring use `POST /api/v1/green/carbon-quality/batch`.
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
          example: toucan
      responses:
        "200":
          description: Carbon Quality Score result
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GreenCqsPublicResponse"
        "404":
          description: Unknown compare reference id
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GreenNotFoundError"
        "422":
          description: Reference is not a carbon asset
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GreenAssetTypeError"
  /api/v1/green/carbon-quality/batch:
    post:
      tags: [Green]
      summary: Batch Carbon Quality Scores
      operationId: greenCarbonQualityBatch
      description: |
        Score up to **50 carbon credits** in one call — corporate portfolio or M&A pipeline.

        Each item accepts either:
        - `id` — AUROS Green compare reference (e.g. `toucan`)
        - `text` — free-form description (min 10 chars)

        **Partial success:** invalid items return `{ ok: false, error }` at their index.

        **Premium:** requires `auros_pk_live_*` or paid tier (Monitor / enterprise). Free test keys → 403.

        **Quota:** counts as **1 request** against the monthly API key quota.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/GreenCqsBatchRequest"
            example:
              items:
                - id: toucan
                - text: "Gold Standard forestry credits retired 2024 Verra"
      responses:
        "200":
          description: Batch CQS results (may include per-item errors)
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GreenCqsBatchResponse"
        "400":
          $ref: "#/components/responses/ValidationError"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/PremiumRequired"
        "429":
          $ref: "#/components/responses/RateLimit"
  /api/v1/energy-intelligence:
    get:
      tags: [Public]
      summary: Energy desk reading
      operationId: getEnergyIntelligence
      security: []
      description: |
        Recommendation only. An empty zone reads the public DE-LU series.
        AT, BE, CH, FR, and NL use the same provider when that response license was read.
        An unverified zone stays without a price. The offer ranking stays a labeled fixture.
        Execution stays refused. Nothing is collected. A second independent source is unproven.
      parameters:
        - name: zone
          in: query
          required: false
          schema:
            type: string
          example: DE-LU
      responses:
        "200":
          description: Public reading, or a zone that stays without a price
          content:
            application/json:
              examples:
                de_lu_allowed:
                  summary: DE-LU series with commercial use allowed
                  value:
                    live_price: false
                    price: null
                    execution_permitted: false
                    verified_saving_eur: null
                    winner: null
                    observed:
                      zone: DE-LU
                      host: api.energy-charts.info
                      unit: EUR/MWh
                      price_eur_per_mwh: 98.07
                      observed_at: "2026-10-15T13:15:00+02:00"
                      fetched_at: "2026-10-15T11:21:22.000Z"
                      license: "CC BY 4.0"
                      commercial_use_allowed: true
                      freshness_status: fresh
                      attribution: "Bundesnetzagentur | SMARD.de"
                      license_class: cc_by_4
                      commercial_redistribution: cc_by_4_attribution
                      ttl_ms: 900000
                      error: null
                    decision:
                      code: selected
                      selected_offer_id: "offer:de-confirmed"
                      live_price: false
                      execution_permitted: false
                      posts:
                        energy_eur: 0.96
                        gpu_eur: 2
                        cost_ex_risk_eur: 2.96
                unknown_zone:
                  summary: Unknown zone stays without a price
                  value:
                    ok: false
                    code: commercial_use_blocked
                    message: This zone stays without a public price.
                    retry_after: null
                    suggestion: license_blocks_public
                    execution_permitted: false
                    verified_saving_eur: null
                    live_price: false
                    price: null
                    winner: null
                    observed:
                      zone: FR
                      price_eur_per_mwh: null
                      live_price: false
                      network_call: false
                      commercial_use_allowed: false
                      freshness_status: absent
                      error: commercial_use_blocked
    post:
      tags: [Public]
      summary: Energy recommendation, abstention, or spot comparison
      operationId: postEnergyIntelligence
      security: []
      description: |
        Recommendation only. A labeled fixture can be selected. Inference abstains.
        A caller-supplied spot comparison is not a verified saving. Execution stays refused.
      requestBody:
        required: false
        content:
          application/json:
            examples:
              labeled_fixture:
                summary: Labeled fixture ranking
                value:
                  action: route
                  task:
                    task_class: deferrable_batch
                    objective: min_cost
                    allow_demonstration_fixtures: true
                    it_kwh: 10
                    gpu_hours: 1
                    as_of: "2026-10-15T07:12:00.000Z"
                    idempotency_key: demo-once
              abstention:
                summary: Inference abstains
                value:
                  action: route
                  task:
                    task_class: inference
                    objective: min_cost
                    allow_demonstration_fixtures: true
                    as_of: "2026-10-15T07:12:00.000Z"
                    idempotency_key: fixture-inference
              arbitrage:
                summary: Two caller-supplied spots
                value:
                  action: arbitrage
                  as_of: "2026-10-15T08:00:00.000Z"
                  left:
                    eur_per_mwh: 80
                    observed_at: "2026-10-15T07:00:00.000Z"
                    currency: EUR
                  right:
                    eur_per_mwh: 100
                    observed_at: "2026-10-15T07:00:00.000Z"
                    currency: EUR
      responses:
        "200":
          description: Recommendation, abstention, or comparison
          content:
            application/json:
              examples:
                labeled_fixture:
                  summary: Fixture offer retained
                  value:
                    code: selected
                    selected_offer_id: "offer:de-confirmed"
                    live_price: false
                    live_capacity: false
                    execution_permitted: false
                    verified_saving_eur: null
                    winner: null
                    fixture: true
                    energy_eur: 0.96
                    gpu_eur: 2
                    cost_ex_risk_eur: 2.96
                abstention:
                  summary: Inference has no admissible option
                  value:
                    code: NO_ADMISSIBLE_OPTION
                    selected_offer_id: null
                    reason: task_unsupported
                    live_price: false
                    execution_permitted: false
                    verified_saving_eur: null
                    winner: null
                arbitrage:
                  summary: Signed spread, not a verified saving
                  value:
                    schema: auros.energy.arbitrage.v1
                    accepted: true
                    leak: false
                    spread_eur_per_mwh: -20
                    lower_side: left
                    status: not_a_verified_saving
                    verified_saving_eur: null
                    execution_permitted: false
                    live_price: false
                    fixture: false
        "400":
          description: Refused input
          content:
            application/json:
              example:
                ok: false
                code: invalid_input
                message: A field is invalid. Omit a point dated after the decision.
                retry_after: null
                suggestion: omit_future_point
                execution_permitted: false
                verified_saving_eur: null
                live_price: false
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: |
        API key: `auros_pk_live_*` or `auros_pk_test_*` (demo: `auros_pk_test_demo`).
        Least-privilege scopes: `protocol:read`, `intelligence:read`.
        Intelligence API v2 Bearer path requires `intelligence:read`.
        Missing required scope returns 401 `unauthorized` (same family as invalid key).
  schemas:
    ProtocolError:
      type: object
      required: [disclaimer, error]
      properties:
        disclaimer:
          type: string
        error:
          type: object
          required: [code, message]
          properties:
            code:
              type: string
              enum: [unauthorized, validation_error, invalid_json, rate_limit, quota_exceeded, not_found]
            message:
              type: string
    MachineBriefPack:
      type: object
      description: |
        Shared shape for desk / Gap / Activity / Variance / annex machine briefs.
        Exact fields vary by schema version; always includes fused:false and content_hash.
      required: [schema, fused, content_hash]
      properties:
        schema:
          type: string
          examples:
            - auros.desk.brief.v3
            - auros.promise_gap.brief.v1
            - auros.activity.brief.v1
            - auros.variance.brief.v2
            - auros.freshness.brief.v2
        fused:
          type: boolean
          enum: [false]
        provenance:
          type: object
          properties:
            source: { type: string }
            as_of: { type: string, format: date-time }
            quality:
              type: string
              enum: [live, mixed_public, seed_indicative, lab_demo, lab_device]
        content_hash:
          type: string
          description: SHA-256 hex of the stable pack body
        signature:
          type: string
          nullable: true
          description: HMAC over content_hash when attest signing is configured
    ScoreRequest:
      type: object
      properties:
        description:
          type: string
          minLength: 10
          maxLength: 4000
        asset_type:
          type: string
          enum: [real_estate, private_fund, bonds, private_credit, commodities, stablecoins, low_carbon_power, other]
        issuer_type:
          type: string
          enum: [company_spv, existing_fund, individual, unsure]
        asset_class:
          type: string
          enum: [financial_instrument, art_utility, e_money, unsure]
        eu_nexus:
          type: string
          enum: [issuer_eu, asset_eu, investors_eu, no_eu, unsure]
        whitepaper:
          type: string
          enum: [ready, draft, none, unsure]
        investor_type:
          type: string
          enum: [professional, retail, mixed, unsure]
        value_eur:
          type: number
          exclusiveMinimum: 0
        jurisdiction:
          type: string
          maxLength: 64
        has_kyc:
          type: boolean
        has_data_room:
          type: boolean
        documents_count:
          type: integer
          minimum: 0
          maximum: 100
        score_id:
          type: string
          pattern: "^scr_[a-f0-9]{24}$"
          description: Continue an existing score session (returned by a prior POST /score)
        monitor_id:
          type: string
          pattern: "^mon_[a-f0-9]{24}$"
          description: Link this score to a premium monitor (`mon_…`)
        record_history:
          type: boolean
          default: true
          description: Persist snapshot for authenticated keys (demo key skips storage)
    ScoreResponse:
      type: object
      required: [disclaimer, score, grade, status, breakdown, mica_classification, critical_gaps, recommendations, recommended_jurisdictions, recommended_platforms, meta]
      properties:
        disclaimer:
          type: string
        score_id:
          type: string
          description: Session id for history lookups (`scr_…`)
        history_url:
          type: string
          format: uri
          description: GET URL for this session's score history
        score:
          type: number
          minimum: 0
          maximum: 100
        grade:
          type: string
        status:
          type: string
          enum: [ready, progress, early]
        breakdown:
          type: object
          properties:
            legal_structure: { type: number }
            kyc_aml: { type: number }
            mica_compliance: { type: number }
            data_room: { type: number }
            investor_protection: { type: number }
        mica_classification:
          type: string
          enum: [utility_token, asset_referenced_token, e_money_token, other_crypto_asset, financial_instrument, out_of_scope, uncertain]
        critical_gaps:
          type: array
          items: { type: string }
        recommendations:
          type: array
          items: { type: string }
        recommended_jurisdictions:
          type: array
          items:
            type: object
            properties:
              id: { type: string }
              score: { type: number }
              rationale: { type: string }
        recommended_platforms:
          type: array
          items:
            type: object
            properties:
              id: { type: string }
              name: { type: string }
              category: { type: string }
              apy: { type: number }
        meta:
          type: object
          properties:
            version: { type: string, const: "1.0" }
            computed_at: { type: string, format: date-time }
            request_id: { type: string }
            full_report_url: { type: string, format: uri }
            parsed_keywords:
              type: array
              items: { type: string }
    ScoreBatchRequest:
      type: object
      required: [items]
      properties:
        items:
          type: array
          minItems: 1
          maxItems: 20
          description: Score payloads (same schema as POST /score). Max 20 items.
          items:
            $ref: "#/components/schemas/ScoreRequest"
        record_history:
          type: boolean
          default: true
          description: Default for all items unless overridden per item
    ScoreBatchResponse:
      type: object
      required: [disclaimer, total, succeeded, failed, items, meta]
      properties:
        disclaimer:
          type: string
        total:
          type: integer
          minimum: 0
        succeeded:
          type: integer
          minimum: 0
        failed:
          type: integer
          minimum: 0
        items:
          type: array
          items:
            oneOf:
              - allOf:
                  - type: object
                    required: [index, ok]
                    properties:
                      index:
                        type: integer
                        minimum: 0
                      ok:
                        type: boolean
                        enum: [true]
                  - $ref: "#/components/schemas/ScoreResponse"
              - type: object
                required: [index, ok, error]
                properties:
                  index:
                    type: integer
                    minimum: 0
                  ok:
                    type: boolean
                    enum: [false]
                  error:
                    type: object
                    required: [code, message]
                    properties:
                      code:
                        type: string
                      message:
                        type: string
        meta:
          type: object
          properties:
            version: { type: string, const: "1.0" }
            computed_at: { type: string, format: date-time }
            request_id: { type: string }
    ScoreHistoryResponse:
      type: object
      required: [disclaimer, score_id, kind, total, entries, meta]
      properties:
        disclaimer: { type: string }
        score_id: { type: string }
        kind:
          type: string
          enum: [session, monitor]
        total: { type: integer, minimum: 0 }
        entries:
          type: array
          items:
            $ref: "#/components/schemas/ScoreHistoryEntry"
        meta:
          type: object
          required: [version, computed_at]
          properties:
            version: { type: string, const: "1.0" }
            computed_at: { type: string, format: date-time }
    ScoreHistoryEntry:
      type: object
      required: [id, score, grade, status, breakdown, mica_classification, created_at]
      properties:
        id: { type: integer }
        score: { type: number, minimum: 0, maximum: 100 }
        grade: { type: string }
        status:
          type: string
          enum: [ready, progress, early]
        breakdown:
          type: object
          properties:
            legal_structure: { type: number }
            kyc_aml: { type: number }
            mica_compliance: { type: number }
            data_room: { type: number }
            investor_protection: { type: number }
        mica_classification:
          type: string
          enum: [utility_token, asset_referenced_token, e_money_token, other_crypto_asset, financial_instrument, out_of_scope, uncertain]
        request:
          type: object
          additionalProperties: true
        created_at:
          type: string
          format: date-time
    ProductsResponse:
      type: object
      required: [disclaimer, products, pagination, fetched_at]
      properties:
        disclaimer:
          type: string
        products:
          type: array
          items:
            $ref: "#/components/schemas/ProductItem"
        pagination:
          type: object
          properties:
            page: { type: integer }
            limit: { type: integer }
            total: { type: integer }
            total_pages: { type: integer }
        fetched_at:
          type: string
          format: date-time
    ProductItem:
      type: object
      properties:
        id: { type: string }
        name: { type: string }
        platform: { type: string }
        category: { type: string }
        apy: { type: number }
        tvl_usd: { type: number }
        chains:
          type: array
          items: { type: string }
        jurisdiction: { type: string, nullable: true }
        affiliate_url: { type: string }
        min_investment_usd: { type: number, nullable: true }
        live: { type: boolean }
    RwaCorpusResponse:
      type: object
      required:
        - schema
        - world_complete
        - invent_coverage
        - rows
        - pagination
        - coverage
      description: |
        Existing desk/green corpus only. world_complete=false always.
        pagination.full_dump=true when page+limit were omitted (compat full list).
      properties:
        schema:
          type: string
          const: auros.rwa_corpus.v1
        world_complete:
          type: boolean
          enum: [false]
        invent_coverage:
          type: boolean
          enum: [false]
        fused:
          type: boolean
          enum: [false]
        swamp_scrape:
          type: boolean
          enum: [false]
        invent_tvl:
          type: boolean
          enum: [false]
        invent_apy:
          type: boolean
          enum: [false]
        tape_neq_world:
          type: boolean
          enum: [true]
        coverage:
          type: object
          properties:
            row_n: { type: integer }
            returned_n: { type: integer }
            filtered: { type: boolean }
            desk_seed_n: { type: integer }
            green_ref_n: { type: integer }
        pagination:
          type: object
          required: [page, limit, total, total_pages, full_dump]
          properties:
            page: { type: integer, minimum: 1 }
            limit: { type: integer, minimum: 0, maximum: 100 }
            total: { type: integer, minimum: 0 }
            total_pages: { type: integer, minimum: 0 }
            full_dump:
              type: boolean
              description: true when caller omitted page+limit and received the full dump
        rows:
          type: array
          items:
            type: object
            required: [id, kind, name, invent_tvl, invent_apy]
            properties:
              id: { type: string, example: powerledger }
              kind:
                type: string
                enum: [desk_seed, green_ref, stored_filing]
              name: { type: string }
              has_activity: { type: boolean }
              has_gap: { type: boolean }
              green_ref: { type: boolean }
              invent_tvl: { type: boolean, enum: [false] }
              invent_apy: { type: boolean, enum: [false] }
        next:
          type: object
          properties:
            page_next: { type: string, nullable: true }
            search: { type: string }
            resolve: { type: string }
            links: { type: string }
            desk: { type: string }
    BenchmarksResponse:
      type: object
      required: [disclaimer, category, metrics, as_of]
      properties:
        disclaimer:
          type: string
        category:
          type: string
          enum: [bonds, stablecoins, real_estate, private_credit, commodities]
        jurisdiction:
          type: string
          description: Present when filtered by jurisdiction query param
        metrics:
          type: object
          required: [median_apy, p25_apy, p75_apy, product_count]
          properties:
            median_apy: { type: number, description: Median APY (%), live hub or static fallback }
            p25_apy: { type: number, description: 25th percentile APY (%) }
            p75_apy: { type: number, description: 75th percentile APY (%) }
            product_count: { type: integer, minimum: 0 }
        as_of:
          type: string
          description: ISO timestamp (live hub) or edition date (static fallback)
    CompareRequest:
      type: object
      description: |
        Either pass `product_ids` (2–4 IDs) for an explicit comparison, or omit IDs and use filter fields
        to select the top matches (sorted by APY).
      properties:
        product_ids:
          type: array
          minItems: 2
          maxItems: 4
          items:
            type: string
            minLength: 1
        category:
          type: string
          enum: [stablecoins, real_estate, bonds, commodities, private_credit, all]
          default: all
        yield_min:
          type: number
          minimum: 0
        risk_tier:
          type: string
          enum: [conservative, core, advanced]
        jurisdiction:
          type: string
          maxLength: 64
        limit:
          type: integer
          minimum: 2
          maximum: 4
          default: 4
          description: Max products to return in filter mode
    CompareProduct:
      allOf:
        - $ref: "#/components/schemas/ProductItem"
        - type: object
          properties:
            asset_class:
              type: string
              description: API category (stablecoins, real_estate, bonds, etc.)
            sub_category:
              type: string
              description: Comparator sub-category (treasury, sovereign, prime, etc.)
            risk_tier:
              type: string
              enum: [conservative, core, advanced]
            liquidity_days:
              type: integer
            fees:
              type: string
            accredited_only:
              type: boolean
    CompareResponse:
      type: object
      required: [disclaimer, mode, products, comparison, fetched_at, meta]
      properties:
        disclaimer:
          type: string
        mode:
          type: string
          enum: [product_ids, filter]
        products:
          type: array
          minItems: 2
          maxItems: 4
          items:
            $ref: "#/components/schemas/CompareProduct"
        comparison:
          type: object
          required: [product_count, share_url, highlights]
          properties:
            product_count:
              type: integer
            share_url:
              type: string
              format: uri
            product_ids:
              type: array
              items:
                type: string
            filters:
              type: object
              properties:
                category:
                  type: string
                yield_min:
                  type: number
                risk_tier:
                  type: string
                jurisdiction:
                  type: string
                limit:
                  type: integer
            highlights:
              type: object
              properties:
                apy:
                  type: array
                  items:
                    type: string
                    nullable: true
                    enum: [best, worst, null]
                tvl_usd:
                  type: array
                  items:
                    type: string
                    nullable: true
                    enum: [best, worst, null]
                min_investment_usd:
                  type: array
                  items:
                    type: string
                    nullable: true
                    enum: [best, worst, null]
                liquidity_days:
                  type: array
                  items:
                    type: string
                    nullable: true
                    enum: [best, worst, null]
        fetched_at:
          type: string
          format: date-time
        meta:
          type: object
          properties:
            version:
              type: string
              const: "1.0"
            computed_at:
              type: string
              format: date-time
            request_id:
              type: string
    JurisdictionsResponse:
      type: object
      required: [disclaimer, jurisdictions, query]
      properties:
        disclaimer:
          type: string
        jurisdictions:
          type: array
          items:
            $ref: "#/components/schemas/JurisdictionItem"
        query:
          type: object
    JurisdictionItem:
      type: object
      properties:
        id: { type: string }
        score: { type: number }
        rationale: { type: string }
        fee_min_eur: { type: number }
        fee_max_eur: { type: number }
        license_max_months: { type: number }
        asset_types:
          type: array
          items: { type: string }
        kyc_level: { type: string }
    ChecklistRequest:
      type: object
      required: [asset_type, jurisdiction]
      properties:
        asset_type:
          type: string
          enum: [real_estate, private_fund, bonds, private_credit, low_carbon_power]
        jurisdiction:
          type: string
          minLength: 2
          maxLength: 64
        structure:
          type: string
          enum: [spv, fund, trust, other]
          default: spv
    ChecklistResponse:
      type: object
      required: [disclaimer, asset_type, jurisdiction, structure, items, total_items, estimated_total_days, estimated_total_cost_eur]
      properties:
        disclaimer: { type: string }
        asset_type: { type: string }
        jurisdiction: { type: string }
        structure: { type: string }
        items:
          type: array
          items:
            $ref: "#/components/schemas/ChecklistItem"
        total_items: { type: integer }
        estimated_total_days: { type: integer }
        estimated_total_cost_eur: { type: number }
    ChecklistItem:
      type: object
      properties:
        id: { type: string }
        category: { type: string }
        title: { type: string }
        regulatory_reference: { type: string }
        required: { type: boolean }
        estimated_time_days: { type: integer }
        estimated_cost_eur: { type: number }
        dependencies:
          type: array
          items: { type: string }
        auros_tip: { type: string }
    CreateKeyRequest:
      type: object
      required: [email]
      properties:
        email:
          type: string
          format: email
          maxLength: 254
    CreateKeyResponse:
      type: object
      required: [disclaimer, ok]
      properties:
        disclaimer: { type: string }
        ok: { type: boolean }
        api_key:
          type: string
          description: Raw secret — returned once on create/rotate only
        tier:
          type: string
          enum: [free]
        monthly_limit: { type: integer, example: 1000 }
        scopes:
          type: array
          items:
            type: string
            enum: [protocol:read, intelligence:read]
        status:
          type: string
          enum: [active]
        already_exists:
          type: boolean
          description: Present when email already has an active key (secret not replayed)
        message: { type: string }
    RevokeKeyResponse:
      type: object
      required: [disclaimer, ok, status]
      properties:
        disclaimer: { type: string }
        ok: { type: boolean }
        status:
          type: string
          enum: [revoked]
        id: { type: string }
        prefix:
          type: string
          enum: [live, test]
        message: { type: string }
    RotateKeyResponse:
      type: object
      required: [disclaimer, ok, api_key]
      properties:
        disclaimer: { type: string }
        ok: { type: boolean }
        api_key:
          type: string
          description: New raw secret — returned once
        tier: { type: string }
        monthly_limit: { type: integer, example: 1000 }
        scopes:
          type: array
          items:
            type: string
            enum: [protocol:read, intelligence:read]
        prefix:
          type: string
          enum: [live, test]
        revoked: { type: boolean, enum: [true] }
        message: { type: string }
    IntelligenceApiV2Response:
      type: object
      description: |
        Route envelope for GET /api/v1/intelligence/v2. Nested section schemas match
        Phase 3 builders; invent_*=false; unknown/conflicting/experimental stay explicit.
        #246 adds export_schema / exported_at / invent_export=false on the same path.
        When `sections` is set, top-level section fields may be replaced by `sections` +
        `sections_omitted` (pack=null) — still not a warehouse dump.
      required: [schema, invent_entity, invent_coverage, invent_signal, invent_risk, invent_export, winner, fused, export_schema, exported_at]
      properties:
        disclaimer: { type: string }
        schema:
          type: string
          enum: [auros.intelligence.api.v2]
        method_version: { type: string, example: intelligence_api.v2.0 }
        invent_entity: { type: boolean, enum: [false] }
        invent_coverage: { type: boolean, enum: [false] }
        invent_signal: { type: boolean, enum: [false] }
        invent_risk: { type: boolean, enum: [false] }
        invent_export: { type: boolean, enum: [false] }
        invent_endpoint: { type: boolean, enum: [false] }
        health_score: { type: "null" }
        composite: { type: "null" }
        fused: { type: boolean, enum: [false] }
        winner: { type: "null" }
        as_of: { type: string, format: date }
        export_schema:
          type: string
          enum: [auros.intelligence.export.v1]
        exported_at: { type: string, format: date-time }
        pack: { type: "null" }
        sections:
          type: object
          additionalProperties: true
          description: Present when sections query filters the pack (#246 / #244 allowlist).
        sections_omitted:
          type: array
          items: { type: string }
        section_keys_allowed:
          type: array
          items:
            type: string
            enum:
              - coverage
              - history
              - changes
              - signal_candidates
              - signal_validation
              - confidence
              - risk_candidates
              - alerts
              - v1
        limits:
          type: object
          properties:
            freemium: { type: boolean, enum: [true] }
            experimental_explicit: { type: boolean, enum: [true] }
            unknown_explicit: { type: boolean, enum: [true] }
            conflicting_explicit: { type: boolean, enum: [true] }
        coverage: { type: object }
        history: { type: object }
        changes: { type: object }
        signal_candidates: { type: object }
        signal_validation: { type: object }
        confidence: { type: object }
        risk_candidates: { type: object }
        alerts: { type: object }
        v1: { type: object }
        reason: { type: string }
        access:
          type: string
          enum: [public, free, premium]
        usage_meter:
          type: object
          properties:
            schema: { type: string, example: auros.usage_meter.tip.v1 }
            fake_billing_product: { type: boolean, enum: [false] }
            ties:
              type: object
              properties:
                entitlements_schema:
                  type: string
                  enum: [auros.entitlements.matrix.v1]
    EntitlementMatrix:
      type: object
      description: |
        #248 machine-readable entitlements over existing freemium meter / protocolQuotaFacts /
        scopes. invent_meter/entitlement/price/billing/quota=false · no /usage dump ·
        Monitor SKU ≠ API quota. Full matrix on GET /api/v1/intelligence.
      required:
        - schema
        - invent_meter
        - invent_entitlement
        - invent_price
        - invent_billing
        - invent_quota
      properties:
        schema:
          type: string
          enum: [auros.entitlements.matrix.v1]
        invent_meter: { type: boolean, enum: [false] }
        invent_entitlement: { type: boolean, enum: [false] }
        invent_price: { type: boolean, enum: [false] }
        invent_billing: { type: boolean, enum: [false] }
        invent_quota: { type: boolean, enum: [false] }
        invent_usage: { type: boolean, enum: [false] }
        monitor_neq_api_quota: { type: boolean, enum: [true] }
        quotas:
          type: object
          properties:
            free_monthly: { type: integer, example: 1000 }
            demo_monthly: { type: integer, example: 50 }
        metering:
          type: object
          properties:
            bearer_monthly_incr_at:
              type: string
              enum: [auth]
            inspection:
              type: object
              properties:
                developers_dashboard:
                  type: string
                  example: /developers/dashboard
                usage_api_endpoint: { type: boolean, enum: [false] }
                billing_api_endpoint: { type: boolean, enum: [false] }
            exhaustion:
              type: object
              properties:
                monthly:
                  type: object
                  properties:
                    status: { type: integer, enum: [429] }
                    code: { type: string, enum: [quota_exceeded] }
    MonitorRequest:
      type: object
      required: [asset_type, jurisdiction]
      properties:
        asset_type:
          type: string
          enum: [real_estate, private_fund, bonds, private_credit, commodities, stablecoins, low_carbon_power, other]
        jurisdiction: { type: string }
        structure:
          type: string
          enum: [spv, fund, trust, other]
          default: spv
        webhook_url: { type: string, format: uri }
        email: { type: string, format: email }
        alert_on:
          type: array
          items:
            type: string
            enum: [score_change, regulation_update, new_requirement, deadline_approaching]
        baseline_score: { type: integer, minimum: 0, maximum: 100 }
    MonitorResponse:
      type: object
      properties:
        disclaimer: { type: string }
        id: { type: string }
        status: { type: string, enum: [active, paused] }
        asset_type: { type: string }
        jurisdiction: { type: string }
        structure: { type: string }
        alert_on:
          type: array
          items: { type: string }
        webhook_url: { type: string, nullable: true }
        created_at: { type: string, format: date-time }
        pricing: { type: object }
    DossierRequest:
      type: object
      properties:
        score_id: { type: string }
        score:
          $ref: "#/components/schemas/ScoreRequest"
        format:
          type: string
          enum: [pdf, json, zip]
          default: pdf
        sections:
          type: array
          items: { type: string }
        branding:
          type: object
          properties:
            company_name: { type: string }
            logo_url: { type: string, format: uri }
        locale:
          type: string
          enum: [fr, en, es]
    DossierResponse:
      type: object
      properties:
        disclaimer: { type: string }
        dossier_id: { type: string }
        format: { type: string }
        download_url: { type: string, format: uri }
        expires_in_hours: { type: integer }
        full_report_url: { type: string, format: uri }
    AttestCreateRequest:
      type: object
      properties:
        dossier_id: { type: string }
        score_id: { type: string }
        score:
          $ref: "#/components/schemas/ScoreRequest"
        sections:
          type: array
          items: { type: string }
        locale:
          type: string
          enum: [fr, en, es]
          default: fr
    AttestResponse:
      type: object
      properties:
        id: { type: string }
        content_hash: { type: string }
        signature: { type: string }
        verify_url: { type: string, format: uri }
        dossier_id: { type: string }
        locale: { type: string }
        public:
          type: object
          properties:
            score: { type: number }
            grade: { type: string }
            status: { type: string }
            mica_classification: { type: string }
            sections:
              type: array
              items: { type: string }
            generated_at: { type: string, format: date-time }
        created_at: { type: string, format: date-time }
        disclaimer: { type: string }
        valid: { type: boolean }
    AttestVerifyResponse:
      type: object
      properties:
        valid: { type: boolean }
        id: { type: string }
        content_hash: { type: string }
        signature: { type: string }
        reason: { type: string }
        disclaimer: { type: string }
        public: { type: object }
    VerdictResponse:
      type: object
      required:
        - disclaimer
        - verdict
        - reasons
        - required_actions
        - risk_score
        - regulatory_flags
        - decision_scope
        - decision_note
        - score
      properties:
        disclaimer: { type: string }
        verdict:
          type: string
          enum: [ALLOW, CHALLENGE, BLOCK]
        reasons:
          type: array
          items: { type: string }
        required_actions:
          type: array
          items: { type: string }
        risk_score:
          type: number
          minimum: 0
          maximum: 100
          description: Inverse of readiness score (100 − score)
        regulatory_flags:
          type: array
          items: { type: string }
        decision_scope:
          type: string
          enum: [issuer_prep]
        decision_note: { type: string }
        score:
          type: object
          properties:
            score: { type: number }
            grade: { type: string }
            status:
              type: string
              enum: [ready, progress, early]
            mica_classification: { type: string }
            critical_gaps:
              type: array
              items: { type: string }
            score_id: { type: string }
            history_url: { type: string, format: uri }
    ExecutionProofRequest:
      type: object
      required: [intended_action]
      properties:
        intended_action:
          type: string
          enum: [buy, sell, collateralize, include_portfolio, issue, monitor]
        asset_ref:
          type: string
          maxLength: 128
        dossier_id: { type: string }
        score_id:
          type: string
          pattern: "^scr_[a-f0-9]{24}$"
        score:
          $ref: "#/components/schemas/ScoreRequest"
        sections:
          type: array
          items: { type: string }
        locale:
          type: string
          enum: [fr, en, es, ar, zh]
          default: fr
    ExecutionProofResponse:
      type: object
      required:
        - disclaimer
        - intended_action
        - verdict
        - execution_recommendation
        - attestation
        - score
      properties:
        disclaimer: { type: string }
        intended_action:
          type: string
          enum: [buy, sell, collateralize, include_portfolio, issue, monitor]
        asset_ref: { type: string }
        verdict:
          type: string
          enum: [ALLOW, CHALLENGE, BLOCK]
        reasons:
          type: array
          items: { type: string }
        required_actions:
          type: array
          items: { type: string }
        risk_score: { type: number }
        regulatory_flags:
          type: array
          items: { type: string }
        decision_scope:
          type: string
          enum: [issuer_prep]
        decision_note: { type: string }
        execution_recommendation:
          type: string
          enum: [execute_now, wait, restructure]
        execution_recommendation_reason: { type: string }
        attestation:
          type: object
          properties:
            id: { type: string }
            content_hash: { type: string }
            signature: { type: string }
            verify_url: { type: string, format: uri }
            dossier_id: { type: string }
            created_at: { type: string, format: date-time }
        score:
          type: object
          properties:
            score: { type: number }
            grade: { type: string }
            status:
              type: string
              enum: [ready, progress, early]
            mica_classification: { type: string }
            critical_gaps:
              type: array
              items: { type: string }
            score_id: { type: string }
    ChargeflowCreateRequest:
      type: object
      required: [session]
      properties:
        session:
          type: object
          required: [external_session_id, started_at, ended_at, energy_kwh]
          properties:
            external_session_id: { type: string }
            started_at: { type: string }
            ended_at: { type: string }
            energy_kwh: { type: number }
            operator_id: { type: string }
            source_format:
              type: string
              enum: [ocpi, ocpp_summary, csv, json_custom]
            location:
              type: object
              properties:
                country: { type: string }
                site_id: { type: string }
                connector_id: { type: string }
        attributes:
          type: object
          properties:
            renewable_claim:
              type: string
              enum: [none, go, rec, ppa_matched, unknown]
            generation_source:
              type: string
              enum: [solar, wind, hydro, nuclear, battery, mixed, unknown]
    WattsReserveRequest:
      type: object
      required: [window, zone]
      properties:
        window:
          type: object
          required: [start, end]
          properties:
            start: { type: string }
            end: { type: string }
        energy_kwh: { type: number }
        capacity_kw: { type: number }
        zone:
          type: object
          required: [country]
          properties:
            country: { type: string }
            zone_id: { type: string }
        carbon_intensity_max_gco2_kwh: { type: number }
        firmness: { type: string, enum: [firm, flex] }
        buyer_ref: { type: string }
        generation_source:
          type: string
          enum: [solar, wind, hydro, nuclear, battery, mixed, unknown]
    WattsSettleRequest:
      type: object
      properties:
        delivery_ref: { type: string }
        delivered_at: { type: string }
        energy_kwh_delivered: { type: number }
        capacity_kw_delivered: { type: number }
        reason: { type: string }
    WattsOfferRequest:
      type: object
      required: [window, zone]
      properties:
        window:
          type: object
          required: [start, end]
          properties:
            start: { type: string }
            end: { type: string }
        capacity_kw: { type: number }
        energy_kwh: { type: number }
        zone:
          type: object
          required: [country]
          properties:
            country: { type: string }
            zone_id: { type: string }
        carbon_intensity_gco2_kwh: { type: number }
        firmness: { type: string, enum: [firm, flex] }
        producer_ref: { type: string }
        label: { type: string }
        generation_source:
          type: string
          enum: [solar, wind, hydro, nuclear, battery, mixed, unknown]
    WattsSecondaryRequest:
      type: object
      required: [indicative_price_eur]
      properties:
        reservation_id: { type: string, format: uuid }
        indicative_price_eur: { type: number }
        compare_ref_id: { type: string }
        label: { type: string }
        note: { type: string }
        energy_kwh: { type: number }
        capacity_kw: { type: number }
        firmness: { type: string, enum: [firm, flex] }
        generation_source:
          type: string
          enum: [solar, wind, hydro, nuclear, battery, mixed, unknown]

    ChargeflowWCreateRequest:
      type: object
      required: [flow]
      properties:
        flow:
          type: object
          required: [external_flow_id, started_at, ended_at, volume_m3]
          properties:
            external_flow_id: { type: string }
            started_at: { type: string }
            ended_at: { type: string }
            volume_m3: { type: number }
            operator_id: { type: string }
            source_format:
              type: string
              enum: [csv, scada_summary, json_custom]
            location:
              type: object
              properties:
                country: { type: string }
                site_id: { type: string }
                basin_id: { type: string }
        attributes:
          type: object
          properties:
            asset_class_hint: { type: string }
            compare_ref_id: { type: string }
            notes: { type: string }
    ChargeflowFCreateRequest:
      type: object
      required: [window]
      properties:
        window:
          type: object
          required: [external_window_id, started_at, ended_at, capacity_kw]
          properties:
            external_window_id: { type: string }
            started_at: { type: string }
            ended_at: { type: string }
            capacity_kw: { type: number }
            direction:
              type: string
              enum: [up, down, both]
            operator_id: { type: string }
            source_format:
              type: string
              enum: [csv, scada_summary, json_custom]
            location:
              type: object
              properties:
                country: { type: string }
                site_id: { type: string }
                asset_id: { type: string }
        attributes:
          type: object
          properties:
            program_hint:
              type: string
              enum: [fcr, afrr, mfrr, demand_response, unknown]
            compare_ref_id: { type: string }
            notes: { type: string }
    ChargeflowResponse:
      type: object
      properties:
        id: { type: string }
        unit_kind: { type: string, enum: [e, w, f] }
        content_hash: { type: string }
        signature: { type: string }
        verify_url: { type: string, format: uri }
        status: { type: string, enum: [active, retired] }
        retired_at: { type: string, format: date-time, nullable: true }
        retire_reason: { type: string, nullable: true }
        public: { type: object }
        created_at: { type: string, format: date-time }
        disclaimer: { type: string }
        valid: { type: boolean }
    ChargeflowListItem:
      type: object
      properties:
        id: { type: string }
        unit_kind: { type: string, enum: [e, w, f] }
        status: { type: string, enum: [active, retired] }
        created_at: { type: string, format: date-time }
        retired_at: { type: string, format: date-time, nullable: true }
        operator_id: { type: string, nullable: true }
        external_ref: { type: string }
        content_hash: { type: string }
        energy_kwh: { type: number }
        volume_m3: { type: number }
        capacity_kw: { type: number }
    ChargeflowListResponse:
      type: object
      properties:
        total: { type: integer }
        limit: { type: integer }
        offset: { type: integer }
        items:
          type: array
          items:
            $ref: "#/components/schemas/ChargeflowListItem"
    ChargeflowEBatchRequest:
      type: object
      required: [items]
      properties:
        items:
          type: array
          minItems: 1
          maxItems: 50
          items:
            $ref: "#/components/schemas/ChargeflowCreateRequest"
    ChargeflowWBatchRequest:
      type: object
      required: [items]
      properties:
        items:
          type: array
          minItems: 1
          maxItems: 50
          items:
            $ref: "#/components/schemas/ChargeflowWCreateRequest"
    ChargeflowFBatchRequest:
      type: object
      required: [items]
      properties:
        items:
          type: array
          minItems: 1
          maxItems: 50
          items:
            $ref: "#/components/schemas/ChargeflowFCreateRequest"
    ChargeflowBatchResponse:
      type: object
      properties:
        total: { type: integer }
        succeeded: { type: integer }
        failed: { type: integer }
        items:
          type: array
          items:
            type: object
    ChargeflowFromOcpiRequest:
      type: object
      properties:
        cdrs:
          type: array
          maxItems: 50
          items:
            type: object
            required: [id, start_date_time, end_date_time, total_energy]
            properties:
              id: { type: string }
              start_date_time: { type: string }
              end_date_time: { type: string }
              total_energy: { type: number }
              country: { type: string }
              location_id: { type: string }
              evse_uid: { type: string }
              connector_id: { type: string }
              cpo_id: { type: string }
              party_id: { type: string }
              auth_id: { type: string }
        csv_rows:
          type: array
          maxItems: 50
          items:
            type: object
            required: [external_session_id, started_at, ended_at, energy_kwh]
            properties:
              external_session_id: { type: string }
              started_at: { type: string }
              ended_at: { type: string }
              energy_kwh: { type: number }
              country: { type: string }
              site_id: { type: string }
              connector_id: { type: string }
              operator_id: { type: string }
              vehicle_ref: { type: string }
        default_operator_id: { type: string }
        attributes:
          $ref: "#/components/schemas/ChargeflowCreateRequest"
    ChargeflowFromOcpiResponse:
      allOf:
        - $ref: "#/components/schemas/ChargeflowBatchResponse"
        - type: object
          properties:
            source: { type: string, enum: [ocpi_stub] }
            disclaimer: { type: string }
    ChargeflowPartnersListResponse:
      type: object
      properties:
        disclaimer: { type: string }
        partners:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
                enum: [tesla_fleet, total_energies, generic_ocpi]
              label: { type: string }
              description: { type: string }
              modes:
                type: array
                items: { type: string, enum: [sandbox, live] }
              credential_fields:
                type: array
                items: { type: string }
              disclaimer: { type: string }
    ChargeflowPartnerSyncRequest:
      type: object
      required: [partner]
      properties:
        partner:
          type: string
          enum: [tesla_fleet, total_energies, generic_ocpi]
        mode:
          type: string
          enum: [sandbox, live]
          default: sandbox
        operator_id: { type: string }
        limit: { type: integer, minimum: 1, maximum: 50 }
        credentials:
          type: object
          properties:
            access_token: { type: string }
            vin: { type: string }
            base_url: { type: string, format: uri }
            token: { type: string }
            party_id: { type: string }
        sessions:
          type: array
          maxItems: 50
          items: { type: object }
    ChargeflowPartnerSyncResponse:
      allOf:
        - $ref: "#/components/schemas/ChargeflowBatchResponse"
        - type: object
          properties:
            partner:
              type: string
              enum: [tesla_fleet, total_energies, generic_ocpi]
            mode: { type: string, enum: [sandbox, live] }
            source: { type: string }
            disclaimer: { type: string }
    WebhookRegisterRequest:
      type: object
      required: [url]
      properties:
        url: { type: string, format: uri }
        events:
          type: array
          items:
            type: string
            enum:
              - score_change
              - regulation_update
              - new_requirement
              - deadline_approaching
              - regulatory.update
              - green.index.changelog
              - chargeflow.unit.minted
              - chargeflow.unit.retired
              - shield.tap.created
              - intelligence.change.observed
    WebhookDelivery:
      type: object
      properties:
        id: { type: string }
        webhook_id: { type: string, nullable: true }
        event: { type: string }
        status:
          type: string
          enum: [pending, delivered, failed, dead_letter]
        attempts: { type: integer }
        last_error: { type: string, nullable: true }
        created_at: { type: string, format: date-time }
        next_retry_at: { type: string, format: date-time, nullable: true }
        delivered_at: { type: string, format: date-time, nullable: true }
        url: { type: string, format: uri }
    WebhookDeliveriesResponse:
      type: object
      properties:
        webhook_id: { type: string }
        deliveries:
          type: array
          items:
            $ref: "#/components/schemas/WebhookDelivery"
        total: { type: integer }
        limit: { type: integer }
        offset: { type: integer }
    WebhookReplayRequest:
      type: object
      properties:
        delivery_id: { type: string }
    WebhookReplayResponse:
      type: object
      properties:
        delivery:
          $ref: "#/components/schemas/WebhookDelivery"
        ok: { type: boolean }
    RegulatoryFeedItem:
      type: object
      required: [id, title, source, jurisdiction, published_at, url, summary, tags]
      properties:
        id: { type: string }
        title: { type: string }
        source:
          type: string
          enum: [ESMA, AMF, BaFin, EC, EBA]
        jurisdiction: { type: string }
        published_at: { type: string, format: date }
        url: { type: string, format: uri }
        summary: { type: string }
        tags:
          type: array
          items:
            type: string
            enum: [mica, esma, amf, bafin]
        severity:
          type: string
          enum: [low, medium, high]
        event_type:
          type: string
          enum: [regulation_update, new_requirement, deadline_approaching]
        deadline: { type: string, nullable: true }
    RegulatoryFeedResponse:
      type: object
      properties:
        disclaimer: { type: string }
        last_updated: { type: string, format: date }
        total: { type: integer }
        items:
          type: array
          items:
            $ref: "#/components/schemas/RegulatoryFeedItem"
        meta:
          type: object
          properties:
            version: { type: string }
            source: { type: string, example: curated }
            note: { type: string }
    RegulatorySubscribeRequest:
      type: object
      properties:
        jurisdictions:
          type: array
          items: { type: string }
          minItems: 1
          default: [eu]
        tags:
          type: array
          items:
            type: string
            enum: [mica, esma, amf, bafin]
        webhook_url: { type: string, format: uri }
        email: { type: string, format: email }
    RegulatorySubscribeResponse:
      type: object
      properties:
        disclaimer: { type: string }
        id: { type: string }
        jurisdictions:
          type: array
          items: { type: string }
        tags:
          type: array
          items: { type: string }
        webhook_url: { type: string, nullable: true }
        events:
          type: array
          items:
            type: string
            enum: [regulatory.update]
        status: { type: string, enum: [active] }
        created_at: { type: string, format: date-time }
    WattScore:
      type: object
      required: [rating, lifetime_gwh, energy_value_eur, tier]
      properties:
        rating:
          type: integer
          minimum: 0
          maximum: 100
          description: Indicative energy-value credibility rating
        lifetime_gwh:
          type: number
          nullable: true
          description: Estimated lifetime energy production (GWh)
        energy_value_eur:
          type: integer
          nullable: true
          description: Indicative lifetime energy value (EUR)
        tier:
          type: string
          enum: [high, mid, early]
    CarbonQualityScore:
      type: object
      required: [score, tier]
      properties:
        score:
          type: integer
          minimum: 0
          maximum: 100
        tier:
          type: string
          enum: [premium, acceptable, caution, avoid]
        registry:
          type: string
          enum: [verra, gold_standard, mixed, unknown]
        ccp_aligned:
          type: boolean
          nullable: true
    GreenNotFoundError:
      type: object
      properties:
        ok: { type: boolean, example: false }
        error: { type: string, example: not_found }
    GreenAssetTypeError:
      type: object
      properties:
        ok: { type: boolean, example: false }
        error:
          type: string
          enum: [not_energy_asset, not_carbon_asset]
        id: { type: string }
    GreenWattPublicResponse:
      type: object
      properties:
        ok: { type: boolean, example: true }
        id: { type: string }
        name: { type: string }
        watt_score:
          $ref: "#/components/schemas/WattScore"
        disclaimer: { type: string }
        batch_api: { type: string, example: /api/v1/green/watt/batch }
        docs: { type: string, format: uri }
        generated_at: { type: string, format: date-time }
    GreenCqsPublicResponse:
      type: object
      properties:
        ok: { type: boolean, example: true }
        id: { type: string }
        name: { type: string }
        carbon_quality:
          $ref: "#/components/schemas/CarbonQualityScore"
        disclaimer: { type: string }
        batch_api: { type: string, example: /api/v1/green/carbon-quality/batch }
        docs: { type: string, format: uri }
        generated_at: { type: string, format: date-time }
    GreenWattBatchRequest:
      type: object
      required: [items]
      properties:
        items:
          type: array
          minItems: 1
          maxItems: 50
          items:
            type: object
            properties:
              id:
                type: string
                description: AUROS Green compare reference id
              text:
                type: string
                minLength: 10
                description: Free-form energy asset description
            description: Each item needs `id` or `text`
    GreenCqsBatchRequest:
      type: object
      required: [items]
      properties:
        items:
          type: array
          minItems: 1
          maxItems: 50
          items:
            type: object
            properties:
              id:
                type: string
                description: AUROS Green compare reference id
              text:
                type: string
                minLength: 10
                description: Free-form carbon credit description
            description: Each item needs `id` or `text`
    GreenWattBatchItemOk:
      type: object
      properties:
        index: { type: integer }
        ok: { type: boolean, example: true }
        id: { type: string, nullable: true }
        watt_score:
          $ref: "#/components/schemas/WattScore"
    GreenWattBatchItemError:
      type: object
      properties:
        index: { type: integer }
        ok: { type: boolean, example: false }
        error:
          type: object
          properties:
            code:
              type: string
              enum: [not_found, not_energy_asset, validation_error]
            message: { type: string }
    GreenWattBatchResponse:
      type: object
      properties:
        disclaimer: { type: string }
        total: { type: integer }
        succeeded: { type: integer }
        failed: { type: integer }
        items:
          type: array
          items:
            oneOf:
              - $ref: "#/components/schemas/GreenWattBatchItemOk"
              - $ref: "#/components/schemas/GreenWattBatchItemError"
        meta:
          type: object
          properties:
            version: { type: string, example: "1.0" }
            computed_at: { type: string, format: date-time }
    GreenCqsBatchItemOk:
      type: object
      properties:
        index: { type: integer }
        ok: { type: boolean, example: true }
        id: { type: string, nullable: true }
        carbon_quality:
          $ref: "#/components/schemas/CarbonQualityScore"
    GreenCqsBatchItemError:
      type: object
      properties:
        index: { type: integer }
        ok: { type: boolean, example: false }
        error:
          type: object
          properties:
            code:
              type: string
              enum: [not_found, not_carbon_asset, validation_error]
            message: { type: string }
    GreenCqsBatchResponse:
      type: object
      properties:
        disclaimer: { type: string }
        total: { type: integer }
        succeeded: { type: integer }
        failed: { type: integer }
        items:
          type: array
          items:
            oneOf:
              - $ref: "#/components/schemas/GreenCqsBatchItemOk"
              - $ref: "#/components/schemas/GreenCqsBatchItemError"
        meta:
          type: object
          properties:
            version: { type: string, example: "1.0" }
            computed_at: { type: string, format: date-time }
  responses:
    Unauthorized:
      description: Missing or invalid API key
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/ProtocolError"
          example:
            disclaimer: "Indicative intelligence only — not legal, tax, or investment advice."
            error:
              code: unauthorized
              message: "Invalid API key"
    NotFound:
      description: Resource not found
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/ProtocolError"
          example:
            disclaimer: "Indicative intelligence only — not legal, tax, or investment advice."
            error:
              code: not_found
              message: "Not found"
    ValidationError:
      description: Invalid request parameters or body
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/ProtocolError"
    RateLimit:
      description: Rate limit or monthly quota exceeded
      headers:
        X-RateLimit-Limit:
          schema:
            type: integer
            example: 1000
        X-RateLimit-Remaining:
          schema:
            type: integer
            example: 0
        X-RateLimit-Reset:
          schema:
            type: integer
            description: Unix timestamp when the limit window resets
            example: 1751328000
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/ProtocolError"
          example:
            disclaimer: "Indicative intelligence only — not legal, tax, or investment advice."
            error:
              code: quota_exceeded
              message: "Monthly quota exceeded (1000 requests/month on free tier)"
    PremiumRequired:
      description: Premium tier required (live key or paid plan)
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/ProtocolError"
          example:
            disclaimer: "Indicative intelligence only — not legal, tax, or investment advice."
            error:
              code: premium_required
              message: "Endpoint réservé au tier premium. Utilisez une clé auros_pk_live_*."
