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

# Retrieve your limits

> Returns each of your limits and how much of it you've used, counted the way the limit counts it. `remaining` is what a request can use at this moment. Takes no parameters.



## OpenAPI

````yaml /openapi.json get /v1/limits
openapi: 3.1.0
info:
  title: Matamba Gateway
  version: '1'
  contact:
    name: Matamba Gateway partner support
    email: partners@matambaintelligence.com
    url: https://docs.matambaintelligence.com/support
  description: >-
    Open brokerage accounts for your customers, fund them from your wallet,
    place and track orders, and read each account's records at the broker.
    Amounts are integers in kobo, except the two average prices, which are
    decimal strings of kobo. Every error includes a `code` you can use in your
    logic. A list of values, such as an order state or an error `code`, can gain
    values: if you generate a client, have it accept values it doesn't know (in
    OpenAPI Generator, `enumUnknownDefaultCase`).
servers:
  - url: https://{host}
    description: The sandbox and live environments each have their own host and API keys.
    variables:
      host:
        default: sandbox-host.invalid
        description: We send you the host along with your API keys.
security:
  - bearer: []
tags:
  - name: Accounts
    description: The accounts you can trade for, and the broker's records for each one.
  - name: Orders
    description: >-
      Estimate, place, retrieve and cancel orders. We store each order before we
      send it to the exchange, and we send it only once.
  - name: Events
    description: >-
      Each change to your orders, applications and allocations creates an event.
      We send the same event bodies to your webhook endpoint. See
      [Webhooks](/webhooks) for how to verify them.
  - name: Applications
    description: Open a brokerage account for your customer.
  - name: Reference
    description: Code lists from the broker that you use in account applications.
  - name: Wallet
    description: >-
      Your wallet, and the allocations you make from it to your customers'
      accounts.
  - name: Limits
    description: >-
      What you may send: the limits on your requests and your day, and how much
      of each you've used.
  - name: Keys
    description: Revoke a key that has leaked, yourself, at any hour.
paths:
  /v1/limits:
    get:
      tags:
        - Limits
      summary: Retrieve your limits
      description: >-
        Returns each of your limits and how much of it you've used, counted the
        way the limit counts it. `remaining` is what a request can use at this
        moment. Takes no parameters.
      operationId: getLimits
      responses:
        '200':
          $ref: '#/components/responses/Limits'
        '400':
          $ref: '#/components/responses/error.invalid_request'
          description: '`invalid_request`: this endpoint takes no parameters.'
        '401':
          $ref: '#/components/responses/error.unauthorized'
          description: '`unauthorized`'
        '403':
          $ref: '#/components/responses/error.insufficient_scope'
          description: '`insufficient_scope`: this key doesn''t have the `read` scope.'
        '429':
          $ref: '#/components/responses/error.rate_limited'
          description: '`rate_limited`'
        '500':
          $ref: '#/components/responses/error.internal_error'
          description: '`internal_error`'
        '503':
          $ref: '#/components/responses/error.service_unavailable'
          description: '`service_unavailable`'
      security:
        - bearer:
            - read
