MarketIntell Brokers API

Broker connections (Alpaca OAuth, Hyperliquid, crypto-spot agent wallets)

GitHub OpenAPI

Operations 9

GET /v1/brokers List broker connections #
GET /v1/brokers/supported List supported brokers #
GET /v1/brokers/alpaca/authorize Start Alpaca OAuth #
GET /v1/brokers/alpaca/callback Finish Alpaca OAuth #
POST /v1/brokers/crypto-spot-base/connect Connect a crypto-spot (Base) agent wallet #
POST /v1/brokers/hyperliquid/provision Provision a Hyperliquid agent wallet #
POST /v1/brokers/{id}/confirm-approval Confirm Hyperliquid agent approval #
POST /v1/brokers/{id}/rotate-withdrawal-address Rotate crypto-spot withdrawal address #
POST /v1/brokers/{id}/withdraw Withdraw funds from a crypto-spot wallet #

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/marketintell-ai:marketintell-ai-brokers-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

marketintell-ai-brokers-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: MarketIntell Brokers API
  version: 0.1.0
  description: 'AI-powered market intelligence with tier-aware Mastra agents and a deterministic analytical pipeline across crypto, US equities, and India stocks. REST, MCP, OpenAI-compatible, async workflow, and batch transports share one evidence/provenance/recovery contract.


    **Rate limits (per minute / per day):**

    - Free: 60 / 25

    - Builder: 120 / 50,000

    - Pro: 300 / 2,000

    - Enterprise: 1,000 / unlimited


    MCP has a separate per-key bucket (default 30/min, env `MCP_RATE_LIMIT_MAX`). 429 responses include `Retry-After` and machine-readable recovery fields.


    **Self-registration (agents):** `POST /v1/auth/challenge` returns a SHA-256 proof-of-work challenge; submit the solved nonce to `POST /v1/auth/signup`. Follow `/.well-known/oauth-protected-resource` to the authorization-server `agent_auth` block, or read `/auth.md`.'
  contact:
    name: MarketIntell
    email: support@marketintell.ai
    url: https://marketintell.ai/contact
  license:
    name: Proprietary
    url: https://marketintell.ai/terms
  termsOfService: https://marketintell.ai/terms
  x-api-lifecycle:
    stability: stable
    versioning: Major versions are encoded in the URL path (currently /v1). Additive fields do not change the major version.
    deprecation_notice_days: 90
    deprecation_header: Deprecation (RFC 9745)
    sunset_header: Sunset (RFC 8594)
    migration_link_relation: successor-version
servers:
- url: https://api.marketintell.ai
  description: Production
- url: http://localhost:3848
  description: Local development
security:
- BearerAuth: []
- ApiKeyHeader: []
tags:
- name: Brokers
  description: Broker connections (Alpaca OAuth, Hyperliquid, crypto-spot agent wallets)
