Kokoro-FastAPI: Skill for Claude Code

.claude/skills/api-contrib/SKILL.md

api-contrib is a skill for Claude Code from remsky/Kokoro-FastAPI. It costs 39 tokens per session (715 once invoked), scanned A, original, Apache-2.0.

Project-specific guidance for contributing to the Kokoro-FastAPI Python API, including its module layout, endpoint rules, and testing expectations.

In plain words
What is it for?
Use it when adding or changing endpoints, text-to-speech services, inference components, configuration, or streaming audio output.
Why use it?
It helps developers place changes correctly and preserve compatibility when modifying API routes, services, inference code, or audio streaming.

Skill for Claude Code

Written for Claude Code: installed under .claude/. Also seen: mentions AGENTS.md.

This is remsky/Kokoro-FastAPI's own configuration. It tells Claude Code how to work on Kokoro-FastAPI itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything Kokoro-FastAPI configures →

About the project

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.

remsky/Kokoro-FastAPI · 5,614 stars · on GitHub

Reuse

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.

Copy the file
curl -O https://raw.githubusercontent.com/remsky/Kokoro-FastAPI/master/.claude/skills/api-contrib/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/remsky/Kokoro-FastAPI

Made for: Claude Code.

Wrote 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.

agentmods badge for api-contrib

README.md
[![agentmods](https://agentmods.dev/badge/skills/remsky/kokoro-fastapi/api-contrib/github.svg)](https://agentmods.dev/skills/remsky/kokoro-fastapi/api-contrib)
Your own site
<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.

agentmods 80×15 button for api-contrib

Your own site · 80×15
<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>
Per session 39 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 715 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.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

Measured today against content hash fd6d6f2e38df, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

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.

.claude/skills/api-contrib/SKILL.md · 34 lines

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_speech in development.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.py is on by default except /dev/model, /dev/unload, /dev/reload behind allow_dev_unload.
  • api/src/routers/ssml.py - /dev/ssml, behind enable_ssml. web_player.py serves /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 with weights_only=True; keep both properties intact.
  • api/src/core/config.py - pydantic-settings, all env-overridable.

Adding an endpoint

  1. Add the route in the right router (or a new one, registered in api/src/main.py).
  2. 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. Follow enable_debug_endpoints / allow_dev_unload.
    • Parses richer user text (tags, markup): True-default kill switch so operators proxying untrusted input can turn it off. Follow enable_voice_tags / enable_ssml.
  3. Add api/tests/test_<feature>.py covering enabled, disabled, and error paths.

Read the full file on GitHub · 34 lines

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. today Changed fd6d6f2e38df
  2. 1mo ago Changed · +1 lines 5ef40a0e0251
  3. 1mo ago Changed · +2 lines 3bf9da93af66
  4. 2mo ago First seen · 31 lines · 39 tokens per session scan A 75e5abe251e8

Subscribe to this mod's changes

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.