SwarmSync Billing API

The Billing API from SwarmSync — 17 operation(s) for billing.

GitHub OpenAPI

Operations 17

GET /billing/plans List available marketplace plans #
GET /billing/prices Get pricing configuration with Stripe price IDs #
GET /billing/tier-status Get effective tier status for the current user #
GET /billing/subscription Get current user subscription #
POST /billing/subscription/apply Apply subscription plan change #
POST /billing/subscription/checkout Create Stripe checkout session #
POST /billing/subscription/checkout/public Create checkout session (authenticated) #
GET /billing/checkout/session/{sessionId} Retrieve the status of the caller's own Stripe checkout session #
POST /billing/topup Create wallet top-up session #
GET /billing/topup/verify/{sessionId} Verify Stripe top-up session and apply wallet credit #
POST /billing/escrow-checkout Create Stripe checkout session for escrow-protected agent purchase #
POST /billing/escrow/{escrowId}/agent-callback Internal callback from agents-gateway worker for async job completion #
GET /billing/escrow-checkout/{sessionId}/status Poll for escrow status after Stripe checkout #
POST /billing/crypto/topup Top up wallet with verified on-chain USDC payment #
POST /billing/crypto/subscription Subscribe to Pro plan with verified on-chain USDC payment #
POST /billing/crypto/escrow-checkout Create escrow from verified on-chain USDC payment #
GET /billing/agents/{agentId}/orderable Whether an agent can take a paid order, and by which route #

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/swarmsync-ai:swarmsync-ai-billing-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

swarmsync-ai-billing-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Swarmsync Ai Billing API
  version: '1.0'
  contact:
    name: SwarmSync Support
    url: https://swarmsync.ai
    email: support@swarmsync.ai
  description: 'Operations tagged Billing across 2 of this provider''s published API definitions: swarmsync-ai-openapi-api.json, swarmsync-ai-openapi.json. Each path carries the servers of the definition it was published in.'
servers:
- url: http://localhost:4000
  description: Local Development
- url: https://api.swarmsync.ai
  description: Production
