Skip to content

Requests

requests

Defines Pydantic request models for the API's endpoints

Model selection
  • LLM requests have a model selector in provider:model form (e.g. "openai:gpt-4.1-mini")
LLM Request Defaults
  • sys_msg / prompt are optional

  • When omitted the server falls back to its default system message and prompt

SubmitBatchRequest = Annotated[BatchGenerateSrtJobRequest | BatchTranscribeJobRequest | BatchConvertJobRequest | BatchFixSrtJobRequest, Field(discriminator='type')] module-attribute

The body of a POST /jobs/batch request

A discriminated union keyed by the parent job's type attribute, so that each batch operation's shared opts are validated against their own model. The parent fans the shared options out to one child job per file_id

SubmitJobRequest = Annotated[GenerateSrtJobRequest | TranscribeJobRequest | ConvertJobRequest | FixSrtJobRequest, Field(discriminator='type')] module-attribute

The body of a POST /jobs request

A discriminated union keyed by a persisted job's type attribute, so that each operation's opts are validated against their own model

BatchConvertJobRequest

Bases: BatchSubmitBase

Submission for a batch_convert job

Parameters:

Name Type Description Default
type Literal['batch_convert']

The operation discriminator

required
opts ConvertVideoRequest

Conversion options shared by every file in the batch

required

child_params(file_id)

Builds one child job's params, matching the single-op shape

Parameters:

Name Type Description Default
file_id str

The profile file this child operates on

required

Returns:

Type Description
dict[str, Any]

The file reference and shared conversion options

child_type()

The single-op type stored on each per-file child job

Returns:

Type Description
str

The discriminator the child shares with its single-op handler

to_params()

Builds the persisted parent job's params

Returns:

Type Description
dict[str, Any]

The file references and shared conversion options

BatchFixSrtJobRequest

Bases: BatchSubmitBase

Submission for a batch_fix_srt job

Parameters:

Name Type Description Default
type Literal['batch_fix_srt']

The operation discriminator

required
model str

LLM model selector in provider:model form

required
sys_msg str | None

Optional LLM system message shared by every file

required

child_params(file_id)

Builds one child job's params, matching the single-op shape

Parameters:

Name Type Description Default
file_id str

The profile file this child operates on

required

Returns:

Type Description
dict[str, Any]

The file reference, model selector, and optional system message

child_type()

The single-op type stored on each per-file child job

Returns:

Type Description
str

The discriminator the child shares with its single-op handler

to_params()

Builds the persisted parent job's params

Returns:

Type Description
dict[str, Any]

The file references, model selector, and optional system message

BatchGenerateSrtJobRequest

Bases: BatchSubmitBase

Submission for a batch_generate_srt job

Parameters:

Name Type Description Default
type Literal['batch_generate_srt']

The operation discriminator

required
opts GenerateSrtRequest

Curated transcription options shared by every file in the batch

required

child_params(file_id)

Builds one child job's params, matching the single-op shape

Parameters:

Name Type Description Default
file_id str

The profile file this child operates on

required

Returns:

Type Description
dict[str, Any]

The file reference and shared transcription options

child_type()

The single-op type stored on each per-file child job

Returns:

Type Description
str

The discriminator the child shares with its single-op handler

to_params()

Builds the persisted parent job's params

Returns:

Type Description
dict[str, Any]

The file references and shared transcription options

BatchSubmitBase

Bases: BaseModel

Shared fields for every batch job submission request

Parameters:

Name Type Description Default
file_ids list[str]

The profile files the batch operates on, one child job per file (at least one)

required

BatchTranscribeJobRequest

Bases: BatchSubmitBase

Submission for a batch_transcribe job

Parameters:

Name Type Description Default
type Literal['batch_transcribe']

The operation discriminator

required
opts TranscribeAudioRequest

clean_audio + curated transcription options shared by every file in the batch

required

child_params(file_id)

Builds one child job's params, matching the single-op shape

Parameters:

Name Type Description Default
file_id str

The profile file this child operates on

required

Returns:

Type Description
dict[str, Any]

The file reference and shared transcription options

child_type()

The single-op type stored on each per-file child job

Returns:

Type Description
str

The discriminator the child shares with its single-op handler

to_params()

Builds the persisted parent job's params

Returns:

Type Description
dict[str, Any]

The file references and shared transcription options

BreakdownRequest

Bases: BaseModel

Request for the /llm/breakdown endpoint

Parameters:

Name Type Description Default
sentence str

The sentence containing the focus word

required
focus str | None

The word to explain in context

required
model str

Model selector in provider:model form

required
sys_msg str | None

Optional custom system message

required
prompt str | None

Optional custom prompt template ({0} = sentence, {1} = focus)

required

ChatRequest

Bases: BaseModel

Request for the streaming /llm/stream chat endpoint

Parameters:

Name Type Description Default
prompt str

The user prompt

required
model str

Model selector in provider:model form

required
system_message str | None

Optional system message

required

ConvertJobRequest

