preset field in your request body.
The five routing flavors
Each flavor applies a different weighting across three dimensions: price, speed, and environmental impact. Meliai scores every candidate provider against these weights and routes to the winner.How to choose a flavor
Method 1: Suffix the model ID
Append:flavor directly to the model ID in your request. This is the simplest and most portable approach — it works with any OpenAI- or Anthropic-compatible client without any custom parameters.
Method 2: Use the preset field
Pass a preset value in the request body to hint at the type of workload. Accepted values are "reasoning" and "non_reasoning". Meliai uses this to further refine provider selection within the active flavor.
If you specify both a model-ID suffix and a
preset field, the suffix takes precedence. For example, model: "qwen/qwen3-235b-a22b:price" with preset: "reasoning" routes using the price flavor.Automatic failover
If a provider returns an error or exceeds its response-time threshold, Meliai automatically retries with the next-best provider according to the active flavor’s scoring. This happens transparently — your client receives a single response with no visible retry logic. To see which provider ultimately served your request, inspect theenvironment_impact.provider_id and environment_impact.location fields in the response:
INFERENCE_3103. This is rare; check the status page if you encounter it repeatedly.