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

# Register a simulated test account

> Registers a simulated trading account for load testing. The platform answers this account's orders from an in-process simulator instead of a broker, so its fills are produced locally and reach no venue. Requires a client credential holding the accounts:admin scope; organization admins and API keys are refused. Test accounts are always paper.



## OpenAPI

````yaml /api-reference/accounts.openapi.json post /v1/accounts/test
openapi: 3.1.0
info:
  title: accounts
  description: ''
  license:
    name: ''
  version: 0.1.0
servers:
  - url: https://api.anthid.com
    description: Production
security: []
tags:
  - name: Accounts
    description: Create, inspect, update, and disable trading accounts
  - name: Broker Credentials
    description: Inspect and manage credentials linked to trading accounts
paths:
  /v1/accounts/test:
    post:
      tags:
        - Accounts
      summary: Register a simulated test account
      description: >-
        Registers a simulated trading account for load testing. The platform
        answers this account's orders from an in-process simulator instead of a
        broker, so its fills are produced locally and reach no venue. Requires a
        client credential holding the accounts:admin scope; organization admins
        and API keys are refused. Test accounts are always paper.
      operationId: createTestAccount
      requestBody:
        description: The account to register. All values shown are placeholders.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateTestAccountRequest'
            example:
              ack_latency_ms: 0
              enabled: true
              fill_max_ms: 100
              fill_min_ms: 5
              name: load-test-01
              organization_id: 550e8400-e29b-41d4-a716-446655440000
              trading_account_id: 550e8400-e29b-41d4-a716-446655440111
        required: true
      responses:
        '201':
          description: Test account registered
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateTestAccountResponse'
              example:
                test_account:
                  ack_latency_ms: 0
                  created_at: '2026-08-25T15:07:59Z'
                  created_by: an_YcKlZQeuLOoB5BcqlOrnV6a0
                  enabled: true
                  environment: paper
                  fill_max_ms: 100
                  fill_min_ms: 5
                  name: load-test-01
                  organization_id: 550e8400-e29b-41d4-a716-446655440000
                  trading_account_id: 550e8400-e29b-41d4-a716-446655440111
                  updated_at: '2026-08-25T15:07:59Z'
        '400':
          description: Blank name, negative timing, or fill_min_ms greater than fill_max_ms
          content:
            text/plain:
              schema:
                type: string
        '401':
          description: Caller is not a client credential
          content:
            text/plain:
              schema:
                type: string
        '403':
          description: Client credential is missing the accounts:admin scope
          content:
            text/plain:
              schema:
                type: string
        '409':
          description: >-
            The id already names a real trading account or an existing test
            account
          content:
            text/plain:
              schema:
                type: string
        '429':
          description: Caller exceeded the request rate limit
          content:
            text/plain:
              schema:
                type: string
        '500':
          description: Unexpected server error while registering the account
          content:
            text/plain:
              schema:
                type: string
      security:
        - bearerAuth: []