components:
  responses:
    Limits:
      description: Your limits and what you've used of them.
      headers:
        x-request-id:
          $ref: '#/components/headers/RequestId'
        Cache-Control:
          $ref: '#/components/headers/CacheControl'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Limits'
          example:
            object: limits
            day: '2026-09-25'
            requests_per_second:
              limit: 20
              burst: 40
            requests_under_way:
              limit: 5
              used: 0
              remaining: 5
              resets_at: null
            orders_kobo_per_day:
              limit: 1000000000
              used: 522500
              remaining: 999477500
              resets_at: '2026-09-25T23:00:00Z'
            allocations_kobo_per_day:
              limit: 5000000000
              used: 5000000
              remaining: 4995000000
              resets_at: '2026-09-25T23:00:00Z'
            per_request:
              order_quantity: 100000000
              allocation_kobo: 10000000000
              request_body_bytes: 16384
    error.invalid_request:
      description: 'An error: `invalid_request`.'
      headers:
        x-request-id:
          $ref: '#/components/headers/RequestId'
        Cache-Control:
          $ref: '#/components/headers/CacheControl'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            invalid_request:
              summary: invalid_request
              value:
                error:
                  type: invalid_request_error
                  code: invalid_request
                  message: The request could not be read.
                  doc_url: https://docs.matambaintelligence.com/errors#invalid_request
    error.unauthorized:
      description: 'An error: `unauthorized`.'
      headers:
        x-request-id:
          $ref: '#/components/headers/RequestId'
        Cache-Control:
          $ref: '#/components/headers/CacheControl'
        WWW-Authenticate:
          $ref: '#/components/headers/WWWAuthenticate'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            unauthorized:
              summary: unauthorized
              value:
                error:
                  type: authentication_error
                  code: unauthorized
                  message: Invalid credentials.
                  doc_url: https://docs.matambaintelligence.com/errors#unauthorized
    error.insufficient_scope:
      description: 'An error: `insufficient_scope`.'
      headers:
        x-request-id:
          $ref: '#/components/headers/RequestId'
        Cache-Control:
          $ref: '#/components/headers/CacheControl'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            insufficient_scope:
              summary: insufficient_scope
              value:
                error:
                  type: permission_error
                  code: insufficient_scope
                  message: >-
                    This API key does not have the scope this request requires.
                    Nothing was done.
                  doc_url: >-
                    https://docs.matambaintelligence.com/errors#insufficient_scope
    error.rate_limited:
      description: 'An error: `rate_limited`.'
      headers:
        x-request-id:
          $ref: '#/components/headers/RequestId'
        Cache-Control:
          $ref: '#/components/headers/CacheControl'
        Retry-After:
          $ref: '#/components/headers/RetryAfter'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            rate_limited:
              summary: rate_limited
              value:
                error:
                  type: rate_limit_error
                  code: rate_limited
                  message: >-
                    Too many requests. Nothing was done. Send the same request
                    again after the Retry-After interval.
                  doc_url: https://docs.matambaintelligence.com/errors#rate_limited
    error.internal_error:
      description: 'An error: `internal_error`.'
      headers:
        x-request-id:
          $ref: '#/components/headers/RequestId'
        Cache-Control:
          $ref: '#/components/headers/CacheControl'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            internal_error:
              summary: internal_error
              value:
                error:
                  type: api_error
                  code: internal_error
                  message: >-
                    The gateway encountered an internal error. Send the same
                    request again, exactly as you sent it.
                  doc_url: https://docs.matambaintelligence.com/errors#internal_error
    error.service_unavailable:
      description: 'An error: `service_unavailable`.'
      headers:
        x-request-id:
          $ref: '#/components/headers/RequestId'
        Cache-Control:
          $ref: '#/components/headers/CacheControl'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            service_unavailable:
              summary: service_unavailable
              value:
                error:
                  type: api_error
                  code: service_unavailable
                  message: >-
                    The gateway is temporarily unable to process this request.
                    Send the same request again, with the same Idempotency-Key
                    if it has one.
                  doc_url: >-
                    https://docs.matambaintelligence.com/errors#service_unavailable
  headers:
    RequestId:
      description: >-
        A unique identifier for this request. Include it when you [contact
        us](/support#report-a-problem).
      schema:
        type: string
    CacheControl:
      description: Always `no-store`.
      schema:
        type: string
        const: no-store
    WWWAuthenticate:
      description: 'Sent with 401: `Bearer realm="Matamba Gateway"`.'
      schema:
        type: string
    RetryAfter:
      description: >-
        The number of seconds to wait before you retry. Sent with `429
        rate_limited` (`1`), `503 settlement_lockout` (`60`) and `503
        trading_paused` (`60`).
      schema:
        type: integer
  schemas:
    Limits:
      type: object
      description: >-
        Your limits, what you've used of each, and what's left. See
        [Limits](/limits).
      required:
        - object
        - day
        - requests_per_second
        - requests_under_way
        - orders_kobo_per_day
        - allocations_kobo_per_day
        - per_request
      properties:
        object:
          type: string
          const: limits
        day:
          type: string
          format: date
          description: The day the daily limits count, in West Africa Time (WAT).
        requests_per_second:
          type: object
          required:
            - limit
            - burst
          properties:
            limit:
              type: integer
              format: int64
              description: Requests a second.
            burst:
              type: integer
              format: int64
              description: The most requests at once, after a quiet spell.
          description: >-
            How many requests a second you can make, and how many at once in a
            burst.
        requests_under_way:
          $ref: '#/components/schemas/LimitUse'
          description: >-
            Requests in progress at once, across your keys. See
            [Limits](/limits).
        orders_kobo_per_day:
          $ref: '#/components/schemas/LimitUse'
          description: >-
            Order value per day, in kobo, WAT. See [How order value is
            counted](/limits#how-order-value-is-counted).
        allocations_kobo_per_day:
          $ref: '#/components/schemas/LimitUse'
          description: >-
            Allocations per day, in kobo, WAT. See [How allocations are
            counted](/limits#how-allocations-are-counted).
        per_request:
          type: object
          required:
            - order_quantity
            - allocation_kobo
            - request_body_bytes
          properties:
            order_quantity:
              type: integer
              format: int64
              description: The most shares one order can be for.
            allocation_kobo:
              type: integer
              format: int64
              description: The most one allocation can move, in kobo.
            request_body_bytes:
              type: integer
              format: int64
              description: The largest request body, in bytes.
          description: What one request can carry. The same for every partner.
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - type
            - code
            - message
            - doc_url
          properties:
            type:
              type: string
              description: >-
                The category of the error. New values can be added: handle an
                unrecognised value with a safe default.
              enum:
                - authentication_error
                - invalid_request_error
                - idempotency_error
                - order_error
                - application_error
                - wallet_error
                - limit_error
                - rate_limit_error
                - permission_error
                - api_error
            code:
              type: string
              description: >-
                The error code. Use it in your logic; it doesn't change. New
                values can be added: handle an unrecognised value with a safe
                default.
              enum:
                - unauthorized
                - not_found
                - method_not_allowed
                - unsupported_media_type
                - request_too_large
                - invalid_request
                - missing_required_field
                - unknown_account
                - duplicate_order
                - order_not_found
                - account_not_found
                - exchange_unavailable
                - order_not_sent
                - order_rejected
                - similar_order_unresolved
                - order_not_cancelable
                - cancel_unconfirmed
                - settlement_lockout
                - account_not_at_broker
                - exchange_error
                - feature_not_enabled
                - insufficient_scope
                - application_rejected
                - duplicate_application
                - application_not_found
                - application_not_sent
                - wallet_too_low
                - allocation_rejected
                - duplicate_allocation
                - allocation_not_found
                - allocation_not_sent
                - similar_allocation_unresolved
                - rate_limited
                - unknown_symbol
                - limit_exceeded
                - service_unavailable
                - internal_error
                - trading_paused
                - outcome_not_recorded
            message:
              type: string
              description: >-
                A human-readable description of the error, for your logs. The
                wording can change.
            param:
              type: string
              description: >-
                The field, parameter or header that caused the error. Absent
                when the error isn't tied to a single field.
            reject_reason:
              type: string
              description: >-
                Why the exchange or broker rejected the request. Included with
                `order_rejected`, `application_rejected` and
                `allocation_rejected`, and takes the same values as the
                `reject_reason` field on the order, application or allocation.
            order:
              type: string
              description: >-
                The order the error is about, when it names one: the order that
                owns the `Idempotency-Key` for `duplicate_order`, the unresolved
                order for `similar_order_unresolved`, the order recorded for
                `order_rejected` and `order_not_sent`, and the order your
                request made for `outcome_not_recorded`.
              pattern: ^ord_[a-z2-7]{20}$
            application:
              type: string
              description: >-
                The application the error is about, when it names one: the one
                that owns the key for `duplicate_application`, the one recorded
                for `application_rejected` and `application_not_sent`, and the
                one your request made for `outcome_not_recorded`.
              pattern: ^app_[a-z2-7]{20}$
            allocation:
              type: string
              description: >-
                The allocation the error is about, when it names one: the one
                that owns the key for `duplicate_allocation`, the unresolved one
                for `similar_allocation_unresolved`, the one recorded for
                `allocation_rejected`, `allocation_not_sent` and
                `feature_not_enabled`, and the one your request made for
                `outcome_not_recorded`.
              pattern: ^alc_[a-z2-7]{20}$
            doc_url:
              type: string
              format: uri
              description: A link to the documentation for this error code.
          description: What went wrong, and the code to act on.
    LimitUse:
      type: object
      required:
        - limit
        - used
        - remaining
        - resets_at
      properties:
        limit:
          type: integer
          format: int64
          description: The limit, in the unit its name gives.
        used:
          type: integer
          format: int64
          description: What you've used, counted as the limit counts it.
        remaining:
          type: integer
          format: int64
          description: >-
            `limit` minus `used`, and never below zero. It's what one more
            request can use at this moment.
        resets_at:
          type:
            - string
            - 'null'
          format: date-time
          description: >-
            When the count starts again: midnight, West Africa Time (WAT), given
            in UTC. Null for requests under way, which end rather than reset.
  securitySchemes:
    bearer:
      type: http
      scheme: bearer
      description: >-
        `Authorization: Bearer <key>`. Sandbox keys start with `mgw_test_` and
        live keys start with `mgw_live_`. Each key works only in its own
        environment, and a live key works only from the IP addresses or ranges
        registered for it.

````