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

# Enable Auto Top-Up

> Returns the calls needed to enable auto top-up. Checks on-chain state
and only includes setOperator (if not already set) and addCreditReceiver
(if not already whitelisted).

<Info>
  The `asset` parameter is the credit asset symbol — currently supported values are `usdc` and `eure`. The `threshold` and `targetBalance` are in wei. `healthFactor` is in basis points (10000 = 1.0).
</Info>

<RequestExample>
  ```bash cURL theme={null}
  curl --request GET \
    --url 'https://api.sprinter.tech/credit/v2/accounts/0xUSER/assets/usdc/operator/auto-topup/enable?receiver=0xRECEIVER&threshold=500000000&targetBalance=1000000000'
  ```

  ```python Python theme={null}
  import requests

  response = requests.get(
      "https://api.sprinter.tech/credit/v2/accounts/0xUSER/assets/usdc/operator/auto-topup/enable",
      params={"receiver": "0xRECEIVER", "threshold": "500000000", "targetBalance": "1000000000"}
  )
  print(response.json())
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch(
    "https://api.sprinter.tech/credit/v2/accounts/0xUSER/assets/usdc/operator/auto-topup/enable?receiver=0xRECEIVER&threshold=500000000&targetBalance=1000000000"
  );
  const data = await response.json();
  console.log(data);
  ```

  ```go Go theme={null}
  package main

  import (
  	"fmt"
  	"io"
  	"net/http"
  )

  func main() {
  	resp, _ := http.Get("https://api.sprinter.tech/credit/v2/accounts/0xUSER/assets/usdc/operator/auto-topup/enable?receiver=0xRECEIVER&threshold=500000000&targetBalance=1000000000")
  	defer resp.Body.Close()
  	body, _ := io.ReadAll(resp.Body)
  	fmt.Println(string(body))
  }
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "calls": [
      {
        "chain": "8453",
        "to": "0x1234567890abcdef1234567890abcdef12345678",
        "data": "0xa9059cbb000000000000000000000000000000000000000000000000000000000005f5e100",
        "value": "0"
      }
    ]
  }
  ```
</ResponseExample>

<Tip>
  **Machine-readable API spec:** [OpenAPI JSON](https://api.sprinter.tech/swagger/doc.json) | [Swagger UI](https://api.sprinter.tech/swagger/index.html)
</Tip>


## OpenAPI

````yaml get /credit/v2/accounts/{account}/assets/{asset}/operator/auto-topup/enable
openapi: 3.0.0
info:
  contact: {}
  title: ''
  version: 0.0.1
servers:
  - url: https://api.sprinter.tech
    description: Production server
security: []
paths:
  /credit/v2/accounts/{account}/assets/{asset}/operator/auto-topup/enable:
    get:
      tags:
        - Credit
      summary: Build transaction calls to enable auto top-up
      description: |-
        Returns the calls needed to enable auto top-up. Checks on-chain state
        and only includes setOperator (if not already set) and addCreditReceiver
        (if not already whitelisted).
      parameters:
        - description: User account address
          name: account
          in: path
          required: true
          schema:
            type: string
        - example: usdc
          description: Asset symbol to auto top-up (e.g. usdc, eure)
          name: asset
          in: path
          required: true
          schema:
            type: string
        - description: Receiver address to auto top-up
          name: receiver
          in: query
          required: true
          schema:
            type: string
      responses:
        '200':
          description: List of contract calls
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/credit.GetEnableAutoTopup.response'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/responses.ErrorResponse'
        '409':
          description: Account has a different operator
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/responses.ErrorResponse'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/responses.ErrorResponse'
components:
  schemas:
    credit.GetEnableAutoTopup.response:
      type: object
      required:
        - calls
      properties:
        calls:
          type: array
          items:
            $ref: '#/components/schemas/evm.ContractCall'
    responses.ErrorResponse:
      type: object
      required:
        - error
      properties:
        debug:
          type: string
        error:
          type: string
    evm.ContractCall:
      type: object
      required:
        - chain
        - data
        - to
        - value
      properties:
        chain:
          type: string
        data:
          type: array
          items:
            type: integer
        to:
          type: array
          items:
            type: integer
        value:
          $ref: '#/components/schemas/types.BigInt'
    types.BigInt:
      type: object

````