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.
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.
npx agentmods add skills/remsky/kokoro-fastapi/api-contribnpx skills add remsky/Kokoro-FastAPI --skill api-contribgit 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.svg" alt="Measured on agentmods" height="20"></a>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 | $0.00039 | $0.00554 |
| Opus 5 | $0.00019 | $0.00277 |
| Sonnet 5 | $0.00008 | $0.00111 |
| Haiku 4.5 | $0.00004 | $0.00055 |
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 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.
How it starts
The opening of the file, as written. The whole thing — 31 lines — stays where its author put it; the contents beside it link to each section on GitHub.
API contributions
Where things live
api/src/routers/openai_compatible.py- main API surface (/v1/audio/speech, captioned speech). Changes here affect every OpenAI-client consumer, so keep request/response shapes backward compatible.api/src/routers/development.pyanddebug.py- dev/introspection endpoints, opt-in only.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 the README config table:
- 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.
Testing
uv run pytestrunsapi/tests/with coverage; integration tests are excluded (-m integrationto opt in, needs a running server).- Tests mock the model; no GPU needed. If a change is only verifiable on CUDA/ROCm hardware you don't have, say so in the PR.
ruff format .andruff check . --fixbefore staging.
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.
- 5d 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,406 stars, last pushed yesterday), licensed Apache-2.0. It adds 39 tokens to every session and 554 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.
Other skills, from other repositories
add-or-fix-type-checking
Fixes broken typing checks detected by ty, make typing, or make check-repo. Use when typing errors appear in local runs, CI, or PR logs.
datamodel-code-generator
Use this skill when the user wants Python data models, Pydantic models, dataclasses, TypedDicts, msgspec structs, or type-safe Python classes generated from OpenAPI, AsyncAPI, JSON Schema, GraphQL, JSON/YAML/CSV sample data, MCP tool schemas, Protocol Buffers, XML Schema, Apache Avro, or existing Python model objects.…
fastapi-python
Expert in FastAPI Python development with best practices for APIs and async operations.
kernel-cute-writing
Write and implement GPU kernels using NVIDIA CuTe DSL (CUTLASS 4.x Python API) — NOT for Triton, CUDA C++, or conceptual explanations. Trigger only when the user wants to write or implement a kernel, not when asking questions about CuTe DSL concepts or layouts. CuTe DSL uses cute.jit/cute.kernel decorators and…
python-patterns
Python development principles and decision-making. Framework selection, async patterns, type hints, project structure. Teaches thinking, not copying.
tdd
Strict Python TDD workflow using pytest (Red-Green-Refactor).