GET /api/v1/hub/models returns available models, their parameter schemas, and prices for your account.
id: the value to send asmodel;parameters_schema: the JSON schema for theinputobject;input_modalitiesandoutput_modalities: accepted and produced media types;pricing_tiers: media price tiers;input_cost_per_millionandoutput_cost_per_million: text, decision, and embeddings model rates, per million tokens;price_per_audio_second: transcription model rate, per second of audio. Present only on transcription models.
output_modalities, and each kind has its own route:
These models have
is_llm: true; pricing_tiers does not apply to them. On the chat, decisions, embeddings and transcriptions routes, a model of another kind is refused with 400 invalid_input; POST /api/v1/hub/generations also refuses embeddings and transcription models.
- Decision models (
["decisions"]): each request is billed from its input and output tokens at the two rates: output tokens are often free, but always read both rates. See Decisions. - Embeddings models (
["embeddings"], input["text"]): billed per input token. See Embeddings. - Transcription models (
["transcription"], input["audio"]): billed per second of audio atprice_per_audio_second, in EUR for your account; they have noinput_cost_per_millionoroutput_cost_per_million. See Transcriptions.
Tier fields retain the name
price_usd, but currency is EUR and always defines the actual unit.Read the price tiers
pricing_tiers is a list of tiers. Illustrative example, not an actual rate:
Tier selection
1
First matching tier
The first tier whose
match conditions are all true applies. A condition compares a top-level input key with a value, requires it to be filled with {"op": "present"}, or requires its files to fit a duration range with {"op": "within", …} (duration zones).2
Default tier
Otherwise, the first tier with an empty
match applies. Failing that, the first tier in the list.Tier price
price_usd_per_second: price per second ofduration.price_usd_per_second_of: price per second of an input video or audio, see below.- Otherwise, price =
price_usd(base, 0 when absent) + eachper_unitterm (unit price × quantity measured in theinput). - A zero total gives no price: a generation is never free.
per_unit term names a top-level input key (of) and a unit (unit):
With the first tier of the example, two references and a 500-character prompt cost 0.012 + 2 × 0.01 + 500 × 0.000004 = €0.034.
Price per second of an input file
Some models (for example motion control or video editing) are billed on the duration of a video or audio you send. Illustrative example, not an actual rate:rate_usd × the billed seconds:
- the durations of the files referenced in the
inputkeyfieldare added up; min_seconds(optional) raises the total to this minimum,max_seconds(optional) caps it;step_seconds(optional) rounds it up to a multiple of the step.
POST /api/v1/hub/files and reference it as sha256:<hash> (Files): the upload response gives the measured duration_seconds. The Hub reads the duration of MP4, MOV, WebM (with a duration), WAV and MP3 files; it never downloads a URL from another site. A file whose duration is unknown is refused with 422 input_duration_unavailable, a duration outside the model’s limits with 422 input_duration_out_of_bounds: nothing is billed.
min_seconds, max_seconds, and step_seconds can be added to existing tiers. A client that ignores them under-estimates; the Hub invoice stays exact.Reference plus output duration
Some providers bill the reference video and the generated video at the same rate.price_usd_per_second_of is then a list of components, added up at a single rate_usd. Illustrative example, not an actual rate:
Each component applies its own
min_seconds, max_seconds, and step_seconds. A 4.2 s reference video and "duration": 5 give (4.2 + 5) × 0.075 = €0.69.
Duration zones
When the price depends on how long the files are, a tier selects a duration range with awithin condition. The condition is true when the key is filled and every limit holds:
The same keys can appear in
x-fanify-media of a field in parameters_schema: they are the input limits of the model. x-fanify-media can also hold conditional, a list of { "when": { "path", "op", "value" }, <limits> } that apply only when the condition holds on the input (for example 10 s at most when character_orientation is image). A request outside these limits is refused with 400 invalid_input.
Estimate a generation
Send the sameinput object that you would use for a generation:
billed_cost.
Estimate before uploading a file
For a model priced on the duration of an input file,/pricing uses the duration measured on the files the Hub already has. To quote a file you have not uploaded yet, declare its duration in media_durations, keyed by the reference written in input:
- A declared duration only serves the estimate: it is ignored for a file the Hub already has (its measured duration applies) and for a URL from another site (
422 input_duration_unavailable). media_durationshas at most 64 entries; each value is a number of seconds greater than 0 and at most 86,400. Otherwise:400 invalid_inputwitherrors.media_durations.POST /api/v1/hub/generationsnever reads a declared duration: upload the file, the generation is billed on the measured duration.
