api-contrib

api-contrib is a skill for Claude Code, Codex from remsky/Kokoro-FastAPI. It costs 39 tokens per session (554 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 CodeCodex

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,406 stars · on GitHub

Install

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.

agentmods
npx agentmods add skills/remsky/kokoro-fastapi/api-contrib
Any agent
npx skills add remsky/Kokoro-FastAPI --skill api-contrib
Clone the repo
git clone --depth 1 https://github.com/remsky/Kokoro-FastAPI

Made for: Claude Code, Codex.

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.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.svg" alt="Measured on agentmods" 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 554 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00039 $0.00554
Opus 5 $0.00019 $0.00277
Sonnet 5 $0.00008 $0.00111
Haiku 4.5 $0.00004 $0.00055

Measured 5d ago against content hash 75e5abe251e8, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, 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 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.

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

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.py and debug.py - dev/introspection endpoints, opt-in only.
  • 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 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. 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.

Testing

  • uv run pytest runs api/tests/ with coverage; integration tests are excluded (-m integration to 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 . and ruff check . --fix before staging.

Read the full file on GitHub · 31 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. 5d 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,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.