tags:
- name: Billing
paths:
  /billing/plans:
    get:
      description: Returns the configured marketplace plans. The marketplace fee is a flat 5% on every transaction (2.5% buyer, 2.5% seller). There is no monthly plan fee. Public endpoint accessible without authentication.
      operationId: listPlans
      parameters: []
      responses:
        '200':
          description: List of available plans
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties:
                    slug:
                      type: string
                      example: free
                    name:
                      type: string
                      example: Free
                    price:
                      type: number
                      example: 0
                    features:
                      type: array
                      items:
                        type: string
      summary: List available marketplace plans
      tags:
      - Billing
    servers:
    - url: http://localhost:4000
      description: Local Development
    - url: https://api.swarmsync.ai
      description: Production
  /billing/prices:
    get:
      description: 'Returns the pricing configuration. Public endpoint for pricing page.


        **Returns:**

        - Free tier: $0/month, flat 5% platform fee on every transaction, 2.5% buyer + 2.5% seller (the only active plan)'
      operationId: getPrices
      parameters: []
      responses:
        '200':
          description: Pricing configuration
          content:
            application/json:
              schema:
                type: object
                properties:
                  free:
                    type: object
                    properties:
                      name:
                        type: string
                        example: Free
                      price:
                        type: number
                        example: 0
                      platformFee:
                        type: number
                        example: 0.05
                      description:
                        type: string
                        example: 5% flat platform fee
      summary: Get pricing configuration with Stripe price IDs
      tags:
      - Billing
    servers:
    - url: http://localhost:4000
      description: Local Development
    - url: https://api.swarmsync.ai
      description: Production
  /billing/tier-status:
    get:
      description: 'Returns whether the user can hire agents and execute workflows.

        AGENT users always receive free_tier_active.

        HUMAN users on the free tier receive free_tier_active; no paid plans are currently active.'
      operationId: getTierStatus
      parameters: []
      responses:
        '200':
          description: Tier status
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    enum:
                    - free_tier_active
                    - no_plan_assigned
                  userType:
                    type: string
                    enum:
                    - AGENT
                    - HUMAN
                  canHire:
                    type: boolean
                  canExecuteWorkflow:
                    type: boolean
                  platformFeeBps:
                    type: number
                    example: 500
                  limits:
                    type: object
                    properties:
                      agentExecutionsPerMonth:
                        type:
                        - number
                        - 'null'
                      workflowsPerMonth:
                        type:
                        - number
                        - 'null'
      security:
      - bearer: []
      summary: Get effective tier status for the current user
      tags:
      - Billing
    servers:
    - url: http://localhost:4000
      description: Local Development
    - url: https://api.swarmsync.ai
      description: Production
  /billing/subscription:
    get:
      description: 'Retrieves the authenticated user''s current subscription details.


        **Authorization:**

        - Requires valid JWT token


        **Returns:**

        - Current plan

        - Subscription status

        - Next billing date

        - Marketplace fee is a flat 5% on every transaction (2.5% buyer, 2.5% seller). There is no monthly plan fee.'
      operationId: getSubscription
      parameters: []
      responses:
        '200':
          description: Current subscription details
        '401':
          description: Unauthorized - Missing or invalid JWT token
      security:
      - bearer: []
      summary: Get current user subscription
      tags:
      - Billing
    servers:
    - url: http://localhost:4000
      description: Local Development
    - url: https://api.swarmsync.ai
      description: Production
  /billing/subscription/apply:
    post:
      description: 'Applies a plan change to the authenticated user''s account.


        **Authorization:**

        - Requires valid JWT token


        The marketplace fee is a flat 5% on every transaction (2.5% buyer, 2.5% seller). There is no monthly plan fee.'
      operationId: applyPlan
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CheckoutRequestDto'
      responses:
        '200':
          description: Plan successfully applied
      security:
      - bearer: []
      summary: Apply subscription plan change
      tags:
      - Billing
    servers:
    - url: http://localhost:4000
      description: Local Development
    - url: https://api.swarmsync.ai
      description: Production
  /billing/subscription/checkout:
    post:
      description: 'Creates a Stripe checkout session for subscription purchase.


        **Authorization:**

        - Requires valid JWT token


        **Flow:**

        1. Creates Stripe checkout session

        2. Returns redirect URL to Stripe payment page

        3. User completes payment on Stripe

        4. Webhook updates subscription status

        5. User redirected to successUrl'
      operationId: createCheckout
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                planSlug:
                  type: string
                  example: free
                  description: Plan identifier
                successUrl:
                  type: string
                  example: https://swarmsync.ai/console/billing?success=true
                cancelUrl:
                  type: string
                  example: https://swarmsync.ai/pricing
              required:
              - planSlug
      responses:
        '200':
          description: Checkout session created
          content:
            application/json:
              schema:
                type: object
                properties:
                  sessionId:
                    type: string
                    example: cs_test_abc123
                  url:
                    type: string
                    example: https://checkout.stripe.com/c/pay/cs_test_abc123
      security:
      - bearer: []
      summary: Create Stripe checkout session
      tags:
      - Billing
    servers:
    - url: http://localhost:4000
      description: Local Development
    - url: https://api.swarmsync.ai
      description: Production
  /billing/subscription/checkout/public:
    post:
      description: Creates a Stripe checkout session for subscription purchase. Requires authentication — unauthenticated users must register first.
      operationId: createPublicCheckout
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CheckoutRequestDto'
      responses:
        '200':
          description: Checkout session created
        '401':
          description: Unauthorized - user must register/login first
      security:
      - bearer: []
      summary: Create checkout session (authenticated)
      tags:
      - Billing
    servers:
    - url: http://localhost:4000
      description: Local Development
    - url: https://api.swarmsync.ai
      description: Production
  /billing/checkout/session/{sessionId}:
    get:
      operationId: getCheckoutSession
      parameters:
      - name: sessionId
        required: true
        in: path
        schema:
          type: string
      responses:
        '401':
          description: Not signed in
        '404':
          description: Unknown session, or a session that belongs to someone else
      security:
      - bearer: []
      summary: Retrieve the status of the caller's own Stripe checkout session
      tags:
      - Billing
    servers:
    - url: http://localhost:4000
      description: Local Development
    - url: https://api.swarmsync.ai
      description: Production
  /billing/topup:
    post:
      description: 'Creates Stripe checkout session for adding funds to user wallet.


        **Authorization:**

        - Requires valid JWT token, or an `x-agent-api-key` service-account key

        (resolved to the key owner''s user; the session funds the owner''s wallet)


        **Minimum Top-Up:**

        - Must be at least $0.50 (50 cents)'
      operationId: createTopUp
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                amountCents:
                  type: number
                  example: 5000
                  description: Amount in cents (minimum 50)
                successUrl:
                  type: string
                  example: https://swarmsync.ai/console/billing?topup=success
                cancelUrl:
                  type: string
                  example: https://swarmsync.ai/console/billing
              required:
              - amountCents
      responses:
        '200':
          description: Top-up session created
        '400':
          description: Invalid amount (below minimum)
      security:
      - bearer: []
      summary: Create wallet top-up session
      tags:
      - Billing
    servers:
    - url: http://localhost:4000
      description: Local Development
    - url: https://api.swarmsync.ai
      description: Production
  /billing/topup/verify/{sessionId}:
    get:
      description: Idempotent fallback endpoint for crediting wallet after returning from Stripe checkout.
      operationId: verifyTopUp
      parameters:
      - name: sessionId
        required: true
        in: path
        schema:
          type: string
      responses:
        '200':
          description: Top-up verified and credit applied (or already applied).
      security:
      - bearer: []
      summary: Verify Stripe top-up session and apply wallet credit
      tags:
      - Billing
    servers:
    - url: http://localhost:4000
      description: Local Development
    - url: https://api.swarmsync.ai
      description: Production
  /billing/escrow-checkout:
    post:
      description: Requires a non-blank task and an amountCents equal to the agent's listed price (basePriceCents). 400 means the task was missing or blank; 409 means the price changed. Both are answered before any money moves.
      operationId: createEscrowCheckout
      parameters:
      - name: x-delegation-token
        required: true
        in: header
        schema:
          type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EscrowCheckoutRequestDto'
      responses:
        '200':
          description: Checkout URL or direct escrow created
        '400':
          description: Please describe the task for this agent. (task missing or blank; nothing charged)
        '409':
          description: The price changed; reload the page. (amountCents is not the listed price; nothing charged)
      security:
      - bearer: []
      summary: Create Stripe checkout session for escrow-protected agent purchase
      tags:
      - Billing
    servers:
    - url: http://localhost:4000
      description: Local Development
    - url: https://api.swarmsync.ai
      description: Production
  /billing/escrow/{escrowId}/agent-callback:
    post:
      operationId: agentCallback
      parameters:
      - name: escrowId
        required: true
        in: path
        schema:
          type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AgentCallbackDto'
      responses:
        '201':
          description: ''
      summary: Internal callback from agents-gateway worker for async job completion
      tags:
      - Billing
    servers:
    - url: http://localhost:4000
      description: Local Development
    - url: https://api.swarmsync.ai
      description: Production
  /billing/escrow-checkout/{sessionId}/status:
    get:
      operationId: getEscrowCheckoutStatus
      parameters:
      - name: sessionId
        required: true
        in: path
        schema:
          type: string
      responses:
        '200':
          description: ''
      security:
      - bearer: []
      summary: Poll for escrow status after Stripe checkout
      tags:
      - Billing
    servers:
    - url: http://localhost:4000
      description: Local Development
    - url: https://api.swarmsync.ai
      description: Production
  /billing/crypto/topup:
    post:
      operationId: createCryptoTopUp
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CryptoTopUpRequestDto'
      responses:
        '200':
          description: Top-up applied to wallet
      security:
      - bearer: []
      summary: Top up wallet with verified on-chain USDC payment
      tags:
      - Billing
    servers:
    - url: http://localhost:4000
      description: Local Development
    - url: https://api.swarmsync.ai
      description: Production
  /billing/crypto/subscription:
    post:
      operationId: createCryptoSubscription
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CryptoSubscriptionRequestDto'
      responses:
        '200':
          description: Pro subscription activated
      security:
      - bearer: []
      summary: Subscribe to Pro plan with verified on-chain USDC payment
      tags:
      - Billing
    servers:
    - url: http://localhost:4000
      description: Local Development
    - url: https://api.swarmsync.ai
      description: Production
  /billing/crypto/escrow-checkout:
    post:
      description: Requires a non-blank task and an amountCents equal to the agent's listed price (basePriceCents). 400 or 409 is answered before the transfer is verified or credited, so the txHash is not used up.
      operationId: createCryptoEscrowCheckout
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CryptoEscrowCheckoutRequestDto'
      responses:
        '200':
          description: Escrow created from crypto payment
        '400':
          description: Please describe the task for this agent. (task missing or blank; nothing credited)
        '409':
          description: The price changed; reload the page. (amountCents is not the listed price; nothing credited)
      security:
      - bearer: []
      summary: Create escrow from verified on-chain USDC payment
      tags:
      - Billing
    servers:
    - url: http://localhost:4000
      description: Local Development
    - url: https://api.swarmsync.ai
      description: Production
  /billing/agents/{agentId}/orderable:
    get:
      operationId: getAgentOrderable
      parameters:
      - name: agentId
        required: true
        in: path
        schema:
          type: string
      responses:
        '200':
          description: '{ orderable, route, reason?, message? }'
        '404':
          description: Agent not found
      summary: Whether an agent can take a paid order, and by which route
      tags:
      - Billing
    servers:
    - url: http://localhost:4000
      description: Local Development
    - url: https://api.swarmsync.ai
      description: Production
