openapi: 3.1.0
info:
  title: Secant Agent Research API
  description: Paid x402 and MCP-first web research utilities for autonomous agents.
  version: 0.1.0
paths:
  /health:
    get:
      tags:
      - health
      summary: Health
      operationId: health_health_get
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                additionalProperties: true
                type: object
                title: Response Health Health Get
  /config/status:
    get:
      tags:
      - health
      summary: Config Status
      operationId: config_status_config_status_get
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                additionalProperties: true
                type: object
                title: Response Config Status Config Status Get
  /.well-known/x402.json:
    get:
      tags:
      - discovery
      summary: X402 Manifest
      operationId: x402_manifest__well_known_x402_json_get
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
  /agent-card.json:
    get:
      tags:
      - discovery
      summary: Agent Card
      operationId: agent_card_agent_card_json_get
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
  /openapi.yaml:
    get:
      tags:
      - discovery
      summary: Openapi Yaml
      operationId: openapi_yaml_openapi_yaml_get
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
  /x402/parse:
    post:
      tags:
      - protocol
      summary: Parse X402
      operationId: parse_x402_x402_parse_post
      requestBody:
        content:
          application/json:
            schema:
              additionalProperties: true
              type: object
              title: Payload
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ParsedX402Request'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /facilitators:
    get:
      tags:
      - facilitators
      summary: Facilitators
      operationId: facilitators_facilitators_get
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                additionalProperties: true
                type: object
                title: Response Facilitators Facilitators Get
  /facilitators/{facilitator_id}/settle:
    post:
      tags:
      - facilitators
      summary: Modeled Settlement
      operationId: modeled_settlement_facilitators__facilitator_id__settle_post
      parameters:
      - name: facilitator_id
        in: path
        required: true
        schema:
          type: string
          title: Facilitator Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              additionalProperties: true
              title: Payload
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
                title: Response Modeled Settlement Facilitators  Facilitator Id  Settle
                  Post
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /codex/jobs:
    post:
      tags:
      - codex
      summary: Codex Submit Job
      operationId: codex_submit_job_codex_jobs_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CodexJobSubmission'
        required: true
      responses:
        '202':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CodexJobStatus'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /services/catalog:
    get:
      tags:
      - services
      summary: Services Catalog
      operationId: services_catalog_services_catalog_get
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                additionalProperties: true
                type: object
                title: Response Services Catalog Services Catalog Get
  /services/usage:
    get:
      tags:
      - services
      summary: Services Usage
      operationId: services_usage_services_usage_get
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServiceUsageSummary'
  /services/refund-policy:
    get:
      tags:
      - services
      summary: Services Refund Policy
      operationId: services_refund_policy_services_refund_policy_get
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                additionalProperties: true
                type: object
                title: Response Services Refund Policy Services Refund Policy Get
  /operator/service-requests:
    get:
      tags:
      - operator
      summary: Operator Service Requests
      operationId: operator_service_requests_operator_service_requests_get
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BuyerServiceRequestSummary'
    post:
      tags:
      - operator
      summary: Operator Create Service Request
      operationId: operator_create_service_request_operator_service_requests_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BuyerServiceRequestCreate'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BuyerServiceRequestSummary'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /services/search:
    post:
      tags:
      - services
      summary: Service Search
      operationId: service_search_services_search_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SearchRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServiceExecutionResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /services/extract:
    post:
      tags:
      - services
      summary: Service Extract
      operationId: service_extract_services_extract_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ExtractRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServiceExecutionResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /services/research-pack:
    post:
      tags:
      - services
      summary: Service Research Pack
      operationId: service_research_pack_services_research_pack_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ResearchPackRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServiceExecutionResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /services/monitor/diff:
    post:
      tags:
      - services
      summary: Service Monitor Diff
      operationId: service_monitor_diff_services_monitor_diff_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DiffMonitorRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServiceExecutionResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /codex/jobs/{job_id}:
    get:
      tags:
      - codex
      summary: Codex Job Status
      operationId: codex_job_status_codex_jobs__job_id__get
      parameters:
      - name: job_id
        in: path
        required: true
        schema:
          type: string
          title: Job Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CodexJobStatus'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /codex/jobs/{job_id}/result:
    get:
      tags:
      - codex
      summary: Codex Job Result
      operationId: codex_job_result_codex_jobs__job_id__result_get
      parameters:
      - name: job_id
        in: path
        required: true
        schema:
          type: string
          title: Job Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /codex/jobs/{job_id}/log:
    get:
      tags:
      - codex
      summary: Codex Job Log
      operationId: codex_job_log_codex_jobs__job_id__log_get
      parameters:
      - name: job_id
        in: path
        required: true
        schema:
          type: string
          title: Job Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /approvals/policy:
    get:
      tags:
      - approvals
      summary: Approvals Policy
      operationId: approvals_policy_approvals_policy_get
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                additionalProperties: true
                type: object
                title: Response Approvals Policy Approvals Policy Get
  /approvals/checkpoints:
    post:
      tags:
      - approvals
      summary: Approvals Create Checkpoint
      operationId: approvals_create_checkpoint_approvals_checkpoints_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ApprovalCheckpointCreateRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                additionalProperties: true
                type: object
                title: Response Approvals Create Checkpoint Approvals Checkpoints
                  Post
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /approvals/evaluate:
    post:
      tags:
      - approvals
      summary: Approvals Evaluate
      operationId: approvals_evaluate_approvals_evaluate_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ApprovalCheckpointCreateRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApprovalGateEvaluation'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /approvals/checkpoints/decide:
    post:
      tags:
      - approvals
      summary: Approvals Decide Checkpoint
      operationId: approvals_decide_checkpoint_approvals_checkpoints_decide_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Body_approvals_decide_checkpoint_approvals_checkpoints_decide_post'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                additionalProperties: true
                type: object
                title: Response Approvals Decide Checkpoint Approvals Checkpoints
                  Decide Post
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /stripe-mpp/status:
    get:
      tags:
      - stripe-mpp
      summary: Stripe Mpp Status
      operationId: stripe_mpp_status_stripe_mpp_status_get
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StripeMPPBoundaryStatus'
  /stripe-mpp/deposit-intents:
    post:
      tags:
      - stripe-mpp
      summary: Stripe Mpp Deposit Intents
      operationId: stripe_mpp_deposit_intents_stripe_mpp_deposit_intents_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/StripeMPPDepositIntentRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StripeMPPDepositIntentPlan'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /stripe-mpp/webhook:
    post:
      tags:
      - stripe-mpp
      summary: Stripe Mpp Webhook
      operationId: stripe_mpp_webhook_stripe_mpp_webhook_post
      parameters:
      - name: Stripe-Signature
        in: header
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: Stripe-Signature
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StripeWebhookResult'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /audit/schema:
    get:
      tags:
      - audit
      summary: Audit Schema
      operationId: audit_schema_audit_schema_get
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                additionalProperties: true
                type: object
                title: Response Audit Schema Audit Schema Get
  /telemetry:
    get:
      tags:
      - telemetry
      summary: Telemetry
      operationId: telemetry_telemetry_get
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TelemetrySnapshot'
  /rate-limits:
    get:
      tags:
      - pricing
      summary: Rate Limits
      operationId: rate_limits_rate_limits_get
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                additionalProperties: true
                type: object
                title: Response Rate Limits Rate Limits Get
  /pricing/status:
    get:
      tags:
      - pricing
      summary: Pricing Status
      operationId: pricing_status_pricing_status_get
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                additionalProperties: true
                type: object
                title: Response Pricing Status Pricing Status Get
  /pricing/reload:
    post:
      tags:
      - pricing
      summary: Pricing Reload
      operationId: pricing_reload_pricing_reload_post
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                additionalProperties: true
                type: object
                title: Response Pricing Reload Pricing Reload Post
  /pricing/quote:
    get:
      tags:
      - pricing
      summary: Pricing Quote
      operationId: pricing_quote_pricing_quote_get
      parameters:
      - name: paid_requests
        in: query
        required: false
        schema:
          type: integer
          default: 0
          title: Paid Requests
      - name: success_rate
        in: query
        required: false
        schema:
          type: number
          default: 1.0
          title: Success Rate
      - name: units
        in: query
        required: false
        schema:
          type: integer
          default: 1
          title: Units
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
                title: Response Pricing Quote Pricing Quote Get
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /pricing/yield-model:
    get:
      tags:
      - pricing
      summary: Pricing Yield Model
      operationId: pricing_yield_model_pricing_yield_model_get
      parameters:
      - name: paid_requests
        in: query
        required: false
        schema:
          type: integer
          default: 0
          title: Paid Requests
      - name: success_rate
        in: query
        required: false
        schema:
          type: number
          default: 1.0
          title: Success Rate
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
                title: Response Pricing Yield Model Pricing Yield Model Get
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /reconcile:
    post:
      tags:
      - orchestration
      summary: Reconcile
      operationId: reconcile_reconcile_post
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                additionalProperties: true
                type: object
                title: Response Reconcile Reconcile Post
