Rokha Sales API

Sell a rig, skill, agent or pack. You keep 80%, paid in USDC.

GitHub OpenAPI

Operations 14

GET /api/keys Your Rokha keys (rk_…) — prefix, label, last used; never the key #
POST /api/keys Create a Rokha key for an outside agent — shown ONCE #
DELETE /api/keys/{id} Revoke a Rokha key #
GET /api/packs Your packs, with every item (MCP: none — use pack_get per pack) #
POST /api/packs Create — or retitle, keyed by slug — a pack of items you own (MCP pack_create) #
GET /api/packs/{id} What a pack holds and what it costs (public; MCP pack_get) #
PUT /api/packs/{id}/items Add or remove items in your pack (MCP pack_items_set) #
GET /api/products The price on an item (public; MCP product_get) #
PUT /api/products Set or change the price on an item you own (MCP product_set) #
GET /api/products/mine Your products, sales and earnings (you keep 80%) #
GET /api/products/{id} One product by id (public) #
GET /api/products/{id}/access Do I hold it? #
POST /api/products/{id}/checkout Buy for yourself (MCP product_checkout) #
GET /api/purchases/mine What you bought (MCP purchases_mine) #

Specifications

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/rokha-ai:rokha-ai-sales-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

rokha-ai-sales-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  contact:
    name: Rokha
    url: https://rokha.ai
  description: 'The public API of Rokha, the Agent Lab. Build a tool,

    run it for real with a trace, sell it or hire it out. Agents use the same

    doors over MCP at `/mcp/jsonrpc`. Versioning: `GET /api/schema/version`.'
  license:
    name: MIT
    url: https://github.com/rokha-ai/rokha-sdk/blob/main/LICENSE
  title: Rokha Public Sales API
  version: 1.0.0
servers:
- description: Local development (default Erebus port)
  url: http://localhost:3000
- description: Production (hosted Erebus)
  url: https://erebus.rokha.ai
security: []
tags:
- description: Sell a rig, skill, agent or pack. You keep 80%, paid in USDC.
  name: Sales
