fastapi-redis-sdk
Skill by redis
fastapi-redis-sdk is a development skill for writing code, tests, and configuration for the fastapi-redis-sdk library. It helps developers use the official Redis integration for FastAPI, including its DI-based caching.
Install fastapi-redis-sdk
Built from the published package, never by AI.
git clone --depth 1 https://github.com/redis/fastapi-redis-sdk /tmp/fastapi-redis-sdk && mkdir -p ~/.claude/skills && cp -r /tmp/fastapi-redis-sdk/.github/skills/redis-fastapi ~/.claude/skills/fastapi-redis-sdkRun in your terminal. Claude Code loads skills from ~/.claude/skills automatically.
git clone --depth 1 https://github.com/redis/fastapi-redis-sdk /tmp/fastapi-redis-sdk && mkdir -p ~/.gemini/antigravity-cli/skills && cp -r /tmp/fastapi-redis-sdk/.github/skills/redis-fastapi ~/.gemini/antigravity-cli/skills/fastapi-redis-sdkAntigravity CLI loads skills from ~/.gemini/antigravity-cli/skills, or .agents/skills for one project.
Skills can run scripts on your machine. Some need an API key: check the README.
About
fastapi-redis-sdk is a development skill for writing code, tests, and configuration for the fastapi-redis-sdk library, the official Redis integration for FastAPI. It covers project setup with uv and nox, connection lifecycle through the app lifespan, and async and sync endpoints. It also describes DI-based caching with cache(), cache_evict(), cache_put(), and CacheBackend.
The skill lists architecture rules, testing conventions, configuration variables, and CI workflow notes. Unit tests use fakeredis, while integration tests need a real Redis on localhost:6379. It is aimed at developers working with this library. The source says not to use it for general Redis or FastAPI questions.
Written from the project's SKILL.md and checked against it.
What it can do
- Project setupInstalls dependencies with uv and runs CI checks locally through nox sessions.
- DI-based cachingProvides cache(), cache_evict() and cache_put() as FastAPI dependencies for GET endpoints.
- CacheBackendOffers get, set, delete, has and delete_group for conditional caching and custom invalidation.
- Lifespan setupInitialises Redis pools through the app lifespan using the FastAPIRedis builder.
- Endpoint dependenciesProvides AsyncRedisDep, CacheBackendDep and SyncCacheBackendDep for async and sync endpoints.
- Testing conventionsDescribes unit tests with fakeredis and integration tests marked with requires_redis.
- ConfigurationExplains settings through REDIS_ prefixed environment variables or a .env file.
- TelemetryDescribes optional OpenTelemetry spans and metrics for cache operations.
- CI workflowsExplains that CI delegates to nox sessions so local and CI checks stay in sync.
What you need
- Python 3.10 or later
- uv
- nox
- Redis on localhost:6379 for integration tests
Try asking
- Add a cached GET endpoint using cache() with a 300 second TTL
- Set up FastAPIRedis with the lifespan and caching in my app
- Write an integration test that uses the real_async_redis fixture
Good to know
- Integration tests need Redis running on localhost:6379.
- Do not replace the uv_build backend or switch caching to decorators.
- cache() reads settings when the module loads, not per request.
- Only GET responses are cached, and endpoint exceptions are never cached.
Security check
ANo download-and-run commands, hidden instructions or signs of sending keys out were found.
Checked automatically: .github/skills/redis-fastapi/SKILL.md. This looks for known risky patterns and is not a full audit. How grades work
Alternatives to fastapi-redis-sdk
All alternatives →Runs a 7-stage workflow for auditing, cleaning up and reviewing GitHub repositories, plus competitor analysis. Written for developers who want a repo checked for secrets, junk files and documentation gaps.
Teaches an AI assistant to build, debug and explain Gradio web UIs and ML demos in Python. It covers the core API, components, event listeners, layouts and the MCP server option. Aimed at Python developers who work with Gradio.
Recommends menus, buttons, toolbars and disclosure controls for Apple platforms using Human Interface Guidelines conventions. Built for developers and designers making iOS, iPadOS, macOS or visionOS interfaces. Checks existing project design context before asking questions.
Creates production-ready FastAPI project structures with async patterns, dependency injection, and error handling. It is for developers starting new FastAPI applications or backend API projects.
Analyzes Android apps to find user workflows to expose as AppFunctions, so AI agents and system shortcuts can run them without opening the app UI. Generates Kotlin code and refines KDoc for Android developers.
Creates, edits, validates and runs Agent QA tests, suites and hooks through MCP or CLI. It keeps canonical IDs and schema contracts intact, for developers and QA teams using Agent QA.
Compare with openclaw-github-repo-commander, gradio or hig-components-menus
fastapi-redis-sdk: common questions
Should I use this skill for general Redis or FastAPI questions?
No. The skill says not to use it for general Redis or FastAPI questions unrelated to fastapi-redis-sdk.
How does caching work in fastapi-redis-sdk?
cache() is a Depends() factory that stores GET responses in Redis string keys, with ETag, 304 and Cache-Control handling. Cache keys combine the prefix, eviction group, path and sorted query parameters.
Does fastapi-redis-sdk support Redis Sentinel?
Yes. Sentinel mode is enabled with REDIS_SENTINEL=true, using REDIS_SENTINEL_NODES and REDIS_SENTINEL_MASTER_NAME.
How do I install fastapi-redis-sdk?
Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.
Is fastapi-redis-sdk free?
The code is published under the MIT licence. The service it connects to may have its own pricing.
Is fastapi-redis-sdk safe to use?
It scores 77 of 100. Grades: maintenance A, licence A, quality B. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.
What are alternatives to fastapi-redis-sdk?
Similar skills: openclaw-github-repo-commander, gradio, hig-components-menus, fastapi-templates.
