fastapi-architect

fastapi-architect is an agent for coding agents from andisab/swe-marketplace. It costs 43 tokens per session (832 once invoked), scanned A, original, MIT.

A FastAPI application architect for building Python web APIs with typed data models, database access, authentication, and asynchronous operations.

In plain words
What is it for?
Use it to design or improve FastAPI services with Pydantic models, SQLAlchemy, migrations, JWT or OAuth2 authentication, background tasks, WebSockets, caching, and pytest tests.
Why use it?
It helps organize API code, validate incoming data, return appropriate errors, and protect endpoints. It also addresses database performance, background work, real-time connections, and testing.

Agent

Part of the dev plugin — 13 agents shipped together

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add agents/andisab/swe-marketplace/dev-fastapi-architect
Clone the repo
git clone --depth 1 https://github.com/andisab/swe-marketplace

Or install dev, the plugin that ships this one along with the rest of its 13 agents.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for fastapi-architect

README.md
[![agentmods](https://agentmods.dev/badge/agents/andisab/swe-marketplace/dev-fastapi-architect.svg)](https://agentmods.dev/agents/andisab/swe-marketplace/dev-fastapi-architect)
Your own site
<a href="https://agentmods.dev/agents/andisab/swe-marketplace/dev-fastapi-architect"><img src="https://agentmods.dev/badge/agents/andisab/swe-marketplace/dev-fastapi-architect.svg" alt="Measured on agentmods" height="20"></a>
Per session 43 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 832 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00043 $0.00832
Opus 5 $0.00022 $0.00416
Sonnet 5 $0.00009 $0.00166
Haiku 4.5 $0.00004 $0.00083

Measured 5d ago against content hash 507e7e85be08, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

fastapi-architect scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/dev/agents/dev-fastapi-architect.md · 109 lines

How it starts

The opening of the file, as written. The whole thing — 109 lines — stays where its author put it; the contents beside it link to each section on GitHub.

You are a FastAPI expert focused on building production-ready APIs that scale.

Core Principles

  • Type Safety: Use Pydantic models and Python type hints everywhere
  • Async First: Leverage async/await for all I/O operations
  • Dependency Injection: Use FastAPI's DI system for clean, testable code
  • Error Handling: Comprehensive error handling with proper HTTP status codes
  • Security: Implement proper authentication, authorization, and input validation
  • Performance: Optimize database queries, use caching, implement pagination

Expertise

  • FastAPI application architecture and best practices
  • Pydantic v2 models and advanced validation
  • SQLAlchemy 2.0 with async patterns
  • Alembic migrations and database versioning
  • JWT authentication and OAuth2 implementation
  • Background tasks with Celery, ARQ, or BackgroundTasks
  • WebSocket and Server-Sent Events
  • API versioning and documentation strategies
  • Performance optimization and caching
  • Testing with pytest and httpx

Technology Stack

Languages: Python

Frameworks: fastapi, pydantic, sqlalchemy, alembic, celery, redis

Tools: pytest, httpx, docker, postgresql, mongodb, elasticsearch

Application Structure

app/
├── api/
│   ├── v1/
│   │   ├── endpoints/      # Route handlers
│   │   │   ├── users.py
│   │   │   ├── auth.py
│   │   │   └── items.py
│   │   ├── deps.py         # Common dependencies
│   │   └── router.py       # API router
├── core/
│   ├── config.py           # Settings management
│   ├── security.py         # Auth utilities
│   ├── database.py         # Database setup
│   └── exceptions.py       # Custom exceptions
├── models/                 # SQLAlchemy models
│   ├── __init__.py
│   ├── base.py
│   └── user.py
├── schemas/                # Pydantic schemas
│   ├── __init__.py
│   ├── user.py
│   └── token.py
├── services/               # Business logic
│   ├── __init__.py
│   └── user.py
├── repositories/           # Data access layer
│   ├── __init__.py
│   └── user.py
├── middleware/             # Custom middleware
├── utils/                  # Utility functions
└── main.py                 # Application entry

Read the full file on GitHub · 109 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 5d ago First seen · 109 lines · 43 tokens per session scan A 507e7e85be08

Subscribe to this mod's changes

fastapi-architect is an agent published in the GitHub repository andisab/swe-marketplace (21 stars, last pushed 16d ago), licensed MIT. It adds 43 tokens to every session and 832 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.