new·The score now tells you which way it movedA brain's exam only ever grows: its own material writes questions, and so does every question a real caller asked and did not get answered. The score is a percentage over that growing set, so a brain that learned more could post a smaller number — and this week three did. One of them answered two MORE questions than the week before and showed eighteen points less. Printed as a single percentage, that reads as decline to a reader and as punishment to anyone who contributes material.all news →
mozg.beta
Sign in

explore / Backend & APIs / mozg / FastAPI

FastAPI · Reference

Answer questions about the FastAPI reference exactly as specified: the FastAPI class and its parameters, APIRouter, Request and Response classes, status codes and exceptions, and every parameter class with its arguments.

197 notes · updated 2026-08-12 · trained 80%

since last sitting: +24 newly passed — this brain is learning · the verified changelog →

use this brain
# sign in to get a token
$ claude mcp add --transport http mozg \
https://mozg.sh/mcp --header "Authorization: Bearer …"
> use mozg/fastapi-reference — …
Sign in — get this command with your token in it

New here? Sign in and this exact command appears with your token already inside — copy, paste into your terminal, done.

Or just add it

Sign in and add it, and every agent you have connected can read it — nothing to download, and it stays current as the author updates it.

Sign in to add it

Ask it things like

answers 24/30 on its latest exam
When should I use Security() instead of Depends() for dependency injection?Dependencies and Background Tasks
How do I specify which servers should appear in the OpenAPI documentation for a FastAPI application?FastAPI Class Core
What parameter do I use in FastAPI() to customize how operation IDs are generated for path operations?FastAPI Class Core
What parameter in a path operation decorator lets me define which HTTP status codes are possible responses?Path Operations and Decorators
What exception should I raise for HTTP errors, and where is it imported from?Status Codes and Exceptions
What methods does APIRouter have available?APIRouter
What parameter can I pass to APIRouter to use a custom route class instead of the default?APIRouter
What is the scope parameter in yield dependencies used for?Dependencies and Background Tasks

What it can answer

30 coverage checks
80%
Answers 24 of the exam's 30 questionsIt answers 24 questions, 24 more than last time, out of an exam that grew by 30.Nothing it used to answer has stopped working.
Path Operations and Decorators6 / 7
Status Codes and Exceptions4 / 4
Dependencies and Background Tasks3 / 3
FastAPI Class Core3 / 4
Request and Response Classes3 / 4
APIRouter2 / 2
Testing2 / 2
Parameter Classes1 / 4
exam badge — share this score →

Attacks survived

re-run weekly · 2026-08-09
gate-battery12/12 known hostile payloads caught by the ingest gate
injection-corpusevery active note scanned — no steering language
secret-corpusevery active note scanned — no keys or credentials

heuristic scans against known attack classes — measured and dated, not a promise of unpoisonability

Inside

  • Query, Path, and Cookie are functions returning special classes · parameter classes
  • Cookie parameters work like Query and Path parameters · parameter classes
  • Browser cookies limitation in API documentation UI · parameter classes
  • Cookie parameter declaration syntax · parameter classes
  • Cookie must be imported explicitly · parameter classes
  • Cookie is a Param subclass · parameter classes
  • Extra forbidden cookie error response format · status codes and exceptions
  • Cookie parameter models with Pydantic · parameter classes
  • Cookie parameter models apply to Query, Header too · parameter classes
  • Forbid extra cookies with Pydantic model configuration · parameter classes
  • Custom Request class to override Request.body() · request & response classes
  • Accessing request body in exception handlers · request and response classes
  • Use cases for custom Request and APIRoute classes · path operations & decorators
  • Request object attributes: scope and receive · request and response classes

Licence

CC BY-NC-SA 4.0

Use it, copy it, build on it, with credit. Selling it is not allowed.