# python-api-endpoint-creator

Builds FastAPI endpoints and CRUD modules with separate router, service, and repository layers. Use it when adding a domain module and its tests.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode · ★ 109
- Author: c0x12c
- License: not stated · policy=link-only · description only; the file stays with the author
- Source: https://github.com/c0x12c/ai-toolkit/tree/HEAD/toolkit/skills/python-api-endpoint-creator/SKILL.md
- Updated: 2026-06-18
- HTML: https://affpapa.org/en/nevibecode/skills/python-api-endpoint-creator

## What it does

The skill lays out a module across Pydantic schemas, a SQLAlchemy model, repository, service, dependencies, router, and tests using `httpx.AsyncClient`. Database work is asynchronous, and the repository applies soft deletion. The router hands requests to the service rather than holding business logic.

Its conventions use GET for reads and POST for mutations, with IDs passed as query parameters. Endpoints are asynchronous unless CPU-bound. Set a response schema on each route: without `response_model`, FastAPI may serialize internal model fields such as `hashed_password` or `deleted_at`.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add c0x12c/ai-toolkit --skill python-api-endpoint-creator -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/python-api-endpoint-creator/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/python-api-endpoint-creator/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add c0x12c/ai-toolkit --skill python-api-endpoint-creator -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/python-api-endpoint-creator/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add c0x12c/ai-toolkit --skill python-api-endpoint-creator -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/python-api-endpoint-creator/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install c0x12c/ai-toolkit python-api-endpoint-creator
```

2. **Manually: put the files in place**
- File: `.github/skills/python-api-endpoint-creator/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add c0x12c/ai-toolkit --skill python-api-endpoint-creator -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/c0x12c/ai-toolkit --path toolkit/skills/python-api-endpoint-creator
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/python-api-endpoint-creator/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add c0x12c/ai-toolkit --skill python-api-endpoint-creator -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/c0x12c/ai-toolkit/tree/HEAD/toolkit/skills/python-api-endpoint-creator/SKILL.md

## When to use it
- add CRUD routes for a FastAPI domain entity
- organize an endpoint into router, service, and repository layers
- create Pydantic schemas and a SQLAlchemy model
- write async API tests with `httpx.AsyncClient`

## Example prompts
- Create FastAPI CRUD routes for an order entity and include tests.
- Scaffold a product API module with separate router, service, and repository files.
- Check the new routes for response schemas and suitable status codes.

## Similar
- [mcp-builder](https://affpapa.org/en/nevibecode/skills/mcp-builder.md) — skill · 130949 installs
- [claude-api](https://affpapa.org/en/nevibecode/skills/claude-api.md) — skill · 74198 installs
- [lark-im](https://affpapa.org/en/nevibecode/skills/lark-im.md) — skill · 472900 installs
- [lark-event](https://affpapa.org/en/nevibecode/skills/lark-event.md) — skill · 466800 installs
- [caveman-discover](https://affpapa.org/en/nevibecode/skills/caveman-discover.md) — skill · 104400 installs
- [migration](https://affpapa.org/en/nevibecode/skills/migration.md) — skill · 103900 installs

From the same set: [c0x12c/ai-toolkit](https://affpapa.org/en/nevibecode/by/c0x12c/ai-toolkit.md) — 33 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
