api-builder

Guides building REST and GraphQL APIs with FastAPI or Django from design to deployment.

Updated Aug 13, 2026
One-click install
npx skills add https://github.com/Viranya2006/Lumen --skill api-builder-viranya2006
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: api-builder
Source: https://github.com/Viranya2006/Lumen/tree/main/SKILLS/api-builder
Command: npx skills add https://github.com/Viranya2006/Lumen --skill api-builder-viranya2006

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Building a production-grade Python API involves dozens of decisions across framework selection, authentication, documentation, testing, observability, and deployment, and getting any of them wrong leads to security holes, poor performance, or unmaintainable code. ## Core Features & Use Cases - Framework Guidance: Decision matrices and deep-dive patterns for FastAPI (async, Pydantic V2, SQLAlchemy 2.0) and Django (DRF, ORM optimization, Celery). - Security & Auth Patterns: JWT/OAuth2 flows, RBAC, rate limiting, input validation, and security headers with ready-to-adapt code. - Full Lifecycle Coverage: OpenAPI 3.1 documentation, mock servers and contract testing, structured logging with OpenTelemetry and Prometheus, plus Docker, Kubernetes, and CI/CD deployment configs. - Use Case: You need to ship a FastAPI microservice with JWT auth, health checks, and a Kubernetes deployment. The skill walks you through project structure, security checklist, observability setup, and production manifests step by step. ## Quick Start Ask the agent to help you design and scaffold a new FastAPI or Django REST API, specifying your requirements for authentication, testing, and deployment.

Frequently Asked Questions about api-builder

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

FAQPage Schema
How do I choose between FastAPI and Django for a new API?

Choose FastAPI for high-concurrency microservices and ML APIs where native async support matters. Choose Django when you need a full-featured application with a built-in admin panel, ORM, and batteries-included conventions for SaaS or e-commerce projects.

How do I implement JWT authentication in FastAPI?

Use python-jose or pyjwt to encode access tokens with short 15-minute expirations and refresh tokens lasting 7 days. Validate tokens in a dependency that decodes the Bearer token, extracts the user ID, and loads the user from the database.

How do I avoid N+1 queries in Django REST Framework?

Use select_related for foreign key relationships and prefetch_related for many-to-many fields in your ViewSet get_queryset method. This collapses per-object queries into a constant number of database round trips.

Does FastAPI support API documentation automatically?

Yes, FastAPI generates OpenAPI specifications and interactive Swagger UI documentation automatically from your route signatures and Pydantic models. You can enrich it with examples, error responses, and authentication flow descriptions.

What health check endpoints should a production API have?

Provide /health/live for liveness probes, /health/ready for readiness checks that verify database and Redis connectivity, and /metrics for Prometheus scraping. Kubernetes uses these to manage pod lifecycle and traffic routing.

How do I rate limit API endpoints in Python?

Implement a token bucket or sliding window algorithm backed by Redis, keyed by client IP or user ID. Return HTTP 429 with a Retry-After header when limits are exceeded, and apply tiered limits based on the user's plan.