fishaudio.types.voices
Voice and model management types.Sample Objects
title- Title/name of the audio sampletext- Transcription of the spoken content in the sampletask_id- Unique identifier for the sample taskaudio- URL or path to the audio file
Author Objects
id- Unique author identifiernickname- Author’s display nameavatar- URL to author’s avatar image
Voice Objects
id- Unique voice model identifier (use as reference_id in TTS)type- Model type. Options: “svc” (singing voice conversion), “tts” (text-to-speech)title- Voice model title/namedescription- Detailed description of the voice modelcover_image- URL to the voice model’s cover imagetrain_mode- Training mode used. Options: “fast”state- Current model state: “created”, “training”, “trained”, or “failed”tags- List of tags for categorization (e.g., [“male”, “english”, “young”])samples- List of audio samples demonstrating the voicecreated_at- Timestamp when the model was createdupdated_at- Timestamp when the model was last updatedlanguages- List of supported language codes (e.g., [“en”, “zh”])visibility- Model visibility. Options: “public”, “private”, “unlist”lock_visibility- Whether visibility setting is lockedlike_count- Number of likes the model has receivedmark_count- Number of bookmarks/favoritesshared_count- Number of times the model has been sharedtask_count- Number of times the model has been used for generationliked- Whether the current user has liked this model. Default: Falsemarked- Whether the current user has bookmarked this model. Default: Falseauthor- Information about the voice model’s creator
fishaudio.types.account
Account-related types (credits, packages, etc.).Credits Objects
id- Unique credits record identifieruser_id- User identifiercredit- Current credit balance (decimal for precise accounting)created_at- Timestamp when the credits record was createdupdated_at- Timestamp when the credits were last updatedhas_phone_sha256- Whether the user has a verified phone number. Optionalhas_free_credit- Whether the user has received free credits. Optional
Package Objects
id- Unique package identifieruser_id- User identifiertype- Package type identifiertotal- Total units in the packagebalance- Remaining units in the packagecreated_at- Timestamp when the package was purchasedupdated_at- Timestamp when the package was last updatedfinished_at- Timestamp when the package was fully consumed. None if still active
fishaudio.types.tts
TTS-related types.ReferenceAudio Objects
audio- Audio file bytes for the reference sampletext- Transcription of what is spoken in the reference audio. Should match exactly what’s spoken and include punctuation for proper prosody.
Prosody Objects
speed- Speech speed multiplier. Range: 0.5-2.0. Default: 1.0.Examples- 1.5 = 50% faster, 0.8 = 20% slowervolume- Volume adjustment in decibels. Range: -20.0 to 20.0. Default: 0.0 (no change). Positive values increase volume, negative values decrease it.
from_speed_override
speed- Speed value to usebase- Base prosody to preserve volume from (if any)
TTSConfig Objects
format- Audio output format. Options: “mp3”, “wav”, “pcm”, “opus”. Default: “mp3”sample_rate- Audio sample rate in Hz. If None, uses format-specific default.mp3_bitrate- MP3 bitrate in kbps. Options: 64, 128, 192. Default: 128opus_bitrate- Opus bitrate in kbps. Options: -1000, 24, 32, 48, 64. Default: 32normalize- Whether to normalize/clean the input text. Default: Truechunk_length- Characters per generation chunk. Range: 100-300. Default: 200. Lower values = faster initial response, higher values = better qualitylatency- Generation mode. Options: “normal” (higher quality), “balanced” (faster). Default: “balanced”reference_id- Voice model ID from fish.audio (e.g., “9a9cf47702da476aa4629e2506d4a857”). Find IDs in voice URLs or via voices.list()references- List of reference audio samples for instant voice cloning. Default: []prosody- Speech speed and volume settings. Default: None (uses natural prosody)top_p- Nucleus sampling parameter for token selection. Range: 0.0-1.0. Default: 0.7temperature- Randomness in generation. Range: 0.0-1.0. Default: 0.7. Higher = more varied, lower = more consistentmax_new_tokens- Maximum number of tokens to generate. Default: 1024repetition_penalty- Penalty for repeated tokens. Default: 1.2min_chunk_length- Minimum chunk length for generation. Default: 50condition_on_previous_chunks- Whether to condition generation on previous chunks. Default: Trueearly_stop_threshold- Threshold for early stopping. Default: 1.0
TTSRequest Objects
text- Text to synthesize into speechchunk_length- Characters per generation chunk. Range: 100-300. Default: 200format- Audio output format. Options: “mp3”, “wav”, “pcm”, “opus”. Default: “mp3”sample_rate- Audio sample rate in Hz. If None, uses format-specific defaultmp3_bitrate- MP3 bitrate in kbps. Options: 64, 128, 192. Default: 128opus_bitrate- Opus bitrate in kbps. Options: -1000, 24, 32, 48, 64. Default: 32references- List of reference audio samples for voice cloning. Default: []reference_id- Voice model ID for using a specific voice. Default: Nonenormalize- Whether to normalize/clean the input text. Default: Truelatency- Generation mode. Options: “normal”, “balanced”. Default: “balanced”prosody- Speech speed and volume settings. Default: Nonetop_p- Nucleus sampling for token selection. Range: 0.0-1.0. Default: 0.7temperature- Randomness in generation. Range: 0.0-1.0. Default: 0.7max_new_tokens- Maximum number of tokens to generate. Default: 1024repetition_penalty- Penalty for repeated tokens. Default: 1.2min_chunk_length- Minimum chunk length for generation. Default: 50condition_on_previous_chunks- Whether to condition generation on previous chunks. Default: Trueearly_stop_threshold- Threshold for early stopping. Default: 1.0
StartEvent Objects
event- Event type identifier, always “start”request- TTS configuration for the streaming session
TextEvent Objects
event- Event type identifier, always “text”text- Text chunk to synthesize
FlushEvent Objects
event- Event type identifier, always “flush”
CloseEvent Objects
event- Event type identifier, always “stop”
TTSTimestampSegment Objects
text- The text covered by this entry. Punctuation is not included, and languages written without spaces are split per character.start- Start time in secondsend- End time in seconds
TTSAlignment Objects
segments- Timing entries produced so far, with times measured from the start of the chunk’s audioaudio_duration- Seconds of the chunk’s audio rendered so far
TTSTimestampEvent Objects
audio
is the next piece of the audio file, while alignment is the newest timing
snapshot for the text chunk chunk_seq. Each snapshot replaces the earlier
one for the same chunk. The stream objects do this bookkeeping for you and
expose the result as segments.
Attributes:
audio- Next audio bytes. Join them in arrival order to get the complete audio. May be empty on a closing event that only corrects timings.content- Text of the chunk thatalignmentdescribes. Long input is split into several chunks.alignment- Newest timing snapshot for chunkchunk_seq, or None when there is none yet or the API cannot time this textchunk_seq- Index of the text chunk thatcontentandalignmentdescribechunk_audio_offset_sec- Where that chunk starts in the complete audio, in seconds
segments
TTSTimestampResult Objects
segments is empty and duration is None. Parts of
a long text can also be missing from segments for the same reason.
Attributes:
audio- Complete audio as bytessegments- Timing entries (usually words) in speaking order, with times in seconds from the start ofaudio. Empty when the API returned no timings.duration- Length ofaudioin seconds as reported by the API, or None when the API did not report it. The API reports it together with the timings, so it is None when the end of the audio has no timings. It is never measured fromaudio; decode the audio if you need its length in that case.
fishaudio.types.shared
Shared types used across the SDK.PaginatedResponse Objects
total- Total number of items across all pagesitems- List of items on the current page
warn_if_deprecated_model
fishaudio.types.asr
ASR (Automatic Speech Recognition) related types.ASRSegment Objects
text- The transcribed text for this segmentstart- Segment start time in secondsend- Segment end time in seconds
SpeakerTurn Objects
speaker- Speaker label (e.g., “speaker:0”). Labels identify speakers within one response onlytext- What the speaker said in this turn, without inline speaker markersstart- Turn start time in secondsend- Turn end time in seconds
ASRResponse Objects
text- Complete transcription of the entire audioduration- Total audio duration in secondssegments- List of timestamped text segments. Empty if include_timestamps=Falselanguage- Display name of the transcript’s language (e.g., “English”). None if not returnedlanguage_code- Language code of the transcript (e.g., “en”): the detected language, or the requested language if none was detected. None if not returnedrequest_id- Identifier of this request; quote it when reporting a problem with the request. None if not returnedspeaker_turns- Speaker turns in order, with times in seconds. Returned only by models with speaker diarization, and only if include_timestamps=True; empty if no speech was found. None otherwise
duration
Duration in secondsfishaudio.types.asr_realtime
Types for realtime speech-to-text (/v1/asr/realtime).
ASRTurnDetection Objects
configure.
Attributes:
mode- “auto” (default): the server judges when the user has finished and tells user turns from noise and other voices. “vad”: a turn ends after silence_timeout_ms of silence. “manual”: a turn ends when you send finalizeeager- Send eager_end_of_turn events (auto mode only). Server default: Falsesilence_timeout_ms- Silence that ends a turn. auto: default 5000, allowed 3000-60000. vad: default 700, allowed 300-60000. manual: default 60000, allowed 300-60000
ASRResults Objects
configure.
Attributes:
drafts- Send live draft events. Server default: Falseignore_timestamps- False adds word timings to committed events. Server default: Truediarize- Speaker tags such as<|speaker:0|>in the text. Server default: Truetag_audio_events- Sound tags such as[laughter]in the text. Server default: Truevad_events- Send vad events (voice activity, up to 10 per second). Server default: Falseeot_events- Send eot_prob events (end-of-turn likelihood). Server default: False
ASRContextItem Objects
role- Who said it: “user” or “assistant”text- What was said (up to 2000 characters)
ASRContext Objects
history- Earlier conversation, oldest first (up to 32 items). Only accepted at session start; add lines later with context_addterms- Names, products and jargon to recognize (up to 100 terms of up to 32 characters)
ASRRealtimeConfig Objects
sample_rate- Sample rate of the audio you send, in Hz: 8000, 12000, 16000, 22050, 24000, 32000, 44100 or 48000. The server converts these rates to 16000, so audio at one of them needs no resampling. Default: 16000turn_detection- Turn detection settings. Default: None (server defaults)results- Result settings. Default: None (server defaults)context- Conversation history and custom vocabulary. Default: Noneclient_reference_id- Your own ID for the session (up to 256 characters). Recorded with the session; not sent back. Default: None
ASRFinalizeEvent Objects
type- Message type identifier, always “finalize”
ASRAgentSpeakingEvent Objects
type- Message type identifier, always “agent_speaking”speaking- True when you commit to playing a reply; False when its last sample has played or you stop it
ASRContextAddEvent Objects
type- Message type identifier, always “context_add”items- Conversation items, oldest first (up to 32)reset_history- First drop the items you added before. Default: False
ASRConfigureEvent Objects
type- Message type identifier, always “configure”turn_detection- Turn detection changes; omitted fields keep their valuesresults- Result changes; omitted fields keep their valuescontext- Onlytermsis accepted here; it replaces the list of terms
ASRKeepaliveEvent Objects
type- Message type identifier, always “keepalive”
ASRWord Objects
text- The wordstart_ms- Where the word starts, in milliseconds of session audioend_ms- Where the word ends, in milliseconds of session audio
ASRSessionStartedEvent Objects
type- Event type identifier, always “session_started”seq- Sequence number, increasing by one per server messagesession_id- The session’s IDrequest_id- Identifier of this request; quote it when reporting a problemconfig- The configuration in effect, with defaults filled inlimits- Session limits (max_session_ms, max_turn_ms, max_frame_bytes)
ASRSpeechStartEvent Objects
type- Event type identifier, always “speech_start”seq- Sequence numberturn_index- The turn that opened, counting from 0audio_ms- Where the turn starts, slightly before the speech
ASRUserTurnTakenEvent Objects
type- Event type identifier, always “user_turn_taken”seq- Sequence numberturn_index- The turn the user tookaudio_ms- Where the server judged that the user took the turn
ASRDraftEvent Objects
drafts=True). Not final.
Attributes:
type- Event type identifier, always “draft”seq- Sequence numberturn_index- The open turntext- The whole turn so far. Replaces the previous draftsettled_text- The beginning of text that the server is confident will not change. Often emptylanguage- English name of the detected language. None if not identifiedlanguage_code- ISO 639-1 code of the detected language. None if not identifiedaudio_ms- The audio position the draft covers up toaudio_received_ms- Audio received so faraudio_processed_ms- Audio processed so faraudio_committed_ms- Audio covered by committed turns so far
ASREagerEndOfTurnEvent Objects
eager=True).
Start preparing your response; a turn_resumed event cancels it.
Attributes:
type- Event type identifier, always “eager_end_of_turn”seq- Sequence numberturn_index- The turn that probably endedtext- Exactly what committed will say unless turn_resumed follows. Can be emptylanguage- English name of the detected language. None if not identifiedlanguage_code- ISO 639-1 code of the detected language. None if not identifiedaudio_ms- The audio position of the signal
ASRTurnResumedEvent Objects
type- Event type identifier, always “turn_resumed”seq- Sequence numberturn_index- The turn that resumed
ASRUserBackchannelEvent Objects
type- Event type identifier, always “user_backchannel”seq- Sequence numberturn_index- The open turn, or the index the next turn will getaudio_ms- Where the acknowledgement is in the audio
ASRCommittedEvent Objects
type- Event type identifier, always “committed”seq- Sequence numberturn_index- The turn that endedtext- The final transcript. Can contain speaker tags such as<|speaker:0|>and sound tags such as[laughter]. Can be emptywords- Word timings. Only withignore_timestamps=False; None otherwiselanguage- English name of the detected language. None if not identifiedlanguage_code- ISO 639-1 code of the detected language. None if not identifiedaudio_start_ms- Where the turn starts in the session audioaudio_end_ms- Where the turn ends in the session audioreason- Why the turn ended: “eot”, “finalize”, “silence_timeout”, “max_turn_duration” or “audio_done”. Treat an unknown value like “eot”degraded- True when the final pass failed and the text comes from the last draftuser_turn- True for the user’s turn. Decide whether to answer by this fieldturn_kind- “user”, “backchannel” or “other”audio_received_ms- Audio received so faraudio_processed_ms- Audio processed so faraudio_committed_ms- Audio covered by committed turns so far
ASRVadEvent Objects
vad_events=True), up to 10 per second.
Attributes:
type- Event type identifier, always “vad”seq- Sequence numberaudio_ms- The audio position of the scorescore- Voice activity, from 0 to 1
ASREotProbEvent Objects
eot_events=True).
Attributes:
type- Event type identifier, always “eot_prob”seq- Sequence numberturn_index- The open turnaudio_ms- The audio position of the estimateprob- End-of-turn likelihood, from 0 to 1
ASRConfiguredEvent Objects
type- Event type identifier, always “configured”seq- Sequence numberok- False means nothing changedconfig- The configuration in effectmessage- Why the change was refused, in English. None when ok is True
ASRProgressEvent Objects
type- Event type identifier, always “progress”seq- Sequence numberaudio_received_ms- Audio received so faraudio_processed_ms- Audio processed so faraudio_committed_ms- Audio covered by committed turns so far
ASRErrorEvent Objects
server_restarting,
which the server follows by closing the connection (raised as ASRRealtimeError
with close code 1012).
Other errors that end the session are raised as ASRRealtimeError instead.
Attributes:
type- Event type identifier, always “error”seq- Sequence numbercode- HTTP-style statuserror_type- Machine-readable error type, e.g. “invalid_request”. Match on thismessage- A short English description, for humansrequest_id- Identifier of this request; quote it when reporting a problemrecoverable- True when the error does not end the session by itself
ASRSessionStats Objects
audio_ms- Audio received in the sessionturns- Every committed turn, user turn or notrequest_id- Identifier of this request
ASRSessionDoneEvent Objects
type- Event type identifier, always “session_done”seq- Sequence numberstats- Totals for the session