components:
  schemas:
    AckReceipt:
      properties:
        receipt_id:
          type: string
          format: uuid
          title: Receipt Id
        ack_for:
          type: string
          title: Ack For
        status:
          $ref: '#/components/schemas/AckStatus'
        message:
          type: string
          title: Message
        correlation_id:
          anyOf:
          - type: string
          - type: 'null'
          title: Correlation Id
        settlement_reference:
          anyOf:
          - type: string
          - type: 'null'
          title: Settlement Reference
        signature:
          anyOf:
          - type: string
          - type: 'null'
          title: Signature
        signed:
          type: boolean
          title: Signed
          default: false
        live_action_performed:
          type: boolean
          title: Live Action Performed
          default: false
        metadata:
          additionalProperties: true
          type: object
          title: Metadata
        created_at:
          type: string
          format: date-time
          title: Created At
      type: object
      required:
      - ack_for
      - status
      - message
      title: AckReceipt
    AckStatus:
      type: string
      enum:
      - accepted
      - blocked
      - degraded
      - rejected
      title: AckStatus
    ApprovalCheckpointCreateRequest:
      properties:
        checkpoint_type:
          $ref: '#/components/schemas/ApprovalCheckpointType'
        requested_by:
          type: string
          title: Requested By
          default: system
        reason:
          type: string
          title: Reason
          default: ''
        payload:
          additionalProperties: true
          type: object
          title: Payload
      type: object
      required:
      - checkpoint_type
      title: ApprovalCheckpointCreateRequest
    ApprovalCheckpointDecisionRequest:
      properties:
        status:
          $ref: '#/components/schemas/ApprovalDecisionStatus'
        decided_by:
          type: string
          title: Decided By
        reason:
          type: string
          title: Reason
          default: ''
      type: object
      required:
      - status
      - decided_by
      title: ApprovalCheckpointDecisionRequest
    ApprovalCheckpointType:
      type: string
      enum:
      - compliance_configuration
      - major_update
      - stripe_mpp_activation
      - stripe_mpp_deposit_mode
      - live_facilitator_settlement
      title: ApprovalCheckpointType
    ApprovalDecisionStatus:
      type: string
      enum:
      - pending
      - approved
      - rejected
      title: ApprovalDecisionStatus
    ApprovalGateEvaluation:
      properties:
        checkpoint_type:
          $ref: '#/components/schemas/ApprovalCheckpointType'
        state:
          $ref: '#/components/schemas/ComponentState'
        allowed:
          type: boolean
          title: Allowed
        decision_status:
          $ref: '#/components/schemas/ApprovalDecisionStatus'
        message:
          type: string
          title: Message
        required_human_roles:
          items:
            type: string
          type: array
          title: Required Human Roles
        checkpoint_id:
          anyOf:
          - type: string
            format: uuid
          - type: 'null'
          title: Checkpoint Id
      type: object
      required:
      - checkpoint_type
      - state
      - allowed
      - decision_status
      - message
      - required_human_roles
      title: ApprovalGateEvaluation
    AuditAction:
      type: string
      enum:
      - approval_checkpoint.created
      - approval_checkpoint.decided
      - stripe_mpp.boundary_checked
      - stripe_mpp.deposit_blocked
      - stripe_mpp.webhook_received
      - ack_receipt.emitted
      - telemetry.snapshot_read
      title: AuditAction
    AuditEventRecord:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        actor:
          type: string
          title: Actor
          default: system
        action:
          $ref: '#/components/schemas/AuditAction'
        subject:
          type: string
          title: Subject
        severity:
          $ref: '#/components/schemas/AuditSeverity'
          default: info
        detail:
          additionalProperties: true
          type: object
          title: Detail
        created_at:
          type: string
          format: date-time
          title: Created At
      type: object
      required:
      - action
      - subject
      title: AuditEventRecord
    AuditSeverity:
      type: string
      enum:
      - info
      - warning
      - error
      title: AuditSeverity
    Body_approvals_decide_checkpoint_approvals_checkpoints_decide_post:
      properties:
        create_payload:
          $ref: '#/components/schemas/ApprovalCheckpointCreateRequest'
        decision:
          $ref: '#/components/schemas/ApprovalCheckpointDecisionRequest'
      type: object
      required:
      - create_payload
      - decision
      title: Body_approvals_decide_checkpoint_approvals_checkpoints_decide_post
    BuyerServiceRequestAlert:
      properties:
        requested_service:
          type: string
          title: Requested Service
        alert:
          type: boolean
          title: Alert
        qualified_request_count:
          type: integer
          title: Qualified Request Count
        total_request_count:
          type: integer
          title: Total Request Count
        max_estimated_calls_per_day:
          type: integer
          title: Max Estimated Calls Per Day
        estimated_calls_per_day:
          type: integer
          title: Estimated Calls Per Day
        reasons:
          items:
            type: string
          type: array
          title: Reasons
        recommended_action:
          type: string
          title: Recommended Action
      type: object
      required:
      - requested_service
      - alert
      - qualified_request_count
      - total_request_count
      - max_estimated_calls_per_day
      - estimated_calls_per_day
      - reasons
      - recommended_action
      title: BuyerServiceRequestAlert
    BuyerServiceRequestCreate:
      properties:
        requested_service:
          type: string
          maxLength: 160
          minLength: 2
          title: Requested Service
        buyer:
          type: string
          maxLength: 200
          title: Buyer
          default: ''
        source:
          type: string
          maxLength: 120
          title: Source
          default: operator
        contact:
          type: string
          maxLength: 200
          title: Contact
          default: ''
        estimated_calls_per_day:
          type: integer
          maximum: 10000000.0
          minimum: 0.0
          title: Estimated Calls Per Day
          default: 0
        urgency:
          type: string
          enum:
          - low
          - medium
          - high
          - urgent
          title: Urgency
          default: medium
        status:
          type: string
          enum:
          - new
          - scoping
          - planned
          - shipped
          - dismissed
          title: Status
          default: new
        notes:
          type: string
          maxLength: 2000
          title: Notes
          default: ''
      type: object
      required:
      - requested_service
      title: BuyerServiceRequestCreate
    BuyerServiceRequestRecord:
      properties:
        requested_service:
          type: string
          maxLength: 160
          minLength: 2
          title: Requested Service
        buyer:
          type: string
          maxLength: 200
          title: Buyer
          default: ''
        source:
          type: string
          maxLength: 120
          title: Source
          default: operator
        contact:
          type: string
          maxLength: 200
          title: Contact
          default: ''
        estimated_calls_per_day:
          type: integer
          maximum: 10000000.0
          minimum: 0.0
          title: Estimated Calls Per Day
          default: 0
        urgency:
          type: string
          enum:
          - low
          - medium
          - high
          - urgent
          title: Urgency
          default: medium
        status:
          type: string
          enum:
          - new
          - scoping
          - planned
          - shipped
          - dismissed
          title: Status
          default: new
        notes:
          type: string
          maxLength: 2000
          title: Notes
          default: ''
        id:
          type: string
          title: Id
        qualified:
          type: boolean
          title: Qualified
        created_at:
          type: string
          title: Created At
        updated_at:
          anyOf:
          - type: string
          - type: 'null'
          title: Updated At
      type: object
      required:
      - requested_service
      - id
      - qualified
      - created_at
      title: BuyerServiceRequestRecord
    BuyerServiceRequestStorage:
      properties:
        mode:
          type: string
          enum:
          - postgres
          - supabase
          - memory_fallback
          title: Mode
        persistent:
          type: boolean
          title: Persistent
        detail:
          type: string
          title: Detail
      type: object
      required:
      - mode
      - persistent
      - detail
      title: BuyerServiceRequestStorage
    BuyerServiceRequestSummary:
      properties:
        total_requests:
          type: integer
          title: Total Requests
        qualified_requests:
          type: integer
          title: Qualified Requests
        alert_count:
          type: integer
          title: Alert Count
        storage:
          $ref: '#/components/schemas/BuyerServiceRequestStorage'
        build_thresholds:
          additionalProperties:
            type: integer
          type: object
          title: Build Thresholds
        alerts:
          items:
            $ref: '#/components/schemas/BuyerServiceRequestAlert'
          type: array
          title: Alerts
        requests:
          items:
            $ref: '#/components/schemas/BuyerServiceRequestRecord'
          type: array
          title: Requests
      type: object
      required:
      - total_requests
      - qualified_requests
      - alert_count
      - storage
      - build_thresholds
      - alerts
      - requests
      title: BuyerServiceRequestSummary
    CodexJobStatus:
      properties:
        job_id:
          type: string
          title: Job Id
        status:
          type: string
          title: Status
        payment_status:
          type: string
          title: Payment Status
        created_at:
          type: string
          title: Created At
        paid_at:
          anyOf:
          - type: string
          - type: 'null'
          title: Paid At
        started_at:
          anyOf:
          - type: string
          - type: 'null'
          title: Started At
        finished_at:
          anyOf:
          - type: string
          - type: 'null'
          title: Finished At
        exit_code:
          anyOf:
          - type: integer
          - type: 'null'
          title: Exit Code
        model:
          anyOf:
          - type: string
          - type: 'null'
          title: Model
        log_path:
          type: string
          title: Log Path
        workspace_path:
          type: string
          title: Workspace Path
        result_path:
          type: string
          title: Result Path
        result:
          anyOf:
          - type: string
          - type: 'null'
          title: Result
        error:
          anyOf:
          - type: string
          - type: 'null'
          title: Error
        payment_context:
          additionalProperties: true
          type: object
          title: Payment Context
      type: object
      required:
      - job_id
      - status
      - payment_status
      - created_at
      - log_path
      - workspace_path
      - result_path
      title: CodexJobStatus
    CodexJobSubmission:
      properties:
        prompt:
          type: string
          minLength: 1
          title: Prompt
        payment:
          additionalProperties: true
          type: object
          title: Payment
        facilitator_id:
          type: string
          title: Facilitator Id
          default: evm-base
        model:
          anyOf:
          - type: string
          - type: 'null'
          title: Model
        job_id:
          anyOf:
          - type: string
          - type: 'null'
          title: Job Id
      type: object
      required:
      - prompt
      - payment
      title: CodexJobSubmission
    ComponentState:
      type: string
      enum:
      - ready
      - degraded
      - blocked
      title: ComponentState
    DiffMonitorRequest:
      properties:
        payment:
          additionalProperties: true
          type: object
          title: Payment
        payment_identifier:
          anyOf:
          - type: string
          - type: 'null'
          title: Payment Identifier
        facilitator_id:
          type: string
          title: Facilitator Id
          default: evm-base
        url:
          type: string
          maxLength: 2083
          minLength: 1
          format: uri
          title: Url
        previous_hash:
          anyOf:
          - type: string
            maxLength: 128
          - type: 'null'
          title: Previous Hash
        previous_text:
          anyOf:
          - type: string
            maxLength: 200000
          - type: 'null'
          title: Previous Text
      type: object
      required:
      - url
      title: DiffMonitorRequest
    DiscoveryArtifactHealth:
      properties:
        x402_manifest:
          $ref: '#/components/schemas/ComponentState'
        openapi:
          $ref: '#/components/schemas/ComponentState'
        agent_card:
          $ref: '#/components/schemas/ComponentState'
        detail:
          type: string
          title: Detail
      type: object
      required:
      - x402_manifest
      - openapi
      - agent_card
      - detail
      title: DiscoveryArtifactHealth
    ExtractRequest:
      properties:
        payment:
          additionalProperties: true
          type: object
          title: Payment
        payment_identifier:
          anyOf:
          - type: string
          - type: 'null'
          title: Payment Identifier
        facilitator_id:
          type: string
          title: Facilitator Id
          default: evm-base
        urls:
          items:
            type: string
            maxLength: 2083
            minLength: 1
            format: uri
          type: array
          maxItems: 20
          minItems: 1
          title: Urls
      type: object
      required:
      - urls
      title: ExtractRequest
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    LatencyTelemetry:
      properties:
        p50_ms:
          anyOf:
          - type: number
          - type: 'null'
          title: P50 Ms
        p95_ms:
          anyOf:
          - type: number
          - type: 'null'
          title: P95 Ms
        p99_ms:
          anyOf:
          - type: number
          - type: 'null'
          title: P99 Ms
        state:
          $ref: '#/components/schemas/ComponentState'
          default: degraded
        detail:
          type: string
          title: Detail
          default: Latency metrics are structured but require runtime ingestion.
      type: object
      title: LatencyTelemetry
    ParsedX402Request:
      properties:
        version:
          $ref: '#/components/schemas/X402ProtocolVersion'
        resource:
          type: string
          title: Resource
        settlement_route:
          type: string
          title: Settlement Route
        amount_usd:
          type: number
          title: Amount Usd
        legacy_fallback:
          type: boolean
          title: Legacy Fallback
        payload:
          additionalProperties: true
          type: object
          title: Payload
      type: object
      required:
      - version
      - resource
      - settlement_route
      - amount_usd
      - legacy_fallback
      - payload
      title: ParsedX402Request
    ResearchPackRequest:
      properties:
        payment:
          additionalProperties: true
          type: object
          title: Payment
        payment_identifier:
          anyOf:
          - type: string
          - type: 'null'
          title: Payment Identifier
        facilitator_id:
          type: string
          title: Facilitator Id
          default: evm-base
        query:
          type: string
          maxLength: 500
          minLength: 1
          title: Query
        max_results:
          type: integer
          maximum: 10.0
          minimum: 1.0
          title: Max Results
          default: 10
        extract_pages:
          type: integer
          maximum: 5.0
          minimum: 1.0
          title: Extract Pages
          default: 5
        country:
          anyOf:
          - type: string
            maxLength: 2
          - type: 'null'
          title: Country
        freshness:
          anyOf:
          - type: string
            maxLength: 16
          - type: 'null'
          title: Freshness
      type: object
      required:
      - query
      title: ResearchPackRequest
    SearchRequest:
      properties:
        payment:
          additionalProperties: true
          type: object
          title: Payment
        payment_identifier:
          anyOf:
          - type: string
          - type: 'null'
          title: Payment Identifier
        facilitator_id:
          type: string
          title: Facilitator Id
          default: evm-base
        query:
          type: string
          maxLength: 500
          minLength: 1
          title: Query
        max_results:
          type: integer
          maximum: 10.0
          minimum: 1.0
          title: Max Results
          default: 10
        country:
          anyOf:
          - type: string
            maxLength: 2
          - type: 'null'
          title: Country
        freshness:
          anyOf:
          - type: string
            maxLength: 16
          - type: 'null'
          title: Freshness
      type: object
      required:
      - query
      title: SearchRequest
    ServiceExecutionResponse:
      properties:
        service_id:
          $ref: '#/components/schemas/ServiceId'
        status:
          type: string
          title: Status
        price_usd:
          type: number
          title: Price Usd
        net_usd:
          type: number
          title: Net Usd
        reputation_tier:
          type: string
          title: Reputation Tier
        payment_identifier:
          anyOf:
          - type: string
          - type: 'null'
          title: Payment Identifier
        cached:
          type: boolean
          title: Cached
          default: false
        latency_ms:
          type: integer
          title: Latency Ms
        result:
          additionalProperties: true
          type: object
          title: Result
        payment_context:
          additionalProperties: true
          type: object
          title: Payment Context
      type: object
      required:
      - service_id
      - status
      - price_usd
      - net_usd
      - reputation_tier
      - payment_identifier
      - latency_ms
      - result
      - payment_context
      title: ServiceExecutionResponse
    ServiceId:
      type: string
      enum:
      - research_pack
      - search
      - extract
      - monitor_diff
      - codex_audit
      title: ServiceId
    ServiceUsageSummary:
      properties:
        total_paid_requests:
          type: integer
          title: Total Paid Requests
        successful_requests:
          type: integer
          title: Successful Requests
        realized_revenue_usd:
          type: number
          title: Realized Revenue Usd
        estimated_net_usd:
          type: number
          title: Estimated Net Usd
        unique_wallets:
          type: integer
          title: Unique Wallets
        service_counts:
          additionalProperties:
            type: integer
          type: object
          title: Service Counts
        repeat_buyer_count:
          type: integer
          title: Repeat Buyer Count
      type: object
      required:
      - total_paid_requests
      - successful_requests
      - realized_revenue_usd
      - estimated_net_usd
      - unique_wallets
      - service_counts
      - repeat_buyer_count
      title: ServiceUsageSummary
    SettlementDelayTelemetry:
      properties:
        p50_seconds:
          anyOf:
          - type: number
          - type: 'null'
          title: P50 Seconds
        p95_seconds:
          anyOf:
          - type: number
          - type: 'null'
          title: P95 Seconds
        state:
          $ref: '#/components/schemas/ComponentState'
          default: degraded
        detail:
          type: string
          title: Detail
          default: Settlement delay metrics are structured but require facilitator
            receipts.
      type: object
      title: SettlementDelayTelemetry
    StripeMPPBoundaryStatus:
      properties:
        state:
          $ref: '#/components/schemas/ComponentState'
        mode:
          $ref: '#/components/schemas/StripeMPPMode'
          default: deposit_mode
        stripe_mode:
          type: string
          title: Stripe Mode
        active_secret_key_name:
          type: string
          title: Active Secret Key Name
        enabled_by_config:
          type: boolean
          title: Enabled By Config
        secret_configured:
          type: boolean
          title: Secret Configured
        webhook_configured:
          type: boolean
          title: Webhook Configured
        approval:
          $ref: '#/components/schemas/ApprovalGateEvaluation'
        live_actions_enabled:
          type: boolean
          title: Live Actions Enabled
        message:
          type: string
          title: Message
        human_gated:
          type: boolean
          title: Human Gated
          default: true
      type: object
      required:
      - state
      - stripe_mode
      - active_secret_key_name
      - enabled_by_config
      - secret_configured
      - webhook_configured
      - approval
      - live_actions_enabled
      - message
      title: StripeMPPBoundaryStatus
    StripeMPPDepositIntentPlan:
      properties:
        plan_id:
          type: string
          format: uuid
          title: Plan Id
        mode:
          $ref: '#/components/schemas/StripeMPPMode'
          default: deposit_mode
        can_create_live_intent:
          type: boolean
          title: Can Create Live Intent
        requires_human_approval:
          type: boolean
          title: Requires Human Approval
          default: true
        status:
          $ref: '#/components/schemas/ComponentState'
        reason:
          type: string
          title: Reason
        request:
          $ref: '#/components/schemas/StripeMPPDepositIntentRequest'
        receipt:
          $ref: '#/components/schemas/AckReceipt'
        audit_events:
          items:
            $ref: '#/components/schemas/AuditEventRecord'
          type: array
          title: Audit Events
        stripe_payment_intent_id:
          anyOf:
          - type: string
          - type: 'null'
          title: Stripe Payment Intent Id
        client_secret_present:
          type: boolean
          title: Client Secret Present
          default: false
        created_at:
          type: string
          format: date-time
          title: Created At
      type: object
      required:
      - can_create_live_intent
      - status
      - reason
      - request
      - receipt
      - audit_events
      title: StripeMPPDepositIntentPlan
    StripeMPPDepositIntentRequest:
      properties:
        tenant_id:
          type: string
          title: Tenant Id
        wallet:
          type: string
          title: Wallet
        amount_usd:
          type: number
          exclusiveMinimum: 0.0
          title: Amount Usd
        correlation_id:
          anyOf:
          - type: string
          - type: 'null'
          title: Correlation Id
        metadata:
          additionalProperties: true
          type: object
          title: Metadata
      type: object
      required:
      - tenant_id
      - wallet
      - amount_usd
      title: StripeMPPDepositIntentRequest
    StripeMPPMode:
      type: string
      enum:
      - deposit_mode
      title: StripeMPPMode
    StripeWebhookEvent:
      properties:
        event_id:
          anyOf:
          - type: string
          - type: 'null'
          title: Event Id
        event_type:
          anyOf:
          - type: string
          - type: 'null'
          title: Event Type
        livemode:
          type: boolean
          title: Livemode
          default: false
        received_at:
          type: string
          format: date-time
          title: Received At
        payload:
          additionalProperties: true
          type: object
          title: Payload
      type: object
      title: StripeWebhookEvent
    StripeWebhookResult:
      properties:
        accepted:
          type: boolean
          title: Accepted
        status:
          $ref: '#/components/schemas/ComponentState'
        message:
          type: string
          title: Message
        event:
          $ref: '#/components/schemas/StripeWebhookEvent'
        receipt:
          $ref: '#/components/schemas/AckReceipt'
        audit_events:
          items:
            $ref: '#/components/schemas/AuditEventRecord'
          type: array
          title: Audit Events
      type: object
      required:
      - accepted
      - status
      - message
      - event
      - receipt
      - audit_events
      title: StripeWebhookResult
    TelemetrySnapshot:
      properties:
        generated_at:
          type: string
          format: date-time
          title: Generated At
        overall_state:
          $ref: '#/components/schemas/ComponentState'
        health:
          additionalProperties:
            additionalProperties:
              type: string
            type: object
          type: object
          title: Health
        latency:
          $ref: '#/components/schemas/LatencyTelemetry'
        settlement_delay:
          $ref: '#/components/schemas/SettlementDelayTelemetry'
        facilitators:
          items:
            additionalProperties: true
            type: object
          type: array
          title: Facilitators
        stripe_mpp:
          additionalProperties: true
          type: object
          title: Stripe Mpp
        discovery:
          $ref: '#/components/schemas/DiscoveryArtifactHealth'
        pricing:
          additionalProperties: true
          type: object
          title: Pricing
        audit_events:
          items:
            $ref: '#/components/schemas/AuditEventRecord'
          type: array
          title: Audit Events
      type: object
      required:
      - overall_state
      - health
      - facilitators
      - stripe_mpp
      - discovery
      - pricing
      - audit_events
      title: TelemetrySnapshot
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
            - type: string
            - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
      - loc
      - msg
      - type
      title: ValidationError
    X402ProtocolVersion:
      type: string
      enum:
      - x402-v1
      - x402-v2
      title: X402ProtocolVersion
