# MarketNow Skills API - OpenAPI 3.1
# Auto-generated from openapi.json by sync-openapi.py
# Live at: https://marketnow.site/api/openapi.yaml
# Also available as JSON: https://marketnow.site/api/openapi.json

openapi: 3.1.0
info:
  title: MarketNow Skills API
  description: 'The open marketplace for MCP-compatible agent skills. 11,115 verified skills, micro-priced from $0.99 to $9.99.
    Designed for autonomous agent consumption.


    ## Authentication

    Most read endpoints are public (no auth required). Write endpoints (checkout) require no auth but redirect to Stripe.


    ## Rate Limits

    - Anonymous: 60 requests/minute

    - The full catalog (/api/skills.json) is ~12MB — cache locally for 24h


    ## Languages

    Skills are available in 5 languages: en, es, zh, pt, fr. Each skill with a system_prompt has a `translations` field.


    ## Concurrency & Rate Limits (v4.0)

    - Search: 60 req/min per IP

    - Audit: 30 req/min per IP

    - Purchase: 20 req/min per IP

    - Mandates: 30 req/min per IP

    - All endpoints use in-memory caches (5min TTL for skills, 30s for mandates)

    - USDC verification uses a 4-endpoint RPC pool with automatic failover

    - Monitoring: GET /api/manifest?health


    ## Stats (live)

    - 11,115 MCP skills indexed

    - 58 categories

    - 65 free skills

    - 5 languages: EN, ES, ZH, PT, FR

    - Pricing: $B2B pricing one-time, no subscriptions

    - License: AliceLabs LLC Proprietary (source-available, non-commercial)



    ## Concurrency & Rate Limits (v4.1)

    - Search: 60 req/min per IP

    - Audit: 30 req/min per IP

    - Purchase: 20 req/min per IP

    - Mandates: 30 req/min per IP

    - All endpoints use in-memory caches (5min TTL for skills, 30s for mandates)

    - USDC verification uses a 4-endpoint RPC pool with automatic failover

    - Monitoring: GET /api/manifest?health


    ## Stats (live)

    - 11,115 MCP skills indexed

    - 58 categories

    - 65 free skills

    - 5 languages: EN, ES, ZH, PT, FR

    - Pricing: $B2B pricing one-time, no subscriptions

    - License: AliceLabs LLC Proprietary (source-available, non-commercial)

    - Maintainer: AliceLabs LLC (Wyoming, USA, 2025)

    '
  version: 4.1.0
  contact:
    name: MarketNow
    url: https://marketnow.site
    email: info@alicelabs.site
  license:
    name: AliceLabs LLC Proprietary
    url: https://marketnow.site/policies
servers:
- url: https://marketnow.site
  description: Production
