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

# Create Spending Limit

> Create a new spending limit for the account

Create a spending limit to enable controlled, recurring payments without requiring full account authority signatures. Spending limits provide a secure way to delegate payment authority for specific tokens and amounts.

## Spending Limit Concepts

### Period Types

* **ONE\_TIME**: Single-use allowance
* **DAILY**: Resets every 24 hours
* **WEEKLY**: Resets every 7 days
* **MONTHLY**: Resets every 30 days

### Key Components

* **Amount**: Maximum spendable amount in smallest token units
* **Mint**: Token contract address (e.g., USDC, SOL)
* **Period**: How often the limit resets
* **Spending Limit Signers**: Authorized addresses that can use the limit
* **Destinations**: Optional list of allowed recipient addresses
* **Expiration**: Optional expiration timestamp

## Security Model

Spending limits operate with reduced security requirements compared to full account operations:

1. **Creation**: Requires full account authority signatures
2. **Usage**: Only requires spending limit signer authorization
3. **Updates**: Requires full account authority signatures
4. **Deletion**: Requires full account authority signatures

## Use Cases

* **Employee Expenses**: Allow employees to spend within limits
* **Subscription Payments**: Automate recurring payments
* **DeFi Operations**: Enable automated DeFi strategies
* **Bill Payments**: Simplify recurring bill payments

## Important Notes

* Amounts are specified in the token's smallest unit (e.g., 1 USDC = 1,000,000 units)
* Spending limits reset automatically based on the period
* Unused amounts don't carry over to the next period
* Multiple spending limits can exist for different tokens
* Spending limit addresses are generated deterministically


## OpenAPI

````yaml POST /api/grid/v1/accounts/{address}/spending-limit
openapi: 3.1.0
info:
  title: Grid v1 API
  description: Grid v1 REST API for Solana-based smart account system
  contact:
    name: Grid API Support
    url: https://squads.so
    email: support@squads.so
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://grid.squads.xyz
    description: Production server
security:
  - bearer_auth: []
tags:
  - name: accounts
    description: Smart account management operations
  - name: spending-limits
    description: Spending limit management
  - name: standing-orders
    description: Standing order operations
  - name: transactions
    description: Transaction management
  - name: trade
    description: Trade operations and management
  - name: payments
    description: Payment intent operations
  - name: passkeys
    description: Passkey management
  - name: kyc
    description: Know Your Customer operations
  - name: external-accounts
    description: External bank account management
  - name: virtual-accounts
    description: Virtual account management
  - name: auth
    description: Authentication operations
  - name: proposals
    description: Proposal management for multi-sig operations
  - name: compliance
    description: Compliance entity management and KYB/KYC operations
paths:
  /api/grid/v1/accounts/{address}/spending-limit:
    post:
      tags:
        - spending-limits
      summary: Create a spending limit
      description: >-
        Create a new spending limit for a smart account with specified amount,
        period, and destinations
      operationId: handler
      parameters:
        - name: address
          in: path
          description: Smart account address
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateSpendingLimitRequestPayload'
        required: true
      responses:
        '201':
          description: Spending limit created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateSpendingLimitResponsePayload'
        '400':
          description: Invalid request parameters
        '404':
          description: Smart account not found
        '500':
          description: Internal server error
      security:
        - bearer_auth: []
components:
  schemas:
    CreateSpendingLimitRequestPayload:
      type: object
      required:
        - amount
        - mint
        - period
      properties:
        amount:
          type: integer
          format: int64
          minimum: 0
        destinations:
          type: array
          items:
            type: string
        expiration:
          type:
            - integer
            - 'null'
          format: int64
        mint:
          type: string
        period:
          type: string
        spending_limit_signers:
          type: array
          items:
            type: string
        transaction_signers:
          type: array
          items:
            type: string
    CreateSpendingLimitResponsePayload:
      type: object
      required:
        - spending_limit_address
        - transaction
        - kms_payloads
      properties:
        kms_payloads:
          type: array
          items:
            $ref: '#/components/schemas/KmsPayload'
        spending_limit_address:
          type: string
        transaction:
          type: string
        transaction_signers:
          type: array
          items:
            type: string
    KmsPayload:
      type: object
      required:
        - provider
        - address
        - payload
      properties:
        address:
          type: string
        payload:
          type: string
        provider:
          $ref: '#/components/schemas/GridMPCProvider'
    GridMPCProvider:
      type: string
      enum:
        - privy
        - dynamic
        - passkey
        - turnkey
        - external
  securitySchemes:
    bearer_auth:
      type: http
      scheme: bearer
      description: Your Grid API key from the Grid Dashboard

````