Bases: SubmitJobBase

Submission for a convert job

Parameters:

Name Type Description Default
type Literal['convert']

The operation discriminator

required
opts ConvertVideoRequest

Conversion options

required

to_params()

Builds the persisted job's stored params

Returns:

Type Description
dict[str, Any]

The file reference and normalised conversion options

ConvertVideoRequest

Bases: BaseModel

Options for /video/convert_to_mp4

Parameters:

Name Type Description Default
resolution str

Maximum output size WxH (aspect preserved)

required
target_bitrate str

Video bitrate ceiling

required
preset Literal

Encoder speed / quality preset, one of performance, balanced, quality

required

ExplainSentenceRequest

Bases: BaseModel

Request for the /llm/explain_sentence endpoint

Parameters:

Name Type Description Default
sentence str

The sentence to explain

required
model str

Model selector in provider:model form

required
sys_msg str | None

Optional custom system message

required
prompt str | None

Optional custom prompt template ({0} = sentence)

required

FixSrtJobRequest

Bases: SubmitJobBase

Submission for a fix_srt job

Parameters:

Name Type Description Default
type Literal

The operation discriminator

required
model str

LLM model selector in provider:model form

required
sys_msg str | None

Optional LLM system message

required

to_params()

Builds the persisted job's params attribute

Returns:

Type Description
dict[str, Any]

The file reference, model selector, and optional system message

GenerateSrtJobRequest

Bases: SubmitJobBase

Submission for a generate_srt job

Parameters:

Name Type Description Default
type Literal['generate_srt']

The operation discriminator

required
opts GenerateSrtRequest

Curated transcription options

required

to_params()

Builds the persisted job's params attribute

Returns:

Type Description
dict[str, Any]

The file reference and normalised transcription options

GenerateSrtRequest

Bases: TranscribeOptions

Options for /video/generate_srt

Inherits the curated transcription options unchanged

LlmTemplateRequest

Bases: BaseModel

Request for upserting a profile's LLM template

Parameters:

Name Type Description Default
sys_msg str

System message

required
prompt str

Prompt template

required
model str

Model selector in provider:model form

required
srt_sys_msg str

Subtitle-fix system message (empty = server default)

required
srt_model str

Subtitle-fix model override (empty = use model)

required

SaveSubtitlesRequest

Bases: BaseModel

Request for persisting SRT content to the active profile (POST /profiles/subtitles)

Replace vs Create
  • When file_id references an existing SRT file owned by the profile, that file's content is overwritten in place (same id / path)

  • Otherwise a new SRT file is created under the profile

Parameters:

Name Type Description Default
content str

The SRT content to store

required
file_id str | None

Existing SRT file id to overwrite, if any

required
name str | None

Optional file name for a newly created file

required

SubmitJobBase

Bases: BaseModel

Shared fields for every job submission request

Parameters:

Name Type Description Default
file_id str

The profile file that the job operates on

required

TokenizeBatchRequest

Bases: BaseModel

Request for the batch tokenize endpoint (POST /dict/tokenize)

Parameters:

Name Type Description Default
sentences list[str]

The sentences to tokenize, in order

required
mode BundleMode

How aggressively to group tokens into words

required

TranscribeAudioRequest

Bases: TranscribeOptions

Options for /audio/transcribe

Parameters:

Name Type Description Default
clean_audio bool

Apply a band-pass + loudness filter before transcription

required

TranscribeJobRequest

Bases: SubmitJobBase

Submission for a transcribe job

Parameters:

Name Type Description Default
type Literal['transcribe']

The operation discriminator

required
opts TranscribeAudioRequest

clean_audio + curated transcription options

required

to_params()

Builds the persisted job's params attribute

Returns:

Type Description
dict[str, Any]

The file reference and normalised transcription options

TranscribeOptions

Bases: BaseModel

Curated, query-param-friendly transcription options for faster_whisper

Curation
  • Only scalar faster_whisper transcribe options that tune quality and filtering are exposed

  • Options that would change the segment structure (.start / .end / .text) or the assumption that media is transcribed (not translated) in the chosen language are deliberately omitted (e.g. task, without_timestamps)

  • Unset (None) fields fall back to mirumoji.server.processing.whisper.DEFAULT_TRANSCRIBE_OPTS

Parameters:

Name Type Description Default
language str

Language code to transcribe in

required
beam_size int | None

Beam size for decoding

required
best_of int | None

Number of candidates when sampling

required
patience float | None

Beam-search patience factor

required
length_penalty float | None

Exponential length penalty

required
temperature float | None

Sampling temperature

required
compression_ratio_threshold float | None

Gzip compression-ratio threshold above which output is treated as failed

required
log_prob_threshold float | None

Average log-probability threshold below which output is treated as failed

required
no_speech_threshold float | None

No-speech probability threshold

required
condition_on_previous_text bool | None

Feed prior text as context

required
initial_prompt str | None

Optional text to bias the first window

required
vad_filter bool | None

Apply voice-activity-detection filtering

required