api-auth

Authenticate and rate-limit FastAPI APIs with API keys, JWT, and OAuth2 scopes.

1|Updated Dec 22, 2025
One-click install
npx skills add https://github.com/CybLow/pypaginate --skill api-auth
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: api-auth
Source: https://github.com/CybLow/pypaginate/tree/main/.opencode/skills/api-auth
Command: npx skills add https://github.com/CybLow/pypaginate --skill api-auth

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

API authentication and rate limiting for modern FastAPI services, helping developers implement secure access control and scalable usage policies without boilerplate.

Core Features & Use Cases

  • API Key authentication, JWT validation, and OAuth2 with scopes
  • Rate limiting strategies (fixed window, sliding window, token bucket, leaky bucket)
  • FastAPI integration with security dependencies and typed models
  • Use cases: securing microservices, third-party integrations, and API gateways

Quick Start

Configure FastAPI security schemes (APIKeyHeader, HTTPBearer, and OAuth2 with scopes) and attach the provided dependencies to protect endpoints.

Frequently Asked Questions about api-auth

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I implement JWT authentication and API keys in FastAPI?

You can implement JWT authentication and API keys in FastAPI by configuring APIKeyHeader, HTTPBearer, and OAuth2 security schemes. Attaching these security dependencies to endpoints protects your microservices and ensures secure access control.

What are the best rate limiting strategies for FastAPI microservices?

The best rate limiting strategies for FastAPI include fixed window, sliding window, token bucket, and leaky bucket algorithms. These patterns control API usage scalability and prevent abuse by applying specific request limits to protected endpoints.

Can I use OAuth2 with scopes to secure third-party API integrations?

Yes, OAuth2 with scopes secures third-party API integrations. Configuring OAuth2 security schemes in FastAPI allows you to enforce granular access control, ensuring external clients only access explicitly permitted resources.

How does FastAPI dependency injection work for API security?

FastAPI dependency injection for API security works by attaching configured security schemes directly to endpoints. This typed model approach validates API keys and tokens automatically, providing scalable usage policies and secure access control.

Do I need a separate gateway to apply token bucket rate limiting?

No, a separate gateway is not needed to apply token bucket rate limiting. You can integrate token bucket, fixed window, sliding window, and leaky bucket strategies directly within FastAPI backends using built-in security dependencies.