pai
    Preparing search index...

    Type Alias RoutePolicy

    A key's route policy, as the server stores and validates it.

    type RoutePolicy = {
        applies_to?: "auto" | "all";
        fallback_on_error?: boolean;
        models: string[];
        on_empty?: "stop" | "cheapest";
        rules?: RouteRule[];
        stick_by_prompt?: boolean;
        stick_minutes?: number;
    }
    Index
    applies_to?: "auto" | "all"

    auto routes only requests for model auto; all routes every request. Default auto.

    fallback_on_error?: boolean

    When true, the other models in models are tried if the picked one fails. Default false.

    models: string[]

    The models routing may pick from. The first is the default for auto.

    on_empty?: "stop" | "cheapest"

    When the key's cap for the period is used up: stop refuses requests, cheapest keeps running on the cheapest model in models. Default stop.

    rules?: RouteRule[]

    Rules checked in order. The first that matches picks the model.

    stick_by_prompt?: boolean

    When true, a conversation without an x-phantom-session header is recognised by its opening messages. false: only the header counts. Default true.

    stick_minutes?: number

    Minutes a conversation stays on the model it started on after its last request, so its prompt cache stays warm. 0 turns it off. Default 5.