Braiins Hashpower API

Public HTTP API for the Braiins Hashpower marketplace: buying hashrate on the spot market, scheduling fixed-duration contracts with guaranteed delivery, and reading account and market data. 35 operations across bid orders, contracts, accounts, market data and market configuration, published as OpenAPI 3.1.0 and rendered in Scalar at https://hashpower.braiins.com/api. Authentication is an API key in the apikey header, scoped by ACL role (owner for trading, read-only for viewing); the four market-data operations are callable anonymously. Every operation publishes its own rate limit in the contract. Notable for two advisory operations — quoteContractCreation and checkContractSpeedAvailability — that let a caller cost and validate a contract without reserving funds or capacity. Braiins labels Hashpower a beta product and the 0% spot bid fee is stated to apply during the beta period.

Operations 35

GET /spot/settings Retrieve market settings & rules #
GET /spot/bid/current List user's bids (active) #
GET /spot/bid List user’s bids (historical & active). #
POST /spot/bid Place new bid (buy order) to the market #
PUT /spot/bid Edit existing bid #
DELETE /spot/bid Cancel existing bid #
GET /spot/bid/detail/{order_id} Get detailed information for a specific bid #
GET /spot/bid/speed/{order_id} Get bid hashrate history time series #
GET /spot/bid/delivery/{order_id} Get bid delivery history time series #
GET /contract List caller-owned contracts #
POST /contract Schedule a new caller-owned contract #
POST /contract/quote Quote and validate a contract creation request #
GET /contract/pricing List current contract pricing #
GET /contract/cancel-fee List current contract cancellation fees #
POST /contract/availability Check whether requested contract hashrate is available #
GET /contract/active List caller-owned pending, running, or paused contracts #
GET /contract/{contract_id}/detail Get a caller-owned contract #
GET /contract/settings Get effective contract policy settings #
POST /contract/{contract_id}:cancel Request cancellation for a pending caller-owned contract #
POST /contract/{contract_id}:terminate Terminate an active caller-owned contract #
GET /contract/activity List contract activity for the caller #
GET /contract/{contract_id}/reservation List reservation history for a caller-owned contract #
GET /contract/{contract_id}/settlement List settlement history for a caller-owned contract #
GET /contract/{contract_id}/speed Get contract hashrate history time series #
GET /contract/{contract_id}/delivery Get contract delivery history time series #
GET /spot/fee Get spot market fee structure #
GET /account/balance Get account balance #
GET /account/transaction List mixed account transactions (deprecated) #
GET /account/transaction/settlement List settlement account transactions #
GET /account/transaction/lock List lock account transactions #
GET /account/transaction/on-chain List on-chain account transactions #
GET /spot/stats Get market statistics #
GET /spot/orderbook Get spot market order book snapshot #
GET /spot/trades Get last market trades #
GET /spot/bars Get aggregated bars for a given market (OHLCV) #

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/braiins-hashpower-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

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. See our Privacy Policy and Terms.

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

OpenAPI Specification

braiins-academy-braiins-hashpower-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Braiins Hashpower API
  description: |-
    Public HTTP API for buying hashrate on the spot market, scheduling fixed-duration
    contracts, and reading account and market data.

    Send the API key in the `apikey` header unless an operation explicitly says that
    authentication is optional or not required. API keys are scoped to an account role;
    an authenticated request can still be rejected when its ACL role or resource ownership
    is insufficient.

    Spot-market price fields use the hashrate unit returned by `GET /spot/settings`.
    For example, when `hr_unit` is `EH/day`, `price_sat` is expressed as satoshi
    per EH/day. Share-price fields such as `fpps_share_price`
    and `*_share_price_btc` are BTC per difficulty unit; fields ending in `_pct` are
    percentages. Monetary fields ending in `_sat` are satoshis unless their field
    description says otherwise.

    Date-time strings use RFC 3339. Endpoint-specific pagination order and timestamp units
    are documented on the relevant parameters.
  version: 1.0.0
servers:
  - url: https://hashpower.braiins.com/v1
    description: Production public API
