Repository navigation
feat(types): accept s2.1-pro-free and drama-3 in Model; README examples and UTM link (FISH-1664) - #166
Conversation
New accounts start with no API credit, and s2.1-pro-free is the model they can call for free. It already works at runtime (the SDK forwards the model header unchanged), but type checkers rejected it because the Model Literal did not list it. Add it, with a unit test that it is sent as the header. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…arams - "Selecting a model" also shows model="s2.1-pro-free", which works on a new account before any API credit is added. - The fish.audio API-key link carries utm_source=github, utm_medium=sdk-readme and utm_content=python, so signups from the README can be attributed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Add TTS model examples and test conversions src/fishaudio/types/shared.py, README.md, tests/unit/test_tts.py |
The model type accepts s2.1-pro-free and drama-3. The README shows examples for both, and tests check the model header and returned audio bytes. |
Opus bitrate serialization
| Layer / File(s) | Summary |
|---|---|
Serialize Opus bitrate values src/fishaudio/types/tts.py, tests/unit/test_types.py |
TTSRequest multiplies positive opus_bitrate values by 1,000 during serialization. It leaves zero and negative values unchanged. Tests cover the default, an explicit positive value, and a negative value. |
API-key URL tracking
| Layer / File(s) | Summary |
|---|---|
Add API-key URL tracking parameters README.md |
The API-key URL adds utm_source=github, utm_medium=sdk-readme, and utm_content=python. |
Priority:
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Feature
Suggested reviewers: twangodev
Merge Risk: 
Minimal · up to f9c24
-
No concrete current-head defect or merge-blocking risk was identified.
Pre-merge checks: 
4 · 
1
-
Failed checks: 1 warning Passed checks: 4 passedFull details: Docstring Coverage
-
Explanation
Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 1 functions across 4 files.
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
-
Finishing Touches: 💡 1
-
📝 Generate docstrings: 💡
-
- Commit to this branch
- Create a new PR
🧪 Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Comment @coderabbitai help to get the list of available commands.
Codecov Report✅ All modified and coverable lines are covered by tests.
🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
🟢 Approval recommended
There are no active review issues blocking the addition of typed support for s2.1-pro-free.
No open issues 🎉
What changed in this PR
Adds typed support for s2.1-pro-free in the Python SDK so callers can select the free TTS model without type-checker errors. The default model remains s2.1-pro.
Changes:
- Adds
s2.1-pro-freeto theModelliteral type. - Adds a unit test verifying the free model is forwarded in the request header.
- Documents free-model usage and adds attribution parameters to the API-key link.
| File | Description |
|---|---|
tests/unit/test_tts.py |
Tests free-model header forwarding and returned audio. |
src/fishaudio/types/shared.py |
Includes s2.1-pro-free in the accepted model type. |
README.md |
Adds a free-model example and API-key link tracking parameters. |
Review effort: Balanced
|
Note for reviewers: the Integration Tests job fails on this PR with |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Since platform-api #625 (2026-05) the TTS API takes opus_bitrate in bps (24000/32000/48000/64000, -1000 = auto). The SDK still sent kbps, so every format="opus" request failed with HTTP 400 "Invalid opus bitrate 32". TTSConfig/TTSRequest keep the public kbps values; the request serializer converts them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Summary
New accounts start with no API credit, and
s2.1-pro-freeis the TTS model they can call for free. The Python SDK already forwards anymodelvalue as the request header, so it worked at runtime. But theModeltype did not list it, so type checkers rejected the call the docs now show (client.tts.convert(..., model="s2.1-pro-free")). Linear: FISH-1664.feat(types): add"s2.1-pro-free"toModel(src/fishaudio/types/shared.py), plus a unit test that it is sent as themodelheader.docs(readme):model="s2.1-pro-free";utm_source=github&utm_medium=sdk-readme&utm_content=python, so README signups can be attributed. The README has no separate signup link.The default model is unchanged (
s2.1-proon main). Changing it is an owner decision; the options are listed in the FISH-1662/1664 write-up.Testing
uv run poe format,lint,typecheck(ty): pass.uv run poe test: 158 passed, including the newtest_convert_with_free_model.Notes
PyPI is still on 1.3.0 (2026-03-10), whose
Modelhas no s2.1 models at all. This change only reaches users once main is released.🤖 Generated with Claude Code
Need help on this PR? Tag
@codesmith-botwith what you need.Summary by CodeRabbit
s2.1-pro-freeanddrama-3text-to-speech models, including in synchronous conversion requests.s2.1-pro-freeanddrama-3.Update:
Modelnow also acceptsdrama-3, with a README example and a unit test (owner request).Also fixes opus: since platform-api #625 the API takes
opus_bitratein bps. The SDK sent kbps, so everyformat="opus"request returned HTTP 400 ("Invalid opus bitrate 32"); the integration testtest_tts_with_different_formatscaught it once CI had a valid key. TTSConfig and TTSRequest keep their public kbps values, and the request serializer converts them to bps. A unit test covers it.