paths:
  /api/skills.json:
    get:
      summary: List all skills
      description: 'Returns the complete catalog of 11,115 skills. Each skill includes id, name, slug, description, category,
        tags, price, currency, install command, translations (if available), and system_prompt (if available).


        **Cache this response locally** — refresh every 24 hours maximum. The catalog changes infrequently.'
      operationId: listSkills
      parameters:
      - name: q
        in: query
        description: Search query (filter client-side)
        required: false
        schema:
          type: string
      - name: category
        in: query
        description: Filter by category (filter client-side)
        required: false
        schema:
          type: string
          enum:
          - AI/ML
          - Developer Tools
          - Data
          - Security
          - DevOps
          - Finance
          - Communication
          - Media
          - Healthcare
          - Legal
          - Education
          - Research
          - Analytics
          - IoT
          - Web/API
          - Automation
          - Productivity
          - Blockchain
          - Sales
          - Marketing
          - Agent Reliability
          - Agent Tool Use
          - Agent Context Management
          - Agent Production
          - Agent Safety
          - Agent Performance
          - Cloud
          - Database
          - Mobile
          - Gaming
          - Government
          - Scientific
          - Voice
          - Network
          - System
          - Cognitive
          - Analysis
          - Messaging
      - name: max_price
        in: query
        description: Maximum price in USD (filter client-side)
        required: false
        schema:
          type: number
          minimum: 0.99
          maximum: 9.99
      - name: language
        in: query
        description: Filter by available translation language (filter client-side on translations field)
        required: false
        schema:
          type: string
          enum:
          - en
          - es
          - zh
          - pt
          - fr
      - name: limit
        in: query
        description: Maximum number of results (client-side slice)
        required: false
        schema:
          type: integer
          default: 20
          maximum: 100
      responses:
        '200':
          description: Array of skills
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Skill'
  /api/manifest.json:
    get:
      summary: Get marketplace metadata
      description: Returns marketplace metadata including total skills, pricing tiers, commission rates, and API version.
      operationId: getManifest
      responses:
        '200':
          description: Marketplace manifest
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Manifest'
  /api/categories.json:
    get:
      summary: List all categories
      description: Returns all 46 categories with skill counts.
      operationId: listCategories
      responses:
        '200':
          description: Array of categories
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties:
                    name:
                      type: string
                    slug:
                      type: string
                    count:
                      type: integer
                    url:
                      type: string
                      format: uri
  /api/agent.json:
    get:
      summary: Get agent instructions
      description: Machine-readable instructions for autonomous agents. Includes workflow, tools, rate limits, and authentication
        requirements.
      operationId: getAgentInstructions
      responses:
        '200':
          description: Agent instructions
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentInstructions'
  /api/bundles.json:
    get:
      summary: List skill bundles
      description: Returns curated skill bundles with discounts (40-50% savings).
      operationId: listBundles
      responses:
        '200':
          description: Array of bundles
          content:
            application/json:
              schema:
                type: object
                properties:
                  bundles:
                    type: array
                    items:
                      $ref: '#/components/schemas/Bundle'
  /api/create-checkout-session:
    post:
      summary: Create Stripe Checkout session
      description: 'Creates a Stripe Checkout session for purchasing a skill. Returns a URL that the user (or agent''s human
        operator) should be redirected to. After payment, Stripe redirects back to /vault?success=true&skillId=X.


        **This endpoint creates real charges in LIVE mode.**'
      operationId: createCheckoutSession
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - skillId
              properties:
                skillId:
                  type: string
                  description: Skill ID (e.g. mn-gen-00015)
                  example: mn-gen-00015
                affiliateCode:
                  type: string
                  description: Optional affiliate code for commission tracking
                  example: aff_abc12345
      responses:
        '200':
          description: Checkout session created
          content:
            application/json:
              schema:
                type: object
                properties:
                  url:
                    type: string
                    format: uri
                    description: Stripe Checkout URL
                  sessionId:
                    type: string
                    description: Stripe session ID (cs_live_...)
        '400':
          description: Missing skillId
        '404':
          description: Skill not found
        '503':
          description: Stripe not configured
  /api/stripe-webhook:
    post:
      summary: Stripe webhook receiver
      description: 'Receives Stripe webhook events. Verifies signature using STRIPE_WEBHOOK_SECRET. Handles: checkout.session.completed,
        payment_intent.payment_failed, charge.refunded.


        **This endpoint is called by Stripe, not by agents.**'
      operationId: stripeWebhook
      responses:
        '200':
          description: Webhook received
        '400':
          description: Invalid signature
  /api/mandates:
    get:
      summary: Get / list delegated mandates
      description: ACP / AP2 delegated mandates. With ?id= returns a single mandate. With ?owner=0x... returns all mandates
        owned by that wallet. With ?agent=agent_xxx returns all mandates granted to that agent.
      operationId: getMandates
      parameters:
      - name: id
        in: query
        required: false
        schema:
          type: string
        description: mand_xxx
      - name: owner
        in: query
        required: false
        schema:
          type: string
        description: wallet address (lowercase)
      - name: agent
        in: query
        required: false
        schema:
          type: string
        description: agentId
      responses:
        '200':
          description: Mandate(s) returned
        '404':
          description: Not found
    post:
      summary: Create / revoke / spend a mandate
      description: 'Three actions selected by the ''action'' field in the body:

        - (no action): create a new mandate

        - action=revoke: revoke a mandate by id

        - action=spend: record a spend against a mandate (called internally by /api/agent-purchase after a successful on-chain
        payment)'
      operationId: postMandates
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                action:
                  type: string
                  enum:
                  - revoke
                  - spend
                owner:
                  type: string
                  description: wallet address (create only)
                agentId:
                  type: string
                  description: create only
                agentName:
                  type: string
                  description: create only, optional
                spendingLimitUsd:
                  type: number
                  minimum: 0.01
                  maximum: 500
                  description: create only
                perPurchaseCapUsd:
                  type: number
                  minimum: 0.01
                  maximum: 50
                  description: create only, optional
                categories:
                  type: array
                  items:
                    type: string
                  description: create only, optional (defaults to ['*'])
                expiresAt:
                  type: string
                  format: date-time
                  description: create only, optional
                signature:
                  type: string
                  description: EIP-191 signature over mandate hash, optional but recommended
                id:
                  type: string
                  description: required for revoke / spend
                amount:
                  type: number
                  description: required for spend
                txHash:
                  type: string
                  description: optional for spend, on-chain tx reference
      responses:
        '200':
          description: Action completed
        '201':
          description: Mandate created
        '400':
          description: Validation error
        '404':
          description: Mandate not found
        '409':
          description: Mandate revoked / expired / insufficient remaining
  /api/atc:
    get:
      summary: Agent Trust Card (ATC) — verify identity, validity, and review evidence
      description: 'Agent Trust Card API — SSL certificates for AI agents. MarketNow acts as the Certificate Authority.
        Every ATC is cryptographically signed with the CA Ed25519 private key and persisted to a public GitHub ledger.


        Schema v1.1.0 (July 2026): renamed trust.sentinel_score → trust.sentinel_review_score (review evidence,
        not a verdict). Added decision_authority="consumer" (the runtime makes the trust decision, not the card).


        Action-receipts (also v1.1.0): signed delivery proof for completed purchases. Emitted automatically by
        POST /api/agent-purchase. Verify with action=verify-receipt.'
      operationId: atcOperations
      parameters:
      - name: action
        in: query
        description: 'ATC operation to perform'
        required: true
        schema:
          type: string
          enum:
          - verify
          - verify-receipt
          - ca-key
          - spec
          - list
      - name: card_id
        in: query
        description: 'ATC card ID (required for action=verify). Format: ATC-2026-XXXXXXX'
        required: false
        schema:
          type: string
      - name: receipt_id
        in: query
        description: 'Receipt ID (required for action=verify-receipt). Format: rcpt_xxxxxxxxxxxx'
        required: false
        schema:
          type: string
      responses:
        '200':
          description: ATC operation result
          content:
            application/json:
              schema:
                oneOf:
                - $ref: '#/components/schemas/ATCVerifyResponse'
                - $ref: '#/components/schemas/ReceiptVerifyResponse'
                - $ref: '#/components/schemas/ATCSpec'
                - $ref: '#/components/schemas/ATCList'
        '400':
          description: Missing required parameter (card_id or receipt_id)
        '404':
          description: ATC or receipt not found in registry
        '503':
          description: CA not configured
    post:
      summary: Issue, revoke, or translate ATCs
      description: 'Issue a new ATC (signs with CA key + persists to GitHub), revoke an existing ATC, or
        translate agent tool schemas between frameworks (LangChain ↔ MCP ↔ AutoGen ↔ CrewAI ↔ OpenAI Functions).'
      operationId: atcMutations
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - action
              properties:
                action:
                  type: string
                  enum:
                  - issue
                  - revoke
                  - translate
                agent_id:
                  type: string
                  description: Required for action=issue
                public_key:
                  type: string
                  description: Required for action=issue (Ed25519 public key, SPKI PEM or base64 raw)
                card_id:
                  type: string
                  description: Required for action=revoke
                reason:
                  type: string
                  description: Optional revocation reason
                from:
                  type: string
                  description: Required for action=translate
                to:
                  type: string
                  description: Required for action=translate
                message:
                  type: object
                  description: Required for action=translate
      responses:
        '201':
          description: ATC issued (action=issue)
        '200':
          description: ATC revoked or translated
        '400':
          description: Missing required field
        '503':
          description: CA not configured
  /api/agent-purchase:
    post:
      summary: Agent programmatic purchase (USDC on Base + mandate-aware)
      description: 'Dual-mode purchase endpoint. Returns one of: instant_download (free skill), instant_purchase (paid skill
        with valid mandate + verified USDC tx), direct_purchase (paid skill with verified USDC tx, no mandate), requires_payment
        (mandate valid but no txHash yet), requires_human_approval (no mandate and no payment — agent must request approval).'
      operationId: agentPurchase
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - skillId
              properties:
                skillId:
                  type: string
                walletAddress:
                  type: string
                  description: agent's wallet, required for paid
                txHash:
                  type: string
                  description: USDC Transfer on Base, required for paid
                mandateId:
                  type: string
                  description: optional, enables autonomous purchase within pre-approved limit
                agentId:
                  type: string
                  description: optional, for tracking
      responses:
        '200':
          description: Purchase response — check the 'mode' field to determine next step
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  mode:
                    type: string
                    enum:
                    - instant_download
                    - instant_purchase
                    - direct_purchase
                    - requires_payment
                    - requires_human_approval
                  license:
                    type: object
                  system_prompt:
                    type: string
                  install:
                    type: string
                  mandate:
                    type: object
                  options:
                    type: object
        '400':
          description: Payment verification failed
        '404':
          description: Skill or mandate not found
        '405':
          description: Method not allowed