components:
  schemas:
    CreateTestAccountRequest:
      type: object
      description: >-
        Registers a simulated trading account.


        Every field is required. A test account is created by an operator with a

        specific run in mind rather than through a form with sensible defaults,
        and

        a half-specified one is more likely to be a mistake than an intention.
        The

        simulator's timings are the exception and are optional, because there is
        a

        defensible default for each.
      required:
        - organization_id
        - trading_account_id
        - name
        - enabled
      properties:
        ack_latency_ms:
          type:
            - integer
            - 'null'
          format: int32
          description: >-
            Acknowledgement delay charged to every command, in milliseconds.


            Defaults to 10, which is what the clients manager hard-coded before

            these were configurable. Note this is a per-account rate ceiling as
            much

            as a latency: the submitter awaits each command's return before
            claiming

            the account's next one, so 10ms caps the account near 100 commands a

            second. Set it to 0 to measure the platform rather than the
            simulator.
        enabled:
          type: boolean
          description: Whether the scheduler should start it.
        fill_max_ms:
          type:
            - integer
            - 'null'
          format: int32
        fill_min_ms:
          type:
            - integer
            - 'null'
          format: int32
          description: >-
            Bounds on the simulator's fill delay, in milliseconds. Defaults to 5
            and

            100. `fill_min_ms` may not exceed `fill_max_ms`.
        name:
          type: string
          description: What to call it. Must not be blank.
        organization_id:
          type: string
          format: uuid
          description: >-
            The tenant this account trades for.


            Named explicitly rather than resolved from the caller, because the

            caller is a service credential and has no organization of its own.
            This

            is the one privileged input on the request, and it is why the
            endpoint

            is gated on a scope rather than on a tenant role.
        trading_account_id:
          type: string
          format: uuid
          description: >-
            The account id the platform will trade under.


            Supplied rather than minted so an operator can register an id a
            fixture

            or a script already refers to. Refused if it collides with a real

            trading account: a test row shadowing a customer's account is the
            one

            mistake here that would send their orders to a simulator.
    CreateTestAccountResponse:
      type: object
      description: >-
        The registered test account, echoed back in full.


        The whole row rather than just its id, because the request may have left
        the

        simulator's timings out and the operator needs to see which defaults
        they

        got without a second call.
      required:
        - test_account
      properties:
        test_account:
          $ref: '#/components/schemas/TestTradingAccount'
    TestTradingAccount:
      type: object
      description: >-
        A simulated trading account, registered by an operator for load testing.


        Not a [`TradingAccount`] with a flag on it, and deliberately so. A
        trading

        account is a customer's broker connection: it has a broker, a
        credential, an

        append-only event stream behind it and a six year retention obligation.
        This

        has none of those. It is a row an operator adds to make the platform
        trade

        against an in-process simulator, and removes again afterwards.


        Keeping the two types apart is what lets `GET /v1/accounts` answer one

        question at a time: without `test_accounts=true` it lists real accounts
        and

        cannot accidentally include one of these, and with it, it lists only
        these.

        A shared type carrying a boolean would have made every caller
        responsible

        for checking that boolean, and the cost of one forgetting is a
        customer's

        orders going to a simulator.
      required:
        - trading_account_id
        - organization_id
        - name
        - enabled
        - environment
        - ack_latency_ms
        - fill_min_ms
        - fill_max_ms
        - created_by
        - created_at
        - updated_at
      properties:
        ack_latency_ms:
          type: integer
          format: int32
          description: >-
            Acknowledgement delay the simulator charges every command, in

            milliseconds.


            Also a per-account rate ceiling of roughly `1000 / ack_latency_ms`

            commands a second: it is paid inside the simulator's `create_order`

            before it returns, and the submitter awaits that return before
            claiming

            the account's next command. Zero means no delay.
        created_at:
          type: string
          format: date-time
        created_by:
          type: string
          description: '`service_id` of the credential that registered this account.'
        enabled:
          type: boolean
        environment:
          $ref: '#/components/schemas/BrokerEnvironment'
          description: >-
            Always [`BrokerEnvironment::Paper`], enforced by a check constraint
            on

            the table. Carried rather than assumed because the scheduler
            branches on

            it to decide whether an account needs the live-trading entitlement.
        fill_max_ms:
          type: integer
          format: int32
        fill_min_ms:
          type: integer
          format: int32
          description: >-
            Bounds on how long a resting order waits before the simulator fills
            it.
        name:
          type: string
          description: >-
            What the operator called it. Required, unlike a trading account's
            name:

            with no broker and no credential, it is the only thing identifying
            which

            test account this is.
        organization_id:
          type: string
          format: uuid
        trading_account_id:
          type: string
          format: uuid
          description: The account id the rest of the platform trades under.
        updated_at:
          type: string
          format: date-time
    BrokerEnvironment:
      type: string
      enum:
        - paper
        - live
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````