.claude/skills/wrap-tts-as-openai-compatible/SKILL.md
Wrap a practical local or self-hosted TTS engine behind an OpenAI-compatible `POST /v1/audio/speech` server, especially for Google Colab or browser-driven testing. Use when requests include exposing a TTS model as OpenAI-compatible speech, building a compatibility wrapper for a broadly usable local TTS, classifying how an upstream TTS should be adapted, adding JSON/CORS support, or debugging browser/CORS/422/500/runtime issues for custom TTS servers.
npx skillsauth add shinshin86/aituber-onair wrap-tts-as-openai-compatibleInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Build or fix a thin compatibility server that exposes an existing TTS runtime as
OpenAI-compatible speech at POST /v1/audio/speech.
Prefer a minimal adapter. Do not redesign the upstream TTS runtime unless the request explicitly asks for it.
Optimize for practical local TTS runtimes that can reasonably fit the OpenAI speech shape: text input, optional voice selection, optional speed, and WAV output.
Good fit:
Out of scope by default:
For out-of-scope engines, do not force them into this skill. Say that the engine does not fit the minimal OpenAI-compatible wrapper path cleanly, and either narrow the scope or use a separate workflow.
Collect missing inputs before editing:
source_repo: upstream TTS repository or runtime sourceruntime_env: one of colab, local-python, or servermodel_id: default model id to exposeresponse_format: default wavcors_origins: browser origins to allow, if browser use is expectedsupports_voice_optional: whether voice should be optional; default trueapi_path: default /v1/audio/speechmodel.generate(...) returns audio or
generate_to_file(...) exists../bin/piper --text ... -f output.wav.runtime.synthesize(...) plus a repo helper such as
save_wav(...).result.audio can be serialized directly.
If the repo only demonstrates inference through notebooks or research
scripts, stop and reassess whether this skill is the right tool.application/json.model, input, optional voice, optional speed, and
optional response_format.voice concept, accept voice but treat
it as optional metadata.media_type="audio/wav" unless another format
is explicitly requested and supported.Content-Length when practical.response_format values with a clear 400.content-range unless implementing Range support.OPTIONS routes.POST and OPTIONS.Content-Type and Authorization..venv or equivalent over global pip install.uvicorn.log.generate_to_file(...)
over reimplementing serialization.GET /)GET /v1/models) if implementedcurl JSON request to /v1/audio/speech@aituber-onair/voice integration if the wrapper is meant to be consumed
by this repoIf the wrapper is intended for @aituber-onair/voice, validate both layers:
openaiCompatible in @aituber-onair/voice can fetch audio from the
wrappermodel, optional
voice, and optional API key flow422 with body.input missing:
Form(...) instead of JSON.500 response without CORS headers often looks like a CORS failure in
the browser. Check server logs first.ModuleNotFoundError in Colab:
curl but not from @aituber-onair/voice:
voice, speed, API key headers, and
browser-origin CORS exactly as expected.skills/wrap-tts-as-openai-compatible/references/openai-compatible-tts-checklist.mdskills/wrap-tts-as-openai-compatible/references/integration-patterns.md@aituber-onair/voice integration and browser checks, read:
skills/wrap-tts-as-openai-compatible/references/voice-e2e-validation.mdRun from the wrapper project root or notebook environment:
curl -i http://127.0.0.1:8000/
curl -i http://127.0.0.1:8000/v1/models
curl -X POST http://127.0.0.1:8000/v1/audio/speech \
-H 'Content-Type: application/json' \
-d '{"model":"<model_id>","input":"hello","speed":1}' \
--output out.wav
For Colab or uvicorn-backed wrappers, also check:
tail -n 200 uvicorn.log
/v1/audio/speech.voice is optional when the upstream runtime does not need it.audio/wav.@aituber-onair/voice can use it
through the openaiCompatible path.development
Wrap a practical local or self-hosted TTS engine behind an OpenAI-compatible `POST /v1/audio/speech` server, especially for Google Colab or browser-driven testing. Use when requests include exposing a TTS model as OpenAI-compatible speech, building a compatibility wrapper for a broadly usable local TTS, classifying how an upstream TTS should be adapted, adding JSON/CORS support, or debugging browser/CORS/422/500/runtime issues for custom TTS servers.
development
Apply released @aituber-onair/chat updates to @aituber-onair/core and core React examples, including dependency alignment, core re-exports, example model lists, docs, version/changelog, lockfiles, and verification. Use after chat package upgrades or when users ask to propagate chat changes into core.
testing
Add a new TTS provider to @aituber-onair/voice and wire it through engine implementation, public voice option types, internal engine handlers, factory registration, tests, docs, examples, and optional versioning updates. Use when requests include adding a TTS engine, supporting a voice provider or speech service, adding <provider> TTS, or updating supported voice providers.
testing
Add a new chat model id to @aituber-onair/chat and wire it through constants, provider implementation, tests, example UI selector, docs, and versioning updates. Use when requests include adding a new model, supporting a specific model id, adding a provider model, or updating supported models for providers such as claude, gemini, and openai.