Skip to main content
GET /api/v1/hub/models returns available models, their parameter schemas, and prices for your account.
Each model includes:
  • id: the value to send as model;
  • parameters_schema: the JSON schema for the input object;
  • input_modalities and output_modalities: accepted and produced media types;
  • pricing_tiers: media price tiers;
  • input_cost_per_million and output_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.
The kind of a text model is given by 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 at price_per_audio_second, in EUR for your account; they have no input_cost_per_million or output_cost_per_million. See Transcriptions.
Embeddings and transcription amounts are rounded up to six decimal places: a call with a non-zero cost is never billed €0.
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 of duration.
  • price_usd_per_second_of: price per second of an input video or audio, see below.
  • Otherwise, price = price_usd (base, 0 when absent) + each per_unit term (unit price × quantity measured in the input).
  • A zero total gives no price: a generation is never free.
A 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.
The Hub computes the invoice, and /pricing is authoritative. A client that ignores per_unit only reads the base: its estimate is lower than the billed price. Always estimate with the route below.

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:
The price is rate_usd × the billed seconds:
  1. the durations of the files referenced in the input key field are added up;
  2. min_seconds (optional) raises the total to this minimum, max_seconds (optional) caps it;
  3. step_seconds (optional) rounds it up to a multiple of the step.
A 7.6 s video with this tier is billed 8 s: 8 × 0.08 = €0.64. A 2 s video is billed 3 s; a 42 s video, if the model accepts it, 30 s. The Hub bills on the duration it measured on the file, never on a declared duration. Upload the file with 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 a within 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.
A client that does not know within reads the condition as false and may display the price of another tier. The Hub invoice stays exact: always confirm with /pricing.

Estimate a generation

Send the same input object that you would use for a generation:
The price remains an estimate until settlement. The final generation response contains 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_durations has at most 64 entries; each value is a number of seconds greater than 0 and at most 86,400. Otherwise: 400 invalid_input with errors.media_durations.
  • POST /api/v1/hub/generations never reads a declared duration: upload the file, the generation is billed on the measured duration.