Skip to main content
The Limitly Python SDK provides comprehensive plan management capabilities to configure rate limits and usage policies.

Creating Plans

Create new usage plans for your application:

Listing Plans

Retrieve all available plans:

Getting Plan Details

Get detailed information about a specific plan:

Updating Plans

Update plan properties:

Deleting Plans

Delete plans when they’re no longer needed:

Plan Usage

Get usage statistics for a plan:

Plan Users

Get all users associated with a plan:

Plan API Keys

Get all API keys associated with a plan:

FastAPI Example

Here’s a complete example of plan management in a FastAPI application:

Flask Example

Here’s a complete example of plan management in a Flask application:

Plan Properties

The SDK supports the following plan properties:
  • id: Unique identifier for the plan
  • owner_id: ID of the plan owner
  • name: Human-readable name for the plan
  • description: Optional description of the plan
  • max_requests: Maximum number of requests allowed
  • request_period: Period for the limit (‘day’, ‘week’, ‘month’, ‘year’)
  • is_active: Whether the plan is active
  • created_at: Timestamp when the plan was created
  • updated_at: Timestamp when the plan was last updated

Plan Periods

The SDK supports the following request periods:
  • day: Daily limits
  • week: Weekly limits
  • month: Monthly limits
  • year: Yearly limits

Error Handling

Handle plan management errors:

CLI Management

Use the CLI tool for plan management:

Next Steps