Kokoro-FastAPI is a Dockerized FastAPI service that turns text into speech using the Kokoro-82M model through an OpenAI-compatible API. It is used by developers and self-hosters who need multilingual, multi-speaker speech generation, captions, phonemes, or an optional web interface.
Borrowing it
Nothing to install: this file belongs to remsky/Kokoro-FastAPI. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/remsky/Kokoro-FastAPI/master/.claude/skills/api-contrib/SKILL.mdgit clone --depth 1 https://github.com/remsky/Kokoro-FastAPIWrote 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.
[](https://agentmods.dev/skills/remsky/kokoro-fastapi/api-contrib)<a href="https://agentmods.dev/skills/remsky/kokoro-fastapi/api-contrib"><img src="https://agentmods.dev/badge/skills/remsky/kokoro-fastapi/api-contrib/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/remsky/kokoro-fastapi/api-contrib"><img src="https://agentmods.dev/badge/skills/remsky/kokoro-fastapi/api-contrib.svg" alt="Reviewed on agentmods" width="80" height="20"></a>- NVIDIA SkillSpector pass
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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00039 | $0.00715 |
| Opus 5.5 | $0.00016 | $0.00286 |
| Sonnet 5.5 | $0.00008 | $0.00143 |
| Haiku 4.5 | $0.00004 | $0.00072 |
Grade A, and why
api-contrib 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 today.
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.
How it starts
The opening of the file, as written. The whole thing — 34 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Read AGENTS.md and CONTRIBUTING.md first, house rules live there.
API contributions
Where things live
api/src/routers/openai_compatible.py- main API surface (/v1/audio/speech,/v1/audio/voices,/v1/models). Captioned speech is/dev/captioned_speechindevelopment.py. Changes here affect every OpenAI-client consumer, so keep request/response shapes backward compatible.api/src/routers/debug.py- introspection endpoints, opt-in (enable_debug_endpoints).development.pyis on by default except/dev/model,/dev/unload,/dev/reloadbehindallow_dev_unload.api/src/routers/ssml.py-/dev/ssml, behindenable_ssml.web_player.pyserves/web.api/src/services/tts_service.py- orchestration between text processing, inference, and audio encoding.api/src/services/streaming_audio_writer.py- per-format encode/finalize. Historically fragile at chunk boundaries and finalize time (WAV trailer click, OGG final-page loss), so test full stream + finalize output, not just single chunks.api/src/inference/-kokoro_v1.py(backend),model_manager.py,voice_manager.py. Voice tensors are cached and loaded withweights_only=True; keep both properties intact.api/src/core/config.py- pydantic-settings, all env-overridable.
Adding an endpoint
- Add the route in the right router (or a new one, registered in
api/src/main.py). - Two gating patterns, both 403 when off and both documented in
docs/configuration.md:- Surfaces host, process, or model internals (unload, introspection, etc):
False-default setting, opt-in, to avoid unintentional exposure on shared deployments. Followenable_debug_endpoints/allow_dev_unload. - Parses richer user text (tags, markup):
True-default kill switch so operators proxying untrusted input can turn it off. Followenable_voice_tags/enable_ssml.
- Surfaces host, process, or model internals (unload, introspection, etc):
- Add
api/tests/test_<feature>.pycovering enabled, disabled, and error paths.
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.
- today Changed fd6d6f2e38df
- 1mo ago Changed · +1 lines 5ef40a0e0251
- 1mo ago Changed · +2 lines 3bf9da93af66
- 2mo ago First seen · 31 lines · 39 tokens per session scan A 75e5abe251e8
api-contrib is a skill published in the GitHub repository remsky/Kokoro-FastAPI (5,614 stars, last pushed today), licensed Apache-2.0. It adds 39 tokens to every session and 715 once invoked, about $0.0002 per session on Opus 5.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.
Other skills, from other repositories
fastapi-expert
Expert-level FastAPI development for high-performance Python APIs with async support. Use when the user mentions Python, API, async, REST, OpenAPI, or Pydantic, or when the task involves FastAPI Features.
asyncio
Python asyncio - Modern concurrent programming with async/await, event loops, tasks, coroutines, primitives, aiohttp, and FastAPI async patterns.
fastapi
Build production FastAPI services with Pydantic v2 models, async-safe I/O, dependency injection, OpenAPI, webhook raw-body routes, and structured errors. Use for JSON APIs, Stripe webhooks, and TestClient/httpx testing.
fastapi-routes
Create or modify FastAPI routes. Use when: adding new API endpoints, creating Pydantic request/response models, registering routers, designing REST APIs, or following route conventions for this project.
typer-cli
Add or modify CLI commands using Typer. Use when: adding new CLI subcommands, wrapping async functions for CLI use, understanding the CLI entrypoint structure, or following the @syncify pattern for async commands.
python
Enforces FastAPI, Dependency Injection, and general Python coding standards using uv inside the server directory.