paths:
  /api/keys:
    get:
      operationId: rokhaKeysList
      responses:
        '200':
          content:
            application/json:
              schema:
                properties:
                  keys:
                    items:
                      additionalProperties: true
                      type: object
                    type: array
                type: object
          description: Keys
      security:
      - bearerAuth: []
      summary: Your Rokha keys (rk_…) — prefix, label, last used; never the key
      tags:
      - Sales
    post:
      description: 'An `rk_…` key is your identity for read, run and buy: send it as `Authorization: Bearer rk_…` to the REST run/buy doors and to `/mcp/jsonrpc`. It cannot change your account, spend a Signet mandate, or mint other keys. Revoke it any time; revocation takes effect on the next call.'
      operationId: rokhaKeyCreate
      requestBody:
        content:
          application/json:
            schema:
              properties:
                label:
                  maxLength: 60
                  type: string
              type: object
      responses:
        '200':
          content:
            application/json:
              schema:
                additionalProperties: true
                properties:
                  key:
                    type: string
                type: object
          description: The key (`key`) — store it now
      security:
      - bearerAuth: []
      summary: Create a Rokha key for an outside agent — shown ONCE
      tags:
      - Sales
  /api/keys/{id}:
    delete:
      operationId: rokhaKeyRevoke
      parameters:
      - in: path
        name: id
        required: true
        schema:
          format: uuid
          type: string
      responses:
        '200':
          description: Revoked
      security:
      - bearerAuth: []
      summary: Revoke a Rokha key
      tags:
      - Sales
  /api/packs:
    get:
      operationId: packsMine
      responses:
        '200':
          content:
            application/json:
              schema:
                properties:
                  packs:
                    items:
                      $ref: '#/components/schemas/Pack'
                    type: array
                type: object
          description: Your packs, newest first
        '401':
          description: Sign in (Bearer JWT)
      security:
      - bearerAuth: []
      summary: 'Your packs, with every item (MCP: none — use pack_get per pack)'
      tags:
      - Sales
    post:
      description: 'A PACK is a creator''s priced set of rigs, skills, harnesses and agents: one purchase unlocks every item in it (`one_time` forever, `monthly` for 30 days, `per_run` spends the pack''s runs across its items). Make it here, fill it with `PUT /api/packs/{id}/items`, then price it with `PUT /api/products {kind: pack, ref: }`. A pack with no price grants nothing. You keep 80% of each sale. JWT only — an `rk_` key is refused.'
      operationId: packCreate
      requestBody:
        content:
          application/json:
            schema:
              properties:
                description:
                  maxLength: 2000
                  type: string
                slug:
                  pattern: ^[a-z0-9_-]{1,60}$
                  type: string
                title:
                  maxLength: 120
                  minLength: 1
                  type: string
              required:
              - slug
              - title
              type: object
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                properties:
                  next:
                    type: string
                  ok:
                    type: boolean
                  pack:
                    $ref: '#/components/schemas/Pack'
                type: object
          description: '`{ok, pack, next}`'
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SaleRefusal'
          description: '`bad_pack` — the slug, title or description is out of shape'
        '401':
          description: '`sign_in`'
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SaleRefusal'
          description: '`key_cannot` — an rk_ key can read, run and buy; sign in to build packs'
        '409':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SaleRefusal'
          description: '`pack_cap` — at most 50 packs per account'
        '503':
          description: '`unavailable`'
      security:
      - bearerAuth: []
      summary: Create — or retitle, keyed by slug — a pack of items you own (MCP pack_create)
      tags:
      - Sales
  /api/packs/{id}:
    get:
      description: 'Public items only (`private_items` counts the rest). With a price: `product` + `buy` (`checkout_url`, the MCP call and the REST door — agents pay with `product_checkout` rail `x402`, `usdc` or `sol`, no browser). Then run any item normally (`rig_run` / `POST /api/rigs/run`) — the run door sees the pack. Unpriced: `{product: null, free: true}` and it grants nothing.'
      operationId: packGet
      parameters:
      - in: path
        name: id
        required: true
        schema:
          format: uuid
          type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                properties:
                  buy:
                    properties:
                      api:
                        type: string
                      checkout_url:
                        type: string
                      mcp:
                        type: string
                    type: object
                  free:
                    type: boolean
                  message:
                    type: string
                  next:
                    type: string
                  pack:
                    $ref: '#/components/schemas/Pack'
                  product:
                    oneOf:
                    - $ref: '#/components/schemas/Product'
                    - type: 'null'
                type: object
          description: The pack
        '404':
          description: '`not_found` — no such pack'
      summary: What a pack holds and what it costs (public; MCP pack_get)
      tags:
      - Sales
  /api/packs/{id}/items:
    put:
      description: '`add` / `remove` are lists of `{kind, ref}` — ref = the registry listing id (rig, skill, harness) or your Forge agent id. Only items you own may be added; one foreign item refuses the whole call (403 `not_yours`) and nothing is written. At most 100 items per pack and 100 changes per call. JWT only.'
      operationId: packItemsSet
      parameters:
      - in: path
        name: id
        required: true
        schema:
          format: uuid
          type: string
      requestBody:
        content:
          application/json:
            schema:
              properties:
                add:
                  items:
                    $ref: '#/components/schemas/PackItemRef'
                  type: array
                remove:
                  items:
                    $ref: '#/components/schemas/PackItemRef'
                  type: array
              type: object
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                properties:
                  ok:
                    type: boolean
                  pack:
                    $ref: '#/components/schemas/Pack'
                type: object
          description: '`{ok, pack}`'
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SaleRefusal'
          description: '`bad_item` (kind is rig · skill · harness · agent) · `too_many` (100 changes per call)'
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SaleRefusal'
          description: '`not_yours` — a pack holds only items you own · `key_cannot`'
        '404':
          description: '`not_found` — no pack of yours has that id'
        '409':
          description: '`pack_full` — a pack holds at most 100 items'
        '503':
          description: '`unavailable`'
      security:
      - bearerAuth: []
      summary: Add or remove items in your pack (MCP pack_items_set)
      tags:
      - Sales
  /api/products:
    get:
      description: '`kind=runs&ref=rokha-runs` reads the House run pack: 100 runs for $1 (`model: per_run`, `runs_per_pack`), spent one run at a time after a signed-in account''s 5 free runs a day. Buy it with `POST /api/products/{id}/checkout` (MCP `product_checkout`) on any rail; the pack''s `product_id` also rides every `BudgetRefusal.ladder`, `GET /api/free-tier` and `GET /api/studio/doors`. All payments are final. The House''s one-time packs read the same way: `kind=runs&ref=rokha-listing-pack` (a free account lists 1 more agent, 3 more rigs, 2 more MCP servers and 3 more skills, for good), `kind=runs&ref=rokha-voice-pack` (20,000 spoken characters for a Lab account past its day), `kind=runs&ref=rokha-x-credits` (300 X credits for a Lab account past its month) and `kind=projects&ref=rokha-project-pack` (3 more Projects). A pack never opens a Lab-only door to a free account; a pack bought for the wrong standing is refused at checkout.'
      operationId: productFor
      parameters:
      - in: query
        name: kind
        required: true
        schema:
          enum:
          - rig
          - skill
          - harness
          - agent
          - pack
          - runs
          - projects
          type: string
      - description: The listing id (rig/skill/harness), the agent id, the pack id, `rokha-runs` · `rokha-listing-pack` · `rokha-voice-pack` · `rokha-x-credits` (kind runs), or `rokha-project-pack` (kind projects)
        in: query
        name: ref
        required: true
        schema:
          type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                properties:
                  product:
                    $ref: '#/components/schemas/Product'
                type: object
          description: The product
        '404':
          description: Not priced — the item is free
      summary: The price on an item (public; MCP product_get)
      tags:
      - Sales
    put:
      operationId: productSet
      requestBody:
        content:
          application/json:
            schema:
              properties:
                active:
                  default: true
                  description: false takes it off sale (free again)
                  type: boolean
                kind:
                  description: pack — ref is your pack id (POST /api/packs); one purchase unlocks every item in it
                  enum:
                  - rig
                  - skill
                  - harness
                  - agent
                  - pack
                  type: string
                model:
                  enum:
                  - one_time
                  - monthly
                  - per_run
                  type: string
                price_cents:
                  maximum: 1000000
                  minimum: 100
                  type: integer
                ref:
                  type: string
                runs_per_pack:
                  description: per_run only — runs bought per purchase
                  minimum: 1
                  type: integer
              required:
              - kind
              - ref
              - model
              - price_cents
              type: object
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                properties:
                  product:
                    $ref: '#/components/schemas/Product'
                type: object
          description: Saved
        '403':
          description: Not the item's owner
      security:
      - bearerAuth: []
      summary: Set or change the price on an item you own (MCP product_set)
      tags:
      - Sales
  /api/products/mine:
    get:
      operationId: productsMine
      responses:
        '200':
          content:
            application/json:
              schema:
                additionalProperties: true
                type: object
          description: Products
      security:
      - bearerAuth: []
      summary: Your products, sales and earnings (you keep 80%)
      tags:
      - Sales
  /api/products/{id}:
    get:
      operationId: productById
      parameters:
      - in: path
        name: id
        required: true
        schema:
          format: uuid
          type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                additionalProperties: true
                properties:
                  kind:
                    type: string
                  product:
                    $ref: '#/components/schemas/Product'
                  proven:
                    description: 'The listing has run clean end to end (an agent: a proven specialty); null = could not be read, and the buy page says so'
                    type:
                    - boolean
                    - 'null'
                  rails:
                    items:
                      type: string
                    type: array
                  ref:
                    type: string
                  sales_open:
                    type: boolean
                  seller:
                    description: The seller's page handle
                    type:
                    - string
                    - 'null'
                  title:
                    type: string
                type: object
          description: The product, and whether the item behind it is proven
        '404':
          description: No such product
        '503':
          description: '`unavailable`'
      summary: One product by id (public)
      tags:
      - Sales
  /api/products/{id}/access:
    get:
      operationId: productAccess
      parameters:
      - in: path
        name: id
        required: true
        schema:
          format: uuid
          type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                properties:
                  access:
                    enum:
                    - open
                    - owner
                    - entitled
                    - required
                    type: string
                  period_end:
                    format: date-time
                    type:
                    - string
                    - 'null'
                  runs_left:
                    type:
                    - integer
                    - 'null'
                  via_pack_product:
                    description: Present when the access comes from a PACK you bought — the pack's product id (a per_run pack spends from the pack)
                    format: uuid
                    type: string
                type: object
          description: Access
      security:
      - bearerAuth: []
      summary: Do I hold it?
      tags:
      - Sales
  /api/products/{id}/checkout:
    post:
      description: '`card` → a Stripe `checkout_url` for a person. `usdc` + `payer_wallet` → exact pay instructions (the odd cents bind the deposit; it confirms on its own). `sol` or `rokha` + `payer_wallet` → the USD price quoted in exact base units at the live price (`amount_sol` + `lamports`, or `amount_rokha` + `rokha_base` + `mint`, with `pay_to` and `expires_at` — held 60 seconds, up to $250 a payment); send exactly that from `payer_wallet` before `expires_at` and it confirms on its own (any other amount, sender or a later transfer does not settle; `price_stale`/`price_unavailable` 503, `over_rail_cap`/`no_fill` 409 = no order was made). The creator is paid in USDC. `x402` → a challenge; transfer, then call again with `signature` — verified on-chain, settles at once. `signet` (signed-in session only) → your own USDC Signet mandate pays: an autonomous mandate pays inside its caps at once, a guarded one answers `awaiting_approval` with an approve link. `fuel` is retired, refused with `rail`. Crypto rails pay the creator their 80% instantly; card sales pay the creator on Fridays.'
      operationId: productCheckout
      parameters:
      - in: path
        name: id
        required: true
        schema:
          format: uuid
          type: string
      requestBody:
        content:
          application/json:
            schema:
              properties:
                chain:
                  description: evm — the chain (also accepts eip155:<id>)
                  enum:
                  - base
                  - ethereum
                  - robinhood
                  type: string
                payer_wallet:
                  description: usdc / sol / rokha — the Solana address the payment is sent FROM; evm — the 0x address it is sent FROM
                  type: string
                rail:
                  enum:
                  - card
                  - usdc
                  - sol
                  - rokha
                  - x402
                  - signet
                  - evm
                  type: string
                ref_code:
                  description: A referral code — the referrer's page handle from rokha.ai/?ref=<handle>. The referrer earns 5% of the price, out of Rokha's share (never your own code, never on a hire of Rokha's own agent).
                  maxLength: 40
                  type: string
                signature:
                  description: x402 — the landed transfer's signature
                  type: string
                token:
                  description: 'evm — Base: USDC · Ethereum: USDC or USDT · Robinhood Chain: USDG (the chain''s default when omitted)'
                  enum:
                  - USDC
                  - USDT
                  - USDG
                  type: string
                tx_hash:
                  description: evm — the landed transfer's hash; omit to open the order (amount + House address), then present it
                  pattern: ^0x[0-9a-fA-F]{64}$
                  type: string
              required:
              - rail
              type: object
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                oneOf:
                - $ref: '#/components/schemas/SolCheckout'
                - additionalProperties: true
                  type: object
          description: 'Checkout started or settled (`status`: paid · settling · awaiting_approval; or card / usdc / sol instructions — the `sol` shape is `SolCheckout`)'
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SaleRefusal'
          description: '`payer_wallet` — usdc / sol need the Solana public key the payment is sent FROM'
        '402':
          description: x402 payment refused (underpaid, wrong payTo/mint, replayed) · no_mandate
        '403':
          description: '`key_cannot_spend` — an rk_ key cannot spend a mandate'
        '409':
          description: '`sales_open_after_friday` · `yours` · `already_pending`'
        '429':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SaleRefusal'
          description: '`too_many_open` — orders already await payment; pay or let one expire first'
        '503':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SaleRefusal'
          description: 'sol: `price_stale` · `price_unavailable` (no fresh SOL/USD read — no order was made) · `rail_off` (SOL rail not configured) · `unavailable`'
      security:
      - bearerAuth: []
      summary: Buy for yourself (MCP product_checkout)
      tags:
      - Sales
  /api/purchases/mine:
    get:
      operationId: purchasesMine
      responses:
        '200':
          content:
            application/json:
              schema:
                additionalProperties: true
                properties:
                  purchases:
                    items:
                      $ref: '#/components/schemas/Purchase'
                    type: array
                type: object
          description: Paid purchases, newest first (up to 200)
      security:
      - bearerAuth: []
      summary: What you bought (MCP purchases_mine)
      tags:
      - Sales
components:
  schemas:
    Pack:
      properties:
        created_at:
          format: date-time
          type: string
        description:
          type: string
        id:
          format: uuid
          type: string
        item_count:
          type: integer
        items:
          items:
            properties:
              added_at:
                format: date-time
                type: string
              agent_handle:
                type: string
              external_id:
                type: string
              kind:
                enum:
                - rig
                - skill
                - harness
                - agent
                type: string
              name:
                type:
                - string
                - 'null'
              own_price:
                properties:
                  model:
                    type: string
                  price_cents:
                    type: integer
                type: object
              provider_id:
                type: string
              public:
                type: boolean
              ref:
                type: string
              run:
                additionalProperties: true
                description: 'Rigs — `{tool: rig_run, args: {provider_id, external_id, wait: true}}`'
                type: object
            type: object
          type: array
        private_items:
          description: Public read only — items not shown because they are not public
          type: integer
        seller:
          description: The seller's page handle
          type:
          - string
          - 'null'
        slug:
          type: string
        title:
          type: string
      type: object
    Purchase:
      additionalProperties: true
      properties:
        amount_cents:
          type: integer
        amount_sol:
          description: sol only — the exact SOL paid, as a decimal string
          type:
          - string
          - 'null'
        id:
          format: uuid
          type: string
        paid_at:
          format: date-time
          type:
          - string
          - 'null'
        period_end:
          format: date-time
          type:
          - string
          - 'null'
        product:
          $ref: '#/components/schemas/Product'
        rail:
          description: '`fuel` appears only on purchases made before that rail retired'
          enum:
          - card
          - usdc
          - sol
          - rokha
          - x402
          - signet
          - fuel
          type: string
        runs_left:
          type:
          - integer
          - 'null'
        status:
          example: paid
          type: string
      type: object
    PackItemRef:
      properties:
        kind:
          enum:
          - rig
          - skill
          - harness
          - agent
          type: string
        ref:
          type: string
      required:
      - kind
      - ref
      type: object
    SaleRefusal:
      properties:
        code:
          description: Same as `error`
          type: string
        error:
          type: string
        message:
          type: string
        ok:
          const: false
          type: boolean
      required:
      - ok
      - error
      - code
      - message
      type: object
    Product:
      additionalProperties: true
      properties:
        active:
          type: boolean
        checkout_url:
          type: string
        id:
          format: uuid
          type: string
        kind:
          description: '`runs` — a House pack (ref `rokha-runs`, `rokha-listing-pack`, `rokha-voice-pack` or `rokha-x-credits`); `projects` — the Project pack (ref `rokha-project-pack`)'
          enum:
          - rig
          - skill
          - harness
          - agent
          - pack
          - hire
          - runs
          - projects
          type: string
        model:
          enum:
          - one_time
          - monthly
          - per_run
          type: string
        price:
          example: $15
          type: string
        price_cents:
          type: integer
        ref:
          type: string
        runs_per_pack:
          type:
          - integer
          - 'null'
        title:
          type: string
      type: object
    SolCheckout:
      description: '`rail: sol` — the USD price quoted in exact lamports at the live price (Jupiter and DexScreener, the lower wins), held 60 seconds, up to $250 a payment. Send exactly `lamports` from `payer_wallet` to `pay_to` before `expires_at`; any other amount, sender or a later transfer does not settle. Confirmed automatically on finality.'
      properties:
        amount_sol:
          description: Exact SOL, as a decimal string
          example: '0.084213517'
          type: string
        expires_at:
          format: date-time
          type: string
        lamports:
          description: Exact lamports — the last digits bind the payment to this order
          type: integer
        mode:
          const: sol
          type: string
        pay:
          properties:
            address:
              type: string
            asset:
              const: SOL
              type: string
            chain:
              const: solana
              type: string
            note:
              type: string
          type: object
        pay_to:
          description: The House sales wallet (Solana)
          type: string
        product:
          $ref: '#/components/schemas/Product'
        quote:
          properties:
            sol_usd:
              description: The SOL/USD price the quote used
              type: number
            source:
              example: jupiter
              type: string
            usd:
              example: $15
              type: string
          type: object
        reference:
          description: The order reference
          example: sol:3f1c…
          type: string
        solana_pay:
          description: A Solana Pay link (`solana:` URI)
          example: solana:<pay_to>?amount=0.084213517
          type: string
      required:
      - mode
      - product
      - reference
      - amount_sol
      - lamports
      - pay_to
      - expires_at
      - quote
      - solana_pay
      - pay
      type: object
  securitySchemes:
    bearerAuth:
      bearerFormat: JWT
      description: 'JWT issued by `/api/wallets/verify` (after `/api/wallets/challenge`),

        or `/api/auth/google/callback`. Send as

        `Authorization: Bearer <token>`. Refresh via `/api/auth/refresh`

        before expiry (24h default).

        '
      scheme: bearer
      type: http