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

# Check Allowance

> Check how many tokens the AKKA Router is currently allowed to spend on behalf of a wallet address. Use this to determine if an approval transaction is needed before swapping.

## When to use

Call this before swapping an ERC-20 token to check if the AKKA Router already has sufficient spending approval:

```javascript theme={null}
const { allowance } = await response.json();
const swapAmount = BigInt('1000000000000000000');

if (BigInt(allowance) < swapAmount) {
  // Need to approve first — call /approve/transaction
} else {
  // Allowance sufficient — proceed to /swap
}
```

<Tip>
  For native tokens (HYPE), allowance is always unlimited. You can skip the allowance check and go directly to the swap.
</Tip>


## OpenAPI

````yaml GET /swap/v1/{chainId}/approve/allowance
openapi: 3.0.3
info:
  title: AKKA Finance API
  version: 1.0.0
  description: >-
    AKKA Finance liquidity aggregation API. Find the best swap routes across
    multiple DEXes and execute token swaps with optimal pricing.
  contact:
    name: AKKA Finance
    url: https://akka.finance
    email: support@akka.finance
servers:
  - url: https://api.akka.finance
    description: Production
security:
  - apiKey: []
paths:
  /swap/v1/{chainId}/approve/allowance:
    get:
      tags:
        - Approvals
      summary: Check token allowance
      description: >-
        Check how many tokens the AKKA Router is currently allowed to spend on
        behalf of a wallet address. Use this to determine if an approval
        transaction is needed before swapping.
      operationId: checkAllowance
      parameters:
        - name: chainId
          in: path
          required: true
          description: Blockchain chain ID
          schema:
            type: integer
            enum:
              - 999
            example: 999
        - name: tokenAddress
          in: query
          required: true
          description: Contract address of the token to check allowance for.
          schema:
            type: string
            pattern: ^0x[a-fA-F0-9]{40}$
            example: '0xB8CE59FC3717ada4C02eaDF9682A9e934F625ebb'
        - name: walletAddress
          in: query
          required: true
          description: Wallet address to check the allowance for.
          schema:
            type: string
            pattern: ^0x[a-fA-F0-9]{40}$
            example: '0xD3C0F471488523b378F2D9C21939c97300c510F5'
      responses:
        '200':
          description: Allowance retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AllowanceResponse'
              examples:
                noAllowance:
                  summary: No allowance set
                  value:
                    allowance: '0'
                unlimited:
                  summary: Unlimited allowance
                  value:
                    allowance: >-
                      115792089237316195423570985008687907853269984665640564039457584007913129639935
        '400':
          description: Bad request — invalid address or token not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    AllowanceResponse:
      type: object
      required:
        - allowance
      properties:
        allowance:
          type: string
          description: Number of tokens the AKKA Router is allowed to spend (in wei)
          example: '0'
    ErrorResponse:
      type: object
      required:
        - statusCode
        - message
        - error
        - timestamp
        - path
      properties:
        statusCode:
          type: integer
          description: HTTP status code
          example: 400
        message:
          type: string
          description: Human-readable error description
          example: No route found for the given token pair
        error:
          type: string
          description: Error type
          example: Bad Request
        timestamp:
          type: string
          format: date-time
          description: When the error occurred
          example: '2025-01-15T12:00:00.000Z'
        path:
          type: string
          description: API endpoint path that produced the error
          example: /swap/v1/999/quote
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: apikey
      description: API key for authentication. Contact AKKA on Telegram to obtain your key.

````