api-design-patterns

Design FastAPI API contracts with Pydantic v2 schemas and pagination.

8|1|Updated Feb 3, 2026
One-click install
npx skills add https://github.com/hieutrtr/ai1-skills --skill api-design-patterns-hieutrtr
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: api-design-patterns
Source: https://github.com/hieutrtr/ai1-skills/tree/main/skills/api-design-patterns
Command: npx skills add https://github.com/hieutrtr/ai1-skills --skill api-design-patterns-hieutrtr

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

## What problem does it solve? This Skill designs precise API contracts for FastAPI projects using Pydantic v2, helping teams align on endpoint contracts before implementation and sharing consistent guidelines across backend and frontend work.

## Core Features & Use Cases

  • Define RESTful naming conventions for endpoints, HTTP methods, and versioned paths.
  • Specify request/response schemas using Pydantic v2 with clear Create/Update/Response patterns.
  • Document pagination, filtering, error formats, and OpenAPI considerations to enable seamless frontend integration.
  • Use as a blueprint during planning to generate contract documentation and handoffs between teams.

### Quick Start Create an initial api-design.md at the project root and begin by outlining endpoints for a sample feature, including path, method, request/response schemas, and error handling. Then iterate with your team to refine the contract.

Frequently Asked Questions about api-design-patterns

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

FAQPage Schema
How do I design API contracts for FastAPI using Pydantic v2?

You design API contracts for FastAPI by defining request and response schemas using Pydantic v2, establishing clear Create, Update, and Response patterns to align frontend and backend teams before implementation begins.

What is the best way to standardize pagination and error formats in OpenAPI documentation?

Standardizing pagination and error formats involves enforcing cursor-based pagination and defining standardized error schemas within your OpenAPI documentation to ensure seamless frontend integration and consistent API behavior.

How do I structure RESTful endpoint naming conventions and URL versioning guidelines?

Structuring RESTful naming conventions requires defining consistent endpoint paths, HTTP methods, and URL versioning guidelines to maintain organized API contracts and predictable resource interactions across your project.

Can I use this to generate contract documentation for team handoffs?

Yes, you can use the contract design as a blueprint during planning to generate documentation and handoffs between teams, ensuring both frontend and backend align on precise endpoint definitions before coding.

Does FastAPI support cursor-based pagination and standardized error schemas natively?

FastAPI requires explicit schema definitions for cursor-based pagination and standardized error schemas. This contract design enforces these patterns using Pydantic v2 to structure consistent API responses and OpenAPI documentation.