curl https://api.fish.audio/apikey/self \
-H "Authorization: Bearer $FISH_API_KEY"
import os
import requests
response = requests.get(
"https://api.fish.audio/apikey/self",
headers={"Authorization": f"Bearer {os.environ['FISH_API_KEY']}"},
timeout=10,
)
response.raise_for_status()
key_info = response.json()
print(key_info["key_type"], key_info["effective_scopes"], key_info["spend_remaining_usd"])
const response = await fetch("https://api.fish.audio/apikey/self", {
headers: {
Authorization: `Bearer ${process.env.FISH_API_KEY}`,
},
});
const keyInfo = await response.json();
console.log(
keyInfo.key_type,
keyInfo.effective_scopes,
keyInfo.spend_remaining_usd
);
{
"_id": "674f9b2c1a8e4d0012ab34cd56ef7890",
"name": "Client STT Minter",
"masked_key": "sk-fish-****9f2a",
"team_id": "5e1c7a9f3b2d4c6e8a0f1b3d5c7e9a2b",
"key_type": "scoped",
"scopes": ["stt:write", "tokens:mint"],
"effective_scopes": ["stt:write", "tokens:mint"],
"created_at": "2026-12-01T10:00:00Z",
"expires_at": "2027-03-01T10:00:00Z",
"spend_limit_usd": "50.00",
"spend_limit_reset": "weekly",
"spend_current_usd": "12.45",
"spend_remaining_usd": "37.55",
"spend_resets_at": "2026-12-07T00:00:00Z",
"spend_limit_exceeded": false
}
{
"_id": "674f9b2c1a8e4d0012ab34cd56ef7891",
"name": "Local Dev Key",
"masked_key": "sk-fish-****4b1c",
"team_id": "5e1c7a9f3b2d4c6e8a0f1b3d5c7e9a2b",
"key_type": "classic",
"scopes": [],
"effective_scopes": [
"agents:read",
"agents:session",
"agents:write",
"billing:read",
"models:read",
"models:write",
"realtime:write",
"stt:write",
"tts:write",
"voice_design:write"
],
"created_at": "2026-11-15T08:30:00Z",
"expires_at": null,
"spend_limit_usd": null,
"spend_limit_reset": null,
"spend_current_usd": null,
"spend_remaining_usd": null,
"spend_resets_at": null,
"spend_limit_exceeded": false
}
{
"status": 401,
"message": "Invalid token"
}
API Keys
Get Current API Key
Introspect the calling API key’s type, scopes, expiration, and current-period USD spend limit
GET
/
apikey
/
self
curl https://api.fish.audio/apikey/self \
-H "Authorization: Bearer $FISH_API_KEY"
import os
import requests
response = requests.get(
"https://api.fish.audio/apikey/self",
headers={"Authorization": f"Bearer {os.environ['FISH_API_KEY']}"},
timeout=10,
)
response.raise_for_status()
key_info = response.json()
print(key_info["key_type"], key_info["effective_scopes"], key_info["spend_remaining_usd"])
const response = await fetch("https://api.fish.audio/apikey/self", {
headers: {
Authorization: `Bearer ${process.env.FISH_API_KEY}`,
},
});
const keyInfo = await response.json();
console.log(
keyInfo.key_type,
keyInfo.effective_scopes,
keyInfo.spend_remaining_usd
);
{
"_id": "674f9b2c1a8e4d0012ab34cd56ef7890",
"name": "Client STT Minter",
"masked_key": "sk-fish-****9f2a",
"team_id": "5e1c7a9f3b2d4c6e8a0f1b3d5c7e9a2b",
"key_type": "scoped",
"scopes": ["stt:write", "tokens:mint"],
"effective_scopes": ["stt:write", "tokens:mint"],
"created_at": "2026-12-01T10:00:00Z",
"expires_at": "2027-03-01T10:00:00Z",
"spend_limit_usd": "50.00",
"spend_limit_reset": "weekly",
"spend_current_usd": "12.45",
"spend_remaining_usd": "37.55",
"spend_resets_at": "2026-12-07T00:00:00Z",
"spend_limit_exceeded": false
}
{
"_id": "674f9b2c1a8e4d0012ab34cd56ef7891",
"name": "Local Dev Key",
"masked_key": "sk-fish-****4b1c",
"team_id": "5e1c7a9f3b2d4c6e8a0f1b3d5c7e9a2b",
"key_type": "classic",
"scopes": [],
"effective_scopes": [
"agents:read",
"agents:session",
"agents:write",
"billing:read",
"models:read",
"models:write",
"realtime:write",
"stt:write",
"tts:write",
"voice_design:write"
],
"created_at": "2026-11-15T08:30:00Z",
"expires_at": null,
"spend_limit_usd": null,
"spend_limit_reset": null,
"spend_current_usd": null,
"spend_remaining_usd": null,
"spend_resets_at": null,
"spend_limit_exceeded": false
}
{
"status": 401,
"message": "Invalid token"
}
Inspect the metadata, granted scopes, and live USD spend-limit state of the calling API key. Use this endpoint for health checks, verifying key permissions on startup, or monitoring remaining per-key budget before hitting a
402.
Authentication
Accepts any valid long-lived Classic or Scoped Fish Audio API key (Authorization: Bearer <sk-fish-...>). No extra scope is required.
- One-time
ek-fish-ephemeral tokens and web session tokens are rejected with401. - Responses include
Cache-Control: no-store. - When a spend limit is configured,
spend_current_usdandspend_remaining_usdare returned as unscaled decimal strings (parse as decimals). Both returnnullwhen no spend limit is configured or during billing maintenance.
Errors
| Status | Cause |
|---|---|
401 | Missing, invalid, disabled, expired, or revoked API key, or caller sent an ek-fish- ephemeral token instead of a long-lived sk-fish- key. |
curl https://api.fish.audio/apikey/self \
-H "Authorization: Bearer $FISH_API_KEY"
import os
import requests
response = requests.get(
"https://api.fish.audio/apikey/self",
headers={"Authorization": f"Bearer {os.environ['FISH_API_KEY']}"},
timeout=10,
)
response.raise_for_status()
key_info = response.json()
print(key_info["key_type"], key_info["effective_scopes"], key_info["spend_remaining_usd"])
const response = await fetch("https://api.fish.audio/apikey/self", {
headers: {
Authorization: `Bearer ${process.env.FISH_API_KEY}`,
},
});
const keyInfo = await response.json();
console.log(
keyInfo.key_type,
keyInfo.effective_scopes,
keyInfo.spend_remaining_usd
);
{
"_id": "674f9b2c1a8e4d0012ab34cd56ef7890",
"name": "Client STT Minter",
"masked_key": "sk-fish-****9f2a",
"team_id": "5e1c7a9f3b2d4c6e8a0f1b3d5c7e9a2b",
"key_type": "scoped",
"scopes": ["stt:write", "tokens:mint"],
"effective_scopes": ["stt:write", "tokens:mint"],
"created_at": "2026-12-01T10:00:00Z",
"expires_at": "2027-03-01T10:00:00Z",
"spend_limit_usd": "50.00",
"spend_limit_reset": "weekly",
"spend_current_usd": "12.45",
"spend_remaining_usd": "37.55",
"spend_resets_at": "2026-12-07T00:00:00Z",
"spend_limit_exceeded": false
}
{
"_id": "674f9b2c1a8e4d0012ab34cd56ef7891",
"name": "Local Dev Key",
"masked_key": "sk-fish-****4b1c",
"team_id": "5e1c7a9f3b2d4c6e8a0f1b3d5c7e9a2b",
"key_type": "classic",
"scopes": [],
"effective_scopes": [
"agents:read",
"agents:session",
"agents:write",
"billing:read",
"models:read",
"models:write",
"realtime:write",
"stt:write",
"tts:write",
"voice_design:write"
],
"created_at": "2026-11-15T08:30:00Z",
"expires_at": null,
"spend_limit_usd": null,
"spend_limit_reset": null,
"spend_current_usd": null,
"spend_remaining_usd": null,
"spend_resets_at": null,
"spend_limit_exceeded": false
}
{
"status": 401,
"message": "Invalid token"
}
Authorizations
Response
Request fulfilled, document follows
Self-introspection payload returned by GET /apikey/self (FISH-2376).
Was this page helpful?

