> ## Documentation Index
> Fetch the complete documentation index at: https://docs.hotstuff.trade/llms.txt
> Use this file to discover all available pages before exploring further.

# Add Agent

> Send POST request to /exchange, or use the ExchangeClient SDKs.

Register an API agent wallet that can act on behalf of your account or a sub-account.


## OpenAPI

````yaml openapi/exchange/accounts/add-agent.json POST /exchange
openapi: 3.0.3
info:
  title: Hotstuff Exchange API — Add Agent
  version: 1.0.0
servers:
  - url: https://api.hotstuff.trade
  - url: https://testnet-api.hotstuff.trade
security: []
paths:
  /exchange:
    post:
      summary: Add Agent
      operationId: exchangeAccountsAddAgent
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                action:
                  type: object
                  properties:
                    data:
                      type: object
                      properties:
                        agentName:
                          type: string
                        agent:
                          type: string
                        forAccount:
                          type: string
                        signature:
                          type: string
                        validUntil:
                          type: integer
                        nonce:
                          type: integer
                      required:
                        - agentName
                        - agent
                        - forAccount
                        - signature
                        - validUntil
                        - nonce
                    type:
                      type: string
                  required:
                    - data
                    - type
                signature:
                  type: string
                nonce:
                  type: integer
              required:
                - action
                - signature
                - nonce
              example:
                action:
                  data:
                    agentName: TradingBot_v1
                    agent: '0x436e1aDF2A0fAe363aCc76dEce9b3b8CD5214D07'
                    forAccount: '0xEc6d21B8c1FF6dF523F22c4cf54F077e5F7cAfBf'
                    signature: >-
                      0xedb65714077203f313b5a78e8c94d24f4f43a04efbe64eb00a847272fb8ecaf3...
                    validUntil: 1772282419
                    nonce: 1769690419606
                  type: addAgent
                signature: >-
                  0xf68aca4d7c6e590e2cec78465029d23bcc122b95bb6cd11cf28a04a2e5f857fa...
                nonce: 1769690419606
            examples:
              default:
                summary: Example request
                value:
                  action:
                    data:
                      agentName: TradingBot_v1
                      agent: '0x436e1aDF2A0fAe363aCc76dEce9b3b8CD5214D07'
                      forAccount: '0xEc6d21B8c1FF6dF523F22c4cf54F077e5F7cAfBf'
                      signature: >-
                        0xedb65714077203f313b5a78e8c94d24f4f43a04efbe64eb00a847272fb8ecaf3...
                      validUntil: 1772282419
                      nonce: 1769690419606
                    type: addAgent
                  signature: >-
                    0xf68aca4d7c6e590e2cec78465029d23bcc122b95bb6cd11cf28a04a2e5f857fa...
                  nonce: 1769690419606
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  tx_hash:
                    type: string
                  tx_type:
                    type: integer
                  success:
                    type: boolean
                  data:
                    type: object
                    properties: {}
                  address:
                    type: string
              example:
                tx_hash: >-
                  0x329d27195afd5fd8285c9ae5b3a2d6798674d1949ff09eb8aad55e64d2a1206c
                tx_type: 1201
                success: true
                data: {}
                address: '0x6d13237c49345cD13f4F7a51CaeA4c5Ba53510a4'

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.