tags:
  - name: Market configuration
    description: Spot-market rules, units, and fees needed to construct valid orders.
  - name: Bid orders
    description: Create, update, cancel, and inspect caller-owned spot-market bids.
  - name: Contracts
    description: Quote, schedule, manage, and inspect caller-owned fixed-duration contracts.
  - name: Accounts
    description: Read caller-owned balances and accounting transactions.
  - name: Market data
    description: Public statistics, order-book snapshots, trades, and OHLCV bars.
security:
  - ApiKey: []
paths:
  /spot/settings:
    get:
      summary: Retrieve market settings & rules
      description: |-
        Returns the active spot-market status, price tick, hashrate unit, order limits, grace periods, and edit timing rules. Read this resource before placing or editing a bid because the server validates orders against these values.

        **Access:** API key required; allowed ACLs: `staff`, `owner`, `read-only`.

        **Rate limit:** 100 requests/minute per API credential.
      tags: [Market configuration]
      operationId: spotGetMarketSettings
      x-required-acl: [staff, owner, read-only]
      x-rate-limit: 100 requests/minute per API credential
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/MarketSettings"
        "401": { $ref: "#/components/responses/Unauthorized" }
        "403": { $ref: "#/components/responses/Forbidden" }
        "429": { $ref: "#/components/responses/TooManyRequests" }
        default: { $ref: "#/components/responses/ServiceError" }
  /spot/bid/current:
    get:
      summary: List user's bids (active)
      description: |-
        Returns the authenticated caller's currently active bids. Use the general bid-list endpoint when terminal and historical bids are also needed.

        **Access:** API key required; allowed ACLs: `staff`, `owner`, `read-only`.

        **Rate limit:** 100 requests/minute per API credential.
      tags: [Bid orders]
      operationId: spotGetCurrentBids
      x-required-acl: [staff, owner, read-only]
      x-rate-limit: 100 requests/minute per API credential
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/SpotGetBidsResponse"
        "401": { $ref: "#/components/responses/Unauthorized" }
        "403": { $ref: "#/components/responses/Forbidden" }
        "429": { $ref: "#/components/responses/TooManyRequests" }
        default: { $ref: "#/components/responses/ServiceError" }
  /spot/bid:
    get:
      summary: List user’s bids (historical & active).
      description: |-
        Lists caller-owned active and historical bids with optional time, identity, status, and destination filters. Results are ordered by creation time; `reverse=true` changes the order to newest first.

        **Access:** API key required; allowed ACLs: `staff`, `owner`, `read-only`.

        **Rate limit:** 100 requests/minute per API credential.
      tags: [Bid orders]
      operationId: spotGetBids
      x-required-acl: [staff, owner, read-only]
      x-rate-limit: 100 requests/minute per API credential
      parameters:
        - name: limit
          in: query
          description: Limit amount of rows retrieved. Must be between 1 and 1000.
          schema:
            type: integer
            minimum: 1
            maximum: 1000
        - name: offset
          in: query
          description: Offset to start from. Must be >= 0.
          schema:
            $ref: "#/components/schemas/Uint32"
        - name: reverse
          in: query
          description: Reverse (descending) order of results. Default is ascending. Orders are sorted by creation time.
          schema:
            type: boolean
        - name: created_after
          in: query
          description: Filter for orders created on or after YYYY-MM-DD.
          schema:
            type: string
            format: date
            examples:
              - 2025-10-25
        - name: created_before
          in: query
          description: Filter for orders created before YYYY-MM-DD.
          schema:
            type: string
            format: date
            examples:
              - 2025-10-26
        - name: order_id
          in: query
          description: Filter by order ID.
          schema:
            type: string
            examples:
              - B123456789
        - name: bid_status
          in: query
          description: Filter by order status.
          schema:
            $ref: "#/components/schemas/SpotMarketBidStatus"
        - name: exclude_active
          in: query
          description: Exclude current orders.
          schema:
            type: boolean
        - name: upstream_url
          in: query
          description: Filter by upstream URL.
          schema:
            type: string
        - name: upstream_identity
          in: query
          description: Filter by upstream identity.
          schema:
            type: string

      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/SpotGetBidsResponse"
        "400": { $ref: "#/components/responses/BadRequest" }
        "401": { $ref: "#/components/responses/Unauthorized" }
        "403": { $ref: "#/components/responses/Forbidden" }
        "429": { $ref: "#/components/responses/TooManyRequests" }
        default: { $ref: "#/components/responses/ServiceError" }
    post:
      summary: Place new bid (buy order) to the market
      description: |-
        Creates a caller-owned spot buy order. The request is validated against current market settings and account constraints; the response contains the server-assigned public order identifier.

        **Access:** API key required; allowed ACL: `owner`.

        **Rate limit:** 100 requests/minute per API credential.
      tags: [Bid orders]
      operationId: spotPlaceBid
      x-required-acl: [owner]
      x-rate-limit: 100 requests/minute per API credential
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/SpotPlaceBidRequest"
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PlaceOrderResponse"
        "400": { $ref: "#/components/responses/BadRequest" }
        "401": { $ref: "#/components/responses/Unauthorized" }
        "403": { $ref: "#/components/responses/Forbidden" }
        "429": { $ref: "#/components/responses/TooManyRequests" }
        default: { $ref: "#/components/responses/ServiceError" }
    put:
      summary: Edit existing bid
      description: |-
        Updates the provided editable fields of a caller-owned bid selected by its public or client-assigned identifier. Omitted fields remain unchanged; market timing and range rules can prevent price or hashrate-limit decreases.

        **Access:** API key required; allowed ACL: `owner`.

        **Rate limit:** 100 requests/minute per API credential.
      tags: [Bid orders]
      operationId: spotEditBid
      x-required-acl: [owner]
      x-rate-limit: 100 requests/minute per API credential
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/SpotEditBidRequest"
      responses:
        "200":
          description: Bid updated successfully.
        "400": { $ref: "#/components/responses/BadRequest" }
        "401": { $ref: "#/components/responses/Unauthorized" }
        "403": { $ref: "#/components/responses/Forbidden" }
        "404": { $ref: "#/components/responses/NotFound" }
        "429": { $ref: "#/components/responses/TooManyRequests" }
        default: { $ref: "#/components/responses/ServiceError" }
    delete:
      summary: Cancel existing bid
      tags: [Bid orders]
      operationId: spotCancelBid
      description: |-
        Cancels a caller-owned bid. The JSON body must provide exactly one of `order_id` or `cl_order_id`; cancellation can be rejected while the configured bid grace period is active.

        **Access:** API key required; allowed ACL: `owner`.

        **Rate limit:** 100 requests/minute per API credential.
      x-required-acl: [owner]
      x-rate-limit: 100 requests/minute per API credential
      requestBody:
        required: true
        description: Bid selector. Exactly one identifier must be present.
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/SpotCancelBidRequest"
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/CancelResponse"
        "400": { $ref: "#/components/responses/BadRequest" }
        "401": { $ref: "#/components/responses/Unauthorized" }
        "403": { $ref: "#/components/responses/Forbidden" }
        "404": { $ref: "#/components/responses/NotFound" }
        "429": { $ref: "#/components/responses/TooManyRequests" }
        default: { $ref: "#/components/responses/ServiceError" }
  /spot/bid/detail/{order_id}:
    get:
      summary: Get detailed information for a specific bid
      tags: [Bid orders]
      operationId: spotGetBidDetail
      description: |-
        Retrieves a caller-visible bid including current lifecycle state, accounting counters, configured destination, and network status. The bid must belong to the caller unless the API key has staff access.

        **Access:** API key required; allowed ACLs: `staff`, `owner`, `read-only`.

        **Rate limit:** 100 requests/minute per API credential.
      x-required-acl: [staff, owner, read-only]
      x-rate-limit: 100 requests/minute per API credential
      parameters:
        - name: order_id
          in: path
          required: true
          description: The bid order ID (e.g., B123456789)
          schema:
            type: string
            pattern: '^B[0-9]+$'
            examples:
              - B123456789
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/SpotGetBidDetailResponse"
        "400": { $ref: "#/components/responses/BadRequest" }
        "401": { $ref: "#/components/responses/Unauthorized" }
        "403": { $ref: "#/components/responses/Forbidden" }
        "404": { $ref: "#/components/responses/NotFound" }
        "429": { $ref: "#/components/responses/TooManyRequests" }
        default: { $ref: "#/components/responses/ServiceError" }
  /spot/bid/speed/{order_id}:
    get:
      summary: Get bid hashrate history time series
      tags: [Bid orders]
      operationId: spotGetBidSpeedHistory
      description: |-
        Returns estimated delivered hashrate samples for a caller-visible bid. `aggregation_period` controls sample buckets and `sliding_window_size` controls the estimator window; use `datetime_from` and `limit` to bound the series.

        **Access:** API key required; allowed ACLs: `staff`, `owner`, `read-only`.

        **Rate limit:** 100 requests/minute per API credential.
      x-required-acl: [staff, owner, read-only]
      x-rate-limit: 100 requests/minute per API credential
      parameters:
        - name: order_id
          in: path
          required: true
          description: The bid order ID (e.g., B123456789)
          schema:
            type: string
            pattern: '^B[0-9]+$'
            examples:
              - B123456789
        - name: aggregation_period
          in: query
          description: Aggregation period for resampling the data.
          schema:
            $ref: "#/components/schemas/AggregationPeriod"
        - name: sliding_window_size
          in: query
          description: Sliding window size for estimating hashrate.
          schema:
            $ref: "#/components/schemas/SlidingWindowSize"
        - name: datetime_from
          in: query
          description: Datetime from which to start the history (optional). RFC 3339 format expected.
          schema:
            type: string
            format: date-time
            examples:
              - "2025-10-04T12:00:00Z"
        - name: limit
          in: query
          description: Maximum number of items to return (optional).
          schema:
            $ref: "#/components/schemas/Uint32"
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/SpotGetOrderSpeedHistoryResponse"
        "400": { $ref: "#/components/responses/BadRequest" }
        "401": { $ref: "#/components/responses/Unauthorized" }
        "403": { $ref: "#/components/responses/Forbidden" }
        "404": { $ref: "#/components/responses/NotFound" }
        "429": { $ref: "#/components/responses/TooManyRequests" }
        default: { $ref: "#/components/responses/ServiceError" }
  /spot/bid/delivery/{order_id}:
    get:
      summary: Get bid delivery history time series
      tags: [Bid orders]
      operationId: spotGetBidDeliveryHistory
      description: |-
        Returns purchased, accepted, and rejected shares for a caller-visible bid, grouped by the selected aggregation period. Each value is expressed in millions of shares; use `datetime_from` and `limit` to bound the series.

        **Access:** API key required; allowed ACLs: `staff`, `owner`, `read-only`.

        **Rate limit:** 100 requests/minute per API credential.
      x-required-acl: [staff, owner, read-only]
      x-rate-limit: 100 requests/minute per API credential
      parameters:
        - name: order_id
          in: path
          required: true
          description: The bid order ID (e.g., B123456789)
          schema:
            type: string
            pattern: '^B[0-9]+$'
            examples:
              - B123456789
        - name: aggregation_period
          in: query
          description: Aggregation period for resampling the data.
          schema:
            $ref: "#/components/schemas/AggregationPeriod"
        - name: datetime_from
          in: query
          description: Datetime from which to start the history (optional). RFC 3339 format expected.
          schema:
            type: string
            format: date-time
            examples:
              - "2025-10-04T12:00:00Z"
        - name: limit
          in: query
          description: Maximum number of items to return (optional).
          schema:
            $ref: "#/components/schemas/Uint32"
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/SpotGetBidDeliveryHistoryResponse"
        "400": { $ref: "#/components/responses/BadRequest" }
        "401": { $ref: "#/components/responses/Unauthorized" }
        "403": { $ref: "#/components/responses/Forbidden" }
        "404": { $ref: "#/components/responses/NotFound" }
        "429": { $ref: "#/components/responses/TooManyRequests" }
        default: { $ref: "#/components/responses/ServiceError" }
  /contract:
    get:
      summary: List caller-owned contracts
      description: |-
        Lists contracts owned by the authenticated caller for one proof-of-work algorithm. Results can be paginated, reversed, and restricted to a created-at interval expressed in Unix nanoseconds.

        **Access:** API key required; allowed ACLs: `owner`, `read-only`.

        **Rate limit:** 100 requests/minute per API credential.
      tags: [Contracts]
      operationId: getContracts
      x-required-acl: [owner, read-only]
      x-rate-limit: 100 requests/minute per API credential
      parameters:
        - name: pow_algo
          in: query
          required: true
          schema:
            type: string
          description: "Proof-of-work algorithm filter. Canonical spelling: `sha256`; parsing is ASCII case-insensitive."
        - name: limit
          in: query
          description: Maximum number of contracts to return. Omit to use the service default.
          schema:
            type: integer
            format: int32
        - name: offset
          in: query
          description: Zero-based number of matching contracts to skip.
          schema:
            type: integer
            format: int32
        - name: reverse
          in: query
          description: Return newest contracts first when true; the default order is oldest first.
          schema:
            type: boolean
        - name: start_timestamp
          in: query
          schema:
            type: integer
            format: int64
            minimum: 0
            maximum: 9223372036854775807
          description: Inclusive lower created-at filter as Unix timestamp in nanoseconds. Zero disables the filter.
        - name: end_timestamp
          in: query
          schema:
            type: integer
            format: int64
            minimum: 0
            maximum: 9223372036854775807
          description: Exclusive upper created-at filter as Unix timestamp in nanoseconds. Zero disables the filter.
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GetContractsResponse"
        "400": { $ref: "#/components/responses/BadRequest" }
        "401": { $ref: "#/components/responses/Unauthorized" }
        "403": { $ref: "#/components/responses/Forbidden" }
        "429": { $ref: "#/components/responses/TooManyRequests" }
        default: { $ref: "#/components/responses/ServiceError" }
    post:
      summary: Schedule a new caller-owned contract
      description: |-
        Schedules a fixed-duration contract and reserves the required caller funds. Pricing, funds, policy, and capacity are recalculated atomically; a preceding quote or availability check is advisory and does not reserve capacity.

        **Access:** API key required; allowed ACL: `owner`.

        **Rate limit:** 100 requests/minute per API credential.
      tags: [Contracts]
      operationId: scheduleContract
      x-required-acl: [owner]
      x-rate-limit: 100 requests/minute per API credential
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/ScheduleContractRequest"
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ScheduleContractResponse"
        "400": { $ref: "#/components/responses/BadRequest" }
        "401": { $ref: "#/components/responses/Unauthorized" }
        "403": { $ref: "#/components/responses/Forbidden" }
        "429": { $ref: "#/components/responses/TooManyRequests" }
        default: { $ref: "#/components/responses/ServiceError" }
  /contract/quote:
    post:
      summary: Quote and validate a contract creation request
      tags: [Contracts]
      operationId: quoteContractCreation
      description: |-
        Calculates the current hashrate cost, premium, cancellation-weighted premium on the Contractual Funding Tail, available capacity, and caller balance for a proposed contract. This is advisory only and does not reserve funds or capacity; scheduling recomputes all checks.

        **Access:** API key required; allowed ACL: `owner`.

        **Rate limit:** 100 requests/minute per API credential.
      x-required-acl: [owner]
      x-rate-limit: 100 requests/minute per API credential
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/QuoteContractCreationRequest"
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/QuoteContractCreationResponse"
        "400": { $ref: "#/components/responses/BadRequest" }
        "401": { $ref: "#/components/responses/Unauthorized" }
        "403": { $ref: "#/components/responses/Forbidden" }
        "429": { $ref: "#/components/responses/TooManyRequests" }
        default: { $ref: "#/components/responses/ServiceError" }
  /contract/pricing:
    get:
      summary: List current contract pricing
      tags: [Contracts]
      operationId: getCurrentContractPricing
      description: |-
        Lists the active standard and time-limited pricing layers for the requested proof-of-work algorithm.
        A valid API key also includes the authenticated caller's active individual pricing layer.
        Requests without an API key, or with an invalid API key, receive generic pricing only.

        **Access:** API key optional; allowed ACLs: `contract-pricing-public`, `owner`, `read-only`.

        **Rate limit:** 100 requests/minute per client IP.
      security:
        - {}
        - ApiKey: []
      x-required-acl: [contract-pricing-public, owner, read-only]
      x-rate-limit: 100 requests/minute per client IP
      parameters:
        - name: pow_algo
          in: query
          required: true
          schema:
            type: string
          description: "Proof-of-work algorithm. Canonical spelling: `sha256`; parsing is ASCII case-insensitive."
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GetCurrentContractPricingResponse"
        "400": { $ref: "#/components/responses/BadRequest" }
        "429": { $ref: "#/components/responses/TooManyRequests" }
        default: { $ref: "#/components/responses/ServiceError" }
  /contract/cancel-fee:
    get:
      summary: List current contract cancellation fees
      tags: [Contracts]
      operationId: getCurrentContractCancelFees
      description: |-
        Lists active standard and time-limited cancellation-fee layers for the requested proof-of-work algorithm.
        A valid API key also includes the authenticated caller's active individual fee layer.
        Requests without an API key, or with an invalid API key, receive generic fee layers only.

        **Access:** API key optional; allowed ACLs: `contract-cancel-fee-public`, `owner`, `read-only`.

        **Rate limit:** 100 requests/minute per client IP.
      security:
        - {}
        - ApiKey: []
      x-required-acl: [contract-cancel-fee-public, owner, read-only]
      x-rate-limit: 100 requests/minute per client IP
      parameters:
        - name: pow_algo
          in: query
          required: true
          schema:
            type: string
          description: "Proof-of-work algorithm. Canonical spelling: `sha256`; parsing is ASCII case-insensitive."
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GetCurrentContractCancelFeesResponse"
        "400": { $ref: "#/components/responses/BadRequest" }
        "429": { $ref: "#/components/responses/TooManyRequests" }
        default: { $ref: "#/components/responses/ServiceError" }
  /contract/availability:
    post:
      summary: Check whether requested contract hashrate is available
      tags: [Contracts]
      operationId: checkContractSpeedAvailability
      description: |-
        Checks current contract capacity for the requested proof-of-work algorithm, hashrate, and time window. This is advisory and does not reserve capacity; scheduling rechecks while holding the service lock.

        **Access:** API key required; allowed ACL: `owner`.

        **Rate limit:** 100 requests/minute per API credential.
      x-required-acl: [owner]
      x-rate-limit: 100 requests/minute per API credential
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CheckContractSpeedAvailabilityRequest"
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/CheckContractSpeedAvailabilityResponse"
        "400": { $ref: "#/components/responses/BadRequest" }
        "401": { $ref: "#/components/responses/Unauthorized" }
        "403": { $ref: "#/components/responses/Forbidden" }
        "429": { $ref: "#/components/responses/TooManyRequests" }
        default: { $ref: "#/components/responses/ServiceError" }
  /contract/active:
    get:
      summary: List caller-owned pending, running, or paused contracts
      description: |-
        Returns only caller-owned contracts that can still activate or deliver hashrate. Finished, canceled, and terminated contracts remain available from the general contract list.

        **Access:** API key required; allowed ACLs: `owner`, `read-only`.

        **Rate limit:** 100 requests/minute per API credential.
      tags: [Contracts]
      operationId: getActiveContracts
      x-required-acl: [owner, read-only]
      x-rate-limit: 100 requests/minute per API credential
      parameters:
        - name: pow_algo
          in: query
          required: true
          schema:
            type: string
          description: "Proof-of-work algorithm filter. Canonical spelling: `sha256`; parsing is ASCII case-insensitive."
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GetContractsResponse"
        "400": { $ref: "#/components/responses/BadRequest" }
        "401": { $ref: "#/components/responses/Unauthorized" }
        "403": { $ref: "#/components/responses/Forbidden" }
        "429": { $ref: "#/components/responses/TooManyRequests" }
        default: { $ref: "#/components/responses/ServiceError" }
  /contract/{contract_id}/detail:
    get:
      summary: Get a caller-owned contract
      description: |-
        Returns the schedule, destination, lifecycle status, and commercial terms for one caller-owned contract. Current delivery state is included when runtime state is available.

        **Access:** API key required; allowed ACLs: `owner`, `read-only`.

        **Rate limit:** 100 requests/minute per API credential.
      tags: [Contracts]
      operationId: getContractDetail
      x-required-acl: [owner, read-only]
      x-rate-limit: 100 requests/minute per API credential
      parameters:
        - name: contract_id
          in: path
          required: true
          description: Contract ID prefixed with C.
          schema:
            type: string
            pattern: '^C[0-9]+$'
            examples:
              - C123456789
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GetContractDetailResponse"
        "400": { $ref: "#/components/responses/BadRequest" }
        "401": { $ref: "#/components/responses/Unauthorized" }
        "403": { $ref: "#/components/responses/Forbidden" }
        "404": { $ref: "#/components/responses/NotFound" }
        "429": { $ref: "#/components/responses/TooManyRequests" }
        default: { $ref: "#/components/responses/ServiceError" }
  /contract/settings:
    get:
      summary: Get effective contract policy settings
      description: |-
        Returns the currently effective contract-duration, hashrate, activation-gap, cancellation-gap, and reservation-lead settings for the requested proof-of-work algorithm. Clients should validate scheduling forms against these settings.

        **Access:** API key required; allowed ACLs: `owner`, `read-only`.

        **Rate limit:** 100 requests/minute per API credential.
      tags: [Contracts]
      operationId: getContractSettings
      x-required-acl: [owner, read-only]
      x-rate-limit: 100 requests/minute per API credential
      parameters:
        - name: pow_algo
          in: query
          required: true
          description: "Proof-of-work algorithm whose settings should be returned. Canonical spelling: `sha256`; parsing is ASCII case-insensitive."
          schema:
            type: string
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GetContractSettingsResponse"
        "400": { $ref: "#/components/responses/BadRequest" }
        "401": { $ref: "#/components/responses/Unauthorized" }
        "403": { $ref: "#/components/responses/Forbidden" }
        "429": { $ref: "#/components/responses/TooManyRequests" }
        default: { $ref: "#/components/responses/ServiceError" }
  /contract/{contract_id}:cancel:
    post:
      summary: Request cancellation for a pending caller-owned contract
      description: |-
        Requests cancellation of a contract that has not started delivery. Flux evaluates the request and the response reports whether it was accepted; cancellation rules and fees can apply.

        **Access:** API key required; allowed ACL: `owner`.

        **Rate limit:** 100 requests/minute per API credential.
      tags: [Contracts]
      operationId: cancelContract
      x-required-acl: [owner]
      x-rate-limit: 100 requests/minute per API credential
      parameters:
        - name: contract_id
          in: path
          required: true
          description: Contract ID prefixed with C.
          schema:
            type: string
            pattern: '^C[0-9]+$'
            examples:
              - C123456789
      requestBody:
        required: false
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CancelContractRequest"
      responses:
        "200":
          description: Cancellation request accepted or rejected by Flux
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/CancelContractResponse"
        "400": { $ref: "#/components/responses/BadRequest" }
        "401": { $ref: "#/components/responses/Unauthorized" }
        "403": { $ref: "#/components/responses/Forbidden" }
        "404": { $ref: "#/components/responses/NotFound" }
        "429": { $ref: "#/components/responses/TooManyRequests" }
        default: { $ref: "#/components/responses/ServiceError" }
  /contract/{contract_id}:terminate:
    post:
      summary: Terminate an active caller-owned contract
      description: |-
        Permanently stops an active caller-owned contract before its scheduled expiry. Termination is distinct from canceling a pending contract and can trigger final accounting.

        **Access:** API key required; allowed ACL: `owner`.

        **Rate limit:** 100 requests/minute per API credential.
      tags: [Contracts]
      operationId: terminateContract
      x-required-acl: [owner]
      x-rate-limit: 100 requests/minute per API credential
      parameters:
        - name: contract_id
          in: path
          req

# --- truncated at 32 KB (110 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/braiins-academy/refs/heads/main/openapi/braiins-academy-braiins-hashpower-openapi.yml