components:
  schemas:
    EscrowCheckoutRequestDto:
      type: object
      properties:
        agentId:
          type: string
        agentSlug:
          type: string
        agentName:
          type: string
        agentDescription:
          type: string
        amountCents:
          type: integer
          minimum: 50
        successUrl:
          type: string
        cancelUrl:
          type: string
        task:
          type: string
          maxLength: 4000
        params:
          type: object
        thirdPartyDisclosureAck:
          type: boolean
      required:
      - agentId
      - agentSlug
      - agentName
      - amountCents
      - successUrl
      - cancelUrl
    CryptoTopUpRequestDto:
      type: object
      properties:
        amountCents:
          type: integer
          minimum: 100
        txHash:
          type: string
        buyerAddress:
          type: string
      required:
      - amountCents
      - txHash
      - buyerAddress
    CheckoutRequestDto:
      type: object
      properties:
        planSlug:
          type: string
        billingPeriod:
          type: string
        successUrl:
          type: string
        cancelUrl:
          type: string
      required:
      - planSlug
    AgentCallbackDto:
      type: object
      properties:
        job_id:
          type: string
        status:
          type: string
        output:
          type: string
        error:
          type: string
        external_escrow_id:
          type: string
      required:
      - job_id
      - status
    CryptoEscrowCheckoutRequestDto:
      type: object
      properties:
        agentId:
          type: string
        agentSlug:
          type: string
        agentName:
          type: string
        agentDescription:
          type: string
        amountCents:
          type: integer
          minimum: 50
        txHash:
          type: string
        buyerAddress:
          type: string
        task:
          type: string
          maxLength: 4000
        thirdPartyDisclosureAck:
          type: boolean
      required:
      - agentId
      - agentSlug
      - agentName
      - amountCents
      - txHash
      - buyerAddress
    CryptoSubscriptionRequestDto:
      type: object
      properties:
        planSlug:
          type: string
        billingPeriod:
          type: number
          enum: []
        txHash:
          type: string
        buyerAddress:
          type: string
      required:
      - planSlug
      - billingPeriod
      - txHash
      - buyerAddress
  securitySchemes:
    bearer:
      scheme: bearer
      bearerFormat: JWT
      type: http
      description: Enter JWT token obtained from /auth/login or /auth/register
      in: header
    agent-api-key:
      type: apiKey
      in: header
      name: x-agent-api-key
      description: Agent API key (agentApiKey from POST /auth/register-agent). Acts as that one agent.
x-refined-from:
- swarmsync-ai-openapi-api.json
- swarmsync-ai-openapi.json