paths:
  /v1/brokers:
    get:
      operationId: getBrokers
      summary: List broker connections
      tags:
      - Brokers
      description: List the calling key's active broker connections. Owner-scoped. Requires `read` scope.
      responses:
        '200':
          description: Broker connections
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  data:
                    type: object
                    properties:
                      connections:
                        type: array
                        items:
                          type: object
  /v1/brokers/supported:
    get:
      operationId: getBrokersSupported
      summary: List supported brokers
      tags:
      - Brokers
      security: []
      description: 'Public catalog of supported broker adapters: id, display name, paper flag, and supported asset classes. No auth required.'
      responses:
        '200':
          description: Supported brokers
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  data:
                    type: object
                    properties:
                      brokers:
                        type: array
                        items:
                          type: object
                          properties:
                            id:
                              type: string
                            display_name:
                              type: string
                            is_paper:
                              type: boolean
                            asset_classes:
                              type: array
                              items:
                                type: string
  /v1/brokers/alpaca/authorize:
    get:
      operationId: getBrokersAlpacaAuthorize
      summary: Start Alpaca OAuth
      tags:
      - Brokers
      description: Begin the Alpaca OAuth 2.0 flow. Redirects (302) to Alpaca's authorize page with a signed `state` tying the flow to the calling key. Use `broker=alpaca-live` for live (default is paper). Requires `write` scope. Returns 503 if OAuth is not configured server-side.
      parameters:
      - name: broker
        in: query
        schema:
          type: string
          enum:
          - alpaca-paper
          - alpaca-live
          default: alpaca-paper
      responses:
        '302':
          description: Redirect to Alpaca's OAuth authorize page
        '503':
          description: Alpaca OAuth not configured (ALPACA_OAUTH_CLIENT_ID missing)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
  /v1/brokers/alpaca/callback:
    get:
      operationId: getBrokersAlpacaCallback
      summary: Finish Alpaca OAuth
      tags:
      - Brokers
      security: []
      description: OAuth redirect target hit by Alpaca (not called directly by clients). Exchanges the code for tokens, verifies via /v2/account, stores AES-256-GCM-encrypted creds, auto-grants the `trade` scope, and returns a small HTML page that closes the popup. The signed `state` authenticates the user — no API key is sent.
      parameters:
      - name: code
        in: query
        schema:
          type: string
      - name: state
        in: query
        schema:
          type: string
      - name: error
        in: query
        schema:
          type: string
        description: Set when the user denied access.
      responses:
        '200':
          description: HTML popup-close page (success or failure rendered inline)
          content:
            text/html:
              schema:
                type: string
                description: Rendered OAuth-result HTML
        '400':
          description: Missing code/state or invalid signed state
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
  /v1/brokers/crypto-spot-base/connect:
    post:
      operationId: postBrokersCryptoSpotBaseConnect
      summary: Connect a crypto-spot (Base) agent wallet
      tags:
      - Brokers
      description: Provision a fresh agent wallet on Base (encrypted at rest). Returns the agent wallet address ONCE so the user can fund it with USDC; the private key is never returned. Auto-grants the `trade` scope. Requires `write` scope.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - withdrawal_address
              properties:
                withdrawal_address:
                  type: string
                  pattern: ^0x[a-fA-F0-9]{40}$
                  description: EVM address withdrawals route to.
                display_name:
                  type: string
                  maxLength: 50
      responses:
        '200':
          description: Agent wallet provisioned
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  data:
                    type: object
                    properties:
                      connection:
                        type: object
                      agent_wallet_address:
                        type: string
                      withdrawal_address:
                        type: string
                      instructions:
                        type: string
        '400':
          description: Validation failed (e.g. invalid address)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
  /v1/brokers/hyperliquid/provision:
    post:
      operationId: postBrokersHyperliquidProvision
      summary: Provision a Hyperliquid agent wallet
      tags:
      - Brokers
      description: 'Step 1 of the Hyperliquid two-step connect: generate an agent wallet (PK encrypted at rest), return the agent address and the `approveAgent` action payload the user signs in their master wallet. Auto-grants the `trade` scope. Confirm with POST /v1/brokers/{id}/confirm-approval. Requires `write` scope.'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - master_address
              properties:
                master_address:
                  type: string
                  pattern: ^0x[a-fA-F0-9]{40}$
                agent_name:
                  type: string
                  maxLength: 16
                is_testnet:
                  type: boolean
      responses:
        '200':
          description: Agent wallet provisioned + approveAgent payload
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  data:
                    type: object
                    properties:
                      connection_id:
                        type: string
                      agent_address:
                        type: string
                      master_address:
                        type: string
                      approve_payload:
                        type: object
                      next_step:
                        type: string
        '400':
          description: Validation failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
  /v1/brokers/{id}/confirm-approval:
    post:
      operationId: postBrokersIdConfirmApproval
      summary: Confirm Hyperliquid agent approval
      tags:
      - Brokers
      description: 'Step 2 of the Hyperliquid connect: after the user broadcasts the approveAgent tx, flips the connection''s `approval_confirmed` flag so adapter ops work. Optional `approval_tx_hash` for audit. Requires `write` scope.'
      parameters:
      - name: id
        in: path
        required: true
        schema:
          type: string
          format: uuid
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                approval_tx_hash:
                  type: string
      responses:
        '200':
          description: Approval confirmed
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  data:
                    type: object
                    properties:
                      connection_id:
                        type: string
                      approval_confirmed:
                        type: boolean
                      message:
                        type: string
        '400':
          description: Validation failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
        '404':
          description: Connection not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
  /v1/brokers/{id}/rotate-withdrawal-address:
    post:
      operationId: postBrokersIdRotateWithdrawalAddress
      summary: Rotate crypto-spot withdrawal address
      tags:
      - Brokers
      description: Update the withdrawal address on a crypto-spot connection (no on-chain tx — only the encrypted creds blob changes). Future withdrawals route to the new address. Requires `trade` scope.
      parameters:
      - name: id
        in: path
        required: true
        schema:
          type: string
          format: uuid
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - withdrawal_address
              properties:
                withdrawal_address:
                  type: string
                  pattern: ^0x[a-fA-F0-9]{40}$
      responses:
        '200':
          description: Withdrawal address rotated
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  data:
                    type: object
                    properties:
                      connection_id:
                        type: string
                      withdrawal_address:
                        type: string
                      message:
                        type: string
        '400':
          description: Validation failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
        '404':
          description: Connection not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
  /v1/brokers/{id}/withdraw:
    post:
      operationId: postBrokersIdWithdraw
      summary: Withdraw funds from a crypto-spot wallet
      tags:
      - Brokers
      description: Drain the agent wallet to the configured withdrawal address. Defaults to USDC; up to 20 additional ERC-20 token addresses can be supplied. Only `crypto-spot-base` connections support withdraw. Requires `trade` scope.
      parameters:
      - name: id
        in: path
        required: true
        schema:
          type: string
          format: uuid
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                tokens:
                  type: array
                  items:
                    type: string
                    pattern: ^0x[a-fA-F0-9]{40}$
                  maxItems: 20
                  description: Additional ERC-20 token addresses to drain (USDC always included).
      responses:
        '200':
          description: Withdrawal result
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  data:
                    type: object
                    properties:
                      withdrawn_to:
                        type: string
        '400':
          description: Withdraw not supported for this broker, or validation failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
        '404':
          description: Connection not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
components:
  schemas:
    ErrorEnvelope:
      type: object
      required:
      - success
      - error
      properties:
        success:
          type: boolean
          enum:
          - false
        error:
          type: string
          description: Human-readable error message
        code:
          type: string
          description: Stable machine-readable error code, when present
        request_id:
          type: string
          description: Correlation id from the X-Request-ID header
        retry_after_ms:
          type: integer
          description: Suggested back-off for 429 responses (mirrors the Retry-After header in ms)
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
    ApiKeyHeader:
      type: apiKey
      in: header
      name: X-API-Key