Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion api-reference/errors.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
|---|---|---|
| `400` | Bad request — invalid parameters, or a `reference_id` / voice that doesn't exist | Fix the request; read the `message`. |
| `401` | Invalid or missing API key | Send `Authorization: Bearer <key>`; check it on [API Keys](https://fish.audio/app/api-keys). |
| `402` | Insufficient credits | Top up on [Billing](https://fish.audio/app/billing). |
| `402` | Insufficient credits | Top up on [API Billing](https://fish.audio/app/developers/billing/). |

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Update the matching 402 guidance in developer-guide/getting-started/quickstart.mdx.

That page still directs out-of-credits users to general Billing at developer-guide/getting-started/quickstart.mdx:193. If API 402 responses should use API Billing, update that row too to avoid conflicting guidance.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@api-reference/errors.mdx` at line 21, Update the matching
402/insufficient-credits guidance in the quickstart page to direct users to API
Billing, aligning it with the 402 entry in the errors reference and removing the
conflicting general Billing link.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Use a relative internal link.

https://fish.audio/app/developers/billing/ is an internal URL. Use a relative or root-relative path instead.

Proposed fix
-| `402` | Insufficient credits | Top up on [API Billing](https://fish.audio/app/developers/billing/). |
+| `402` | Insufficient credits | Top up on [API Billing](/app/developers/billing/). |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@api-reference/errors.mdx` at line 21, Update the API Billing link in the 402
“Insufficient credits” row to use a relative or root-relative internal path
instead of the full https://fish.audio URL, preserving the link destination and
label.

Source: Coding guidelines

| `403` | Not permitted for this key/resource | Check the key's scope and the resource owner. |
| `404` | Model or voice not found | Verify the `model_id` / `reference_id`. |
| `429` | Rate limit exceeded | Back off and retry (see below). |
Expand All @@ -31,7 +31,7 @@
```python
import time
from fishaudio import FishAudio
from fishaudio.exceptions import RateLimitError, APIError

Check warning on line 34 in api-reference/errors.mdx

View check run for this annotation

Mintlify / Mintlify Validation (hanabiaiinc) - vale-spellcheck

api-reference/errors.mdx#L34

Did you really mean 'APIError'?

client = FishAudio()

Expand All @@ -48,9 +48,9 @@
raise # 4xx — fix the request
```

## Handling errors in the SDKs

Check warning on line 51 in api-reference/errors.mdx

View check run for this annotation

Mintlify / Mintlify Validation (hanabiaiinc) - vale-spellcheck

api-reference/errors.mdx#L51

Did you really mean 'SDKs'?

Both SDKs raise typed exceptions you can branch on. The base class carries the status and the parsed body.

Check warning on line 53 in api-reference/errors.mdx

View check run for this annotation

Mintlify / Mintlify Validation (hanabiaiinc) - vale-spellcheck

api-reference/errors.mdx#L53

Did you really mean 'SDKs'?

<CodeGroup>
```python Python
Expand All @@ -58,7 +58,7 @@
AuthenticationError, # 401
RateLimitError, # 429
NotFoundError, # 404
APIError, # any other HTTP error — has .status and .message

Check warning on line 61 in api-reference/errors.mdx

View check run for this annotation

Mintlify / Mintlify Validation (hanabiaiinc) - vale-spellcheck

api-reference/errors.mdx#L61

Did you really mean 'APIError'?
FishAudioError, # base class for all SDK errors
)

Expand All @@ -69,7 +69,7 @@
except RateLimitError:
... # back off and retry
except NotFoundError:
... # bad reference_id / model id

Check warning on line 72 in api-reference/errors.mdx

View check run for this annotation

Mintlify / Mintlify Validation (hanabiaiinc) - vale-spellcheck

api-reference/errors.mdx#L72

Did you really mean 'reference_id'?
except APIError as e:
print(e.status, e.message) # 400, 402, 5xx, ...
```
Expand Down
Loading