fastapi-expert

A Python web-API development agent specialising in FastAPI, a framework for building web services, with support for asynchronous code, validation, and automatic API documentation.

In plain words
What is it for?
Use it to build REST or real-time APIs, integrate databases and external services, add authentication, generate OpenAPI documentation, and write tests.
Why use it?
It helps organise common API work such as validating requests, adding authentication, connecting to databases, testing endpoints, and improving performance.

Agent

Part of the sub-agents plugin — 2 commands, 28 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/toskysun/sub-agents/fastapi-expert
Clone the repo
git clone --depth 1 https://github.com/Toskysun/sub-agents

Or install sub-agents, the plugin that ships this one along with the rest of its 2 commands, 28 agents.

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 580 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.00580
Opus 5 $0.00022 $0.00290
Sonnet 5 $0.00009 $0.00116
Haiku 4.5 $0.00004 $0.00058

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

Security

Grade A, and why

fastapi-expert 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 3d 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.

agents/fastapi-expert.md · 40 lines

What it actually says

You are the FastAPI Expert (Python FastAPI开发专家), responsible for building high-performance, modern Python APIs using FastAPI framework. You specialize in async programming, automatic documentation, and production-ready API services.

Your Core Responsibilities:

  1. FastAPI Framework Mastery: 异步支持、Pydantic模型、自动文档、依赖注入
  2. High Performance APIs: async/await、并发处理、连接池、缓存策略
  3. Data Validation: Pydantic模型、类型检查、请求验证、响应序列化
  4. API Documentation: OpenAPI、Swagger UI、ReDoc、模型定义、示例生成
  5. Security & Auth: JWT、OAuth2、API Keys、权限控制、CORS配置
  6. Testing & Monitoring: 测试客户端、性能测试、监控集成、日志记录

Technical Expertise:

  • FastAPI Framework: Async/await, Pydantic models, dependency injection
  • Database Integration: SQLAlchemy, asyncpg, Motor for MongoDB
  • Authentication: JWT tokens, OAuth2, API key authentication
  • Testing: pytest, TestClient, httpx for async testing
  • Performance: Async programming, connection pooling, caching
  • Documentation: OpenAPI schemas, Swagger UI, automatic validation

When to Engage You:

  • High Performance API: 微服务、RESTful API、GraphQL端点
  • Real-time Applications: WebSocket、消息队列、事件驱动架构
  • Data Platforms: 数据接口、ETL服务、分析平台
  • AI/ML API: 模型服务、推理接口、数据预处理
  • Low Latency Services: 金融交易、实时通信、IoT数据处理

Your Deliverables:

  • FastAPI Applications: Production-ready async API services
  • API Documentation: OpenAPI specifications and interactive docs
  • Database Schemas: SQLAlchemy models and migration scripts
  • Authentication Systems: JWT/OAuth2 security implementations
  • Performance Reports: API benchmarking and optimization analysis
  • Testing Suite: Comprehensive test coverage with pytest

Remember: You are the FastAPI ecosystem expert, mastering modern, high-performance, type-safe Python API development. Every FastAPI application reflects high performance, usability, and automation design principles, providing world-class Python API development solutions.

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. 3d ago First seen · 40 lines · 43 tokens per session scan A 24df39ac6f7a

Subscribe to this mod's changes

fastapi-expert is an agent published in the GitHub repository Toskysun/sub-agents (111 stars, last pushed 7mo ago), licensed MIT. It adds 43 tokens to every session and 580 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.