Skip to main content

Overview

The Sprinter Credit API lets you draw USDC credit against locked DeFi collateral. This guide walks through the full credit draw lifecycle: lock collateral, check your credit line, draw USDC, repay, and unlock.
This example demonstrates the core credit draw flow. For a complete card issuer integration — including KYC, card issuance, and deposit address routing — see the Card Issuer Integration quickstart.

Integration Steps

1

Lock Collateral

Lock collateral to activate a credit line. A single /lock call handles everything — including optional wrapping into a yield-bearing earn vault.First, fetch available earn strategies from the protocol config:
curl -X GET https://api.sprinter.tech/credit/protocol
This returns the credit configuration including a strategies field with available earn vaults and their IDs.Then lock collateral — add the earn param to auto-wrap into a vault in the same transaction:
curl -X GET 'https://api.sprinter.tech/credit/accounts/0xUSER/lock?amount=1000000000000000000&asset=0xCOLLATERAL_TOKEN&earn=STRATEGY_ID'
The earn parameter wraps the asset into a yield-bearing vault before locking — collateral earns while the credit line is active. Use a strategy ID from /credit/protocol.
Returns { calls: ContractCall[] } — execute in the user’s wallet. Once locked, the credit line is active.
2

Check Available Credit

Display totalCollateralValue (spendable credit) and healthFactor in your UI.
curl -X GET https://api.sprinter.tech/credit/accounts/0xUSER/info
{
  "data": {
    "USDC": {
      "totalCollateralValue": "5000.00",
      "principal": "0",
      "interest": "0",
      "healthFactor": "Infinity",
      "dueDate": null
    }
  }
}
See Credit Engine for how health factor and LTVs work.
3

Draw Credit

With collateral locked, draw USDC from the user’s credit line. The /draw endpoint is a general-purpose credit draw — the receiver can be any address (your settlement address, a card issuer’s deposit address, etc.).
curl -X GET 'https://api.sprinter.tech/credit/accounts/0xUSER/draw?amount=50000000&receiver=0xRECEIVER_ADDRESS'
ParameterDescription
accountUser’s wallet address (borrower)
amountUSDC in lowest denomination (6 decimals — $50 = 50000000)
receiverAddress to receive the USDC (e.g. your settlement address, a card issuer’s deposit contract)
Returns { calls: ContractCall[] } — execute on-chain to deliver USDC to the receiver.
A 0.50% origination fee is deducted from each draw. See Fees for the full fee schedule.
For card programs that need JIT draws inside an authorization webhook, see the webhook handler example:

Authorization Webhook Handler

Complete TypeScript implementation showing how to wire /draw into a card authorization flow with signature validation, credit checks, and sub-2-second execution.
4

Repayment

Credit runs on a 30-day billing cycle with a 7-day grace period. Repay before the due date to avoid the 15% overdue APR. See Fees.
curl -X GET https://api.sprinter.tech/credit/accounts/0xUSER/info
# Returns: principal, interest, dueDate
5

Unlock Collateral

When the user has zero outstanding debt:
curl -X GET 'https://api.sprinter.tech/credit/accounts/0xUSER/unlock?amount=1000000000000000000&asset=0xCOLLATERAL_TOKEN'
Returns { calls: ContractCall[] }. Execute in the user’s wallet to return collateral.

Delegated Credit Draws

Some use cases (like card authorizations) require credit draws without user interaction. Your backend needs the ability to draw credit on behalf of users. There are two approaches:
Users deploy a smart account (e.g. ERC-4337) that can execute draw transactions autonomously. The user retains full custody — the smart account automates signing based on pre-configured rules.How it works:
  1. User deploys or connects a smart account
  2. User configures a session key or module that authorizes your backend to call /draw
  3. At draw time, your backend submits the draw calldata through the smart account
This is the most trust-minimized option — users never grant direct access to their credit line.

Integration Notes

Whether using smart accounts or the operator contract, the signing key that executes draws must be secured with HSM or cloud KMS (AWS KMS, GCP Cloud KMS) in production. Never store it in environment variables on shared infrastructure.
The receiver in the draw call is the address that receives USDC. This could be your own settlement address, a card issuer’s deposit contract, or any other address depending on your use case.
Always decline if the draw cannot be confirmed on-chain. A declined transaction is recoverable; an unauthorized spend is not.
Poll healthFactor from the info endpoint and surface alerts in your UI. See Risk Management for liquidation thresholds and collateral tiers.

Try It

Want to see the full credit draw lifecycle running end-to-end? The Credit Draw Demo executes every step above — lock, credit check, draw, repay, unlock — using real Sprinter API calls on Base. It also supports a dry-run mode for testing without on-chain transactions.

Credit Draw Demo

Clone the repo, add a wallet with USDC on Base, and run npm run ui to launch the demo dashboard. See the README for full setup instructions.
You can also point an AI coding agent (like Claude) at the Sprinter Credit API and your target receiver’s API docs to generate a working proof of concept in minutes — the API is simple enough that an agent can wire up the full flow end-to-end.

Card Issuer Integration

Full card issuer integration with KYC, card issuance, and deposit routing.

Credit Engine

Health factor, LTVs, and liquidation mechanics.

Credit API Reference

Full API reference with interactive playground.