components:
  schemas:
    Skill:
      type: object
      required:
      - id
      - name
      - slug
      - description
      - category
      - price
      properties:
        id:
          type: string
          description: Unique identifier
          example: mn-gen-00015
        name:
          type: string
          description: Human-readable name
          example: Discord-mcp-server
        slug:
          type: string
          description: URL-safe slug for install command
          example: discord-mcp-server
        description:
          type: string
          description: What the skill does
          example: A comprehensive MCP server for Discord interaction
        category:
          type: string
          description: Skill category
          example: Communication
        tags:
          type: array
          items:
            type: string
          description: Searchable tags
        price:
          type: number
          description: Price in USD
          minimum: 0.99
          maximum: 9.99
          example: 1.99
        currency:
          type: string
          description: Always USD
          example: USD
        payment:
          type: string
          description: Always one-time
          example: one-time
        license:
          type: string
          description: Always perpetual
          example: perpetual
        verified:
          type: boolean
          description: Always true (all skills pass Sentinel L1)
        sentinel_score:
          type: integer
          description: Security score 0-10
          minimum: 0
          maximum: 10
        install:
          type: string
          description: Shell command to install
          example: npx -y @marketnow/install discord-mcp-server
        author:
          type: string
          description: Skill author
        version:
          type: string
          description: Semver version
          example: 1.0.0
        language:
          type: string
          description: Source language
          example: es
        translations:
          type: object
          description: Available translations (only for skills with system_prompt)
          properties:
            en:
              $ref: '#/components/schemas/Translation'
            es:
              $ref: '#/components/schemas/Translation'
            zh:
              $ref: '#/components/schemas/Translation'
            pt:
              $ref: '#/components/schemas/Translation'
            fr:
              $ref: '#/components/schemas/Translation'
        doc:
          type: object
          properties:
            setup:
              type: string
            usage:
              type: string
            system_prompt:
              type: string
              description: Ready-to-use system prompt for AI agents
        premium:
          type: boolean
          description: True if premium tier skill
        tier:
          type: string
          description: Premium tier name
    Translation:
      type: object
      properties:
        name:
          type: string
        description:
          type: string
        system_prompt:
          type: string
    Manifest:
      type: object
      properties:
        name:
          type: string
        version:
          type: string
        total_skills:
          type: integer
        categories_count:
          type: integer
        pricing:
          type: object
        commission_rate:
          type: number
        endpoints:
          type: object
    Bundle:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        description:
          type: string
        skills:
          type: array
          items:
            type: string
        original_price:
          type: number
        bundle_price:
          type: number
        savings:
          type: integer
        category:
          type: string
    AgentInstructions:
      type: object
      properties:
        name:
          type: string
        description:
          type: string
        url:
          type: string
        api_base:
          type: string
        pricing:
          type: object
        endpoints:
          type: object
        workflow_for_agents:
          type: object
        rate_limits:
          type: object
        mcp_server:
          type: object
    ATCVerifyResponse:
      type: object
      description: 'ATC verify response (schema v1.1.0). The ATC answers a narrow set of questions:
        identity, issuer, validity, review evidence. It does NOT answer "should this agent be trusted?" —
        that is a runtime policy decision the consumer makes.'
      properties:
        valid:
          type: boolean
        card_id:
          type: string
        agent_id:
          type: string
        agent_name:
          type: string
        sentinel_review_score:
          type: number
          minimum: 0
          maximum: 10
          description: 'Review evidence (0-10). NOT a trust verdict. Renamed from sentinel_score in v1.1.0.'
        sentinel_score:
          type: number
          description: 'DEPRECATED alias for sentinel_review_score. Will be removed in v2.0.0.'
        composite_trust:
          type: number
        risk_level:
          type: string
          enum:
          - low
          - medium
          - high
          - critical
          - not_audited
          - unknown
        decision_authority:
          type: string
          enum:
          - consumer
          description: 'Always "consumer" — the runtime makes the trust decision, not the card.'
        capabilities:
          type: array
          items:
            type: string
        protocol_language:
          type: string
        wallet:
          type: string
        issued_at:
          type: string
          format: date-time
        expires_at:
          type: string
          format: date-time
        issuer:
          type: string
        signature_algorithm:
          type: string
        signature_valid:
          type: boolean
        schema_version:
          type: string
          description: 'Current: 1.1.0'
        schema_changes:
          type: array
          items:
            type: string
    ReceiptVerifyResponse:
      type: object
      description: 'Action-receipt verify response. A signed delivery proof for a completed purchase.
        Emitted automatically by POST /api/agent-purchase on instant_purchase and direct_purchase modes.
        Persisted to _data/receipts/{receipt_id}.json (public GitHub audit ledger).
        Interop with Vibe (doteyeso-ops): receipt_id → vibe_action_receipt, mandate_id → vibe_decision_ref,
        settle_txhash → vibe_settle_coordinate.'
      properties:
        valid:
          type: boolean
        receipt_id:
          type: string
          pattern: '^rcpt_[a-f0-9]{20}$'
        issued_at:
          type: string
          format: date-time
        mandate_id:
          type: string
          nullable: true
          description: 'Set when purchase used a mandate. Maps to Vibe decision_ref.'
        settle_txhash:
          type: string
          nullable: true
          description: 'On-chain tx hash (Base). Maps to Vibe settle_coordinate.'
        atc_card_id:
          type: string
          nullable: true
          description: 'Co-signed ATC card ID (does NOT replace the settle receipt).'
        delivered:
          type: object
          properties:
            skill_id:
              type: string
            license_key:
              type: string
            content_sha256:
              type: string
              nullable: true
        amount_usd:
          type: number
        network:
          type: string
          enum:
          - base
          - none
        signature_algorithm:
          type: string
        signature_valid:
          type: boolean
        interop:
          type: object
          description: 'Join-key map for Vibe (doteyeso-ops) integration'
          properties:
            vibe_decision_ref:
              type: string
              nullable: true
            vibe_settle_coordinate:
              type: string
              nullable: true
            vibe_action_receipt:
              type: string
    ATCSpec:
      type: object
      description: 'ATC protocol spec (GET /api/atc?action=spec)'
      properties:
        protocol:
          type: string
        version:
          type: string
        schema_version:
          type: string
        decision_authority:
          type: string
        what_the_atc_answers:
          type: array
          items:
            type: string
        what_the_atc_does_NOT_answer:
          type: array
          items:
            type: string
        endpoints:
          type: object
        action_receipts:
          type: object
        schema_changelog:
          type: array
          items:
            type: string
    ATCList:
      type: object
      description: 'ATC list response (GET /api/atc)'
      properties:
        total:
          type: integer
        schema_version:
          type: string
        decision_authority:
          type: string
        cards:
          type: array
          items:
            type: object
            properties:
              card_id:
                type: string
              agent_id:
                type: string
              agent_name:
                type: string
              sentinel_review_score:
                type: number
              sentinel_score:
                type: number
                description: 'DEPRECATED alias'
              risk_level:
                type: string
              status:
                type: string
                enum:
                - active
                - revoked
              issued_at:
                type: string
                format: date-time
              expires_at:
                type: string
                format: date-time
