> ## 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 a Smart Account

Create a new spending limit that allows controlled token spending from your Smart Account.

### Key Concepts

* **Limit Configuration**: Set maximum amount and reset period
* **Token Specification**: Define which token the limit applies to
* **Transaction Signing**: Requires approval from authorized signers

### Important Notes

* Amount must be greater than zero
* Period can be DAY or WEEK
* Transaction must be signed by enough signers to meet threshold
* The same token can have multiple spending limits with different periods
* For native SOL, set `token_address` to `11111111111111111111111111111111`


## OpenAPI

````yaml POST /api/v1/smart-accounts/{smart_account_address}/spending-limits
openapi: 3.0.0
info:
  title: Squads API
  version: 1.0.0
  description: >
    The Squads API provides functionality for managing smart accounts and
    spending limits.

    This API allows you to create and manage smart accounts, set up spending
    limits, and perform transactions.
servers:
  - url: https://developer-api.squads.so
    description: Production server
security:
  - bearerAuth: []
paths:
  /api/v1/smart-accounts/{smart_account_address}/spending-limits:
    post:
      summary: Create a new spending limit
      operationId: createSpendingLimit
      parameters:
        - $ref: '#/components/parameters/NetworkHeader'
        - $ref: '#/components/parameters/SmartAccountAddress'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - amount
                - token_address
                - period
              properties:
                amount:
                  type: string
                  format: uint64
                token_address:
                  type: string
                period:
                  $ref: '#/components/schemas/Period'
                transaction_signers:
                  type: array
                  items:
                    type: string
                spending_limit_signers:
                  type: array
                  items:
                    type: string
                destinations:
                  type: array
                  items:
                    type: string
                expiration:
                  type: integer
                  format: int64
                fee_config:
                  $ref: '#/components/schemas/FeeConfig'
      responses:
        '200':
          description: Spending limit created successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  spending_limit_address:
                    type: string
                  transaction:
                    type: string
                  fee:
                    $ref: '#/components/schemas/Fee'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
components:
  parameters:
    NetworkHeader:
      name: x-squads-network
      in: header
      required: true
      schema:
        type: string
        enum:
          - mainnet
          - devnet
      description: Specifies the network for the API request
    SmartAccountAddress:
      name: smart_account_address
      in: path
      required: true
      schema:
        type: string
      description: The address of the smart account
  schemas:
    Period:
      type: string
      enum:
        - ONE_TIME
        - DAILY
        - WEEKLY
        - MONTHLY
        - YEARLY
      description: Reset period for spending limits
    FeeConfig:
      type: object
      properties:
        currency:
          type: string
          description: Currency for the fee
        payer_address:
          type: string
          description: Address of the fee payer
        self_managed_fees:
          type: boolean
          default: false
          description: >-
            When true, the fee is paid by the smart account itself. When false
            or not set, the fee is paid by the transaction signers.
    Fee:
      type: object
      properties:
        amount:
          type: string
          format: uint64
          description: Fee amount in base units
        amount_decimal:
          type: string
          description: Decimal representation of the fee amount
        currency:
          type: string
          description: Currency of the fee
        sol_equivalent:
          $ref: '#/components/schemas/SolEquivalent'
    SolEquivalent:
      type: object
      properties:
        amount:
          type: string
          format: uint64
          description: Amount in base units
        amount_decimal:
          type: string
          description: Decimal representation of the amount
    Error:
      type: object
      properties:
        status:
          type: integer
          description: HTTP status code
        code:
          type: string
          description: Error code for easy lookup
        message:
          type: string
          description: Detailed error description
        details:
          type: array
          items:
            $ref: '#/components/schemas/ErrorDetail'
        metadata:
          $ref: '#/components/schemas/ErrorMetadata'
        custom:
          type: object
          additionalProperties:
            type: string
        simulation_logs:
          type: array
          items:
            type: string
          description: >-
            Transaction simulation logs. Returns an empty array when debug=false
            or not provided.
    ErrorDetail:
      type: object
      properties:
        field:
          type: string
          description: The field that failed validation
        code:
          type: string
          description: Error code specific to this validation failure
        message:
          type: string
          description: Detailed message about the validation failure
        expected:
          type: string
          description: Expected value or condition
        actual:
          type: string
          description: Actual value received
    ErrorMetadata:
      type: object
      properties:
        status:
          type: integer
          description: HTTP status code
        request_id:
          type: string
          description: Unique identifier for debugging
        timestamp:
          type: string
          format: date-time
          description: When the error occurred
        resource_id:
          type: string
          description: Identifier of the resource that experienced the error
        useful_links:
          type: array
          items:
            type: string
          description: Links to relevant documentation
  responses:
    BadRequest:
      description: Bad Request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Unauthorized:
      description: Unauthorized
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    UnprocessableEntity:
      description: Unprocessable Entity
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: UUID
      description: UUID-based API key provided by Squads

````