Skip to content
API referenceValidate a routing config

Validate a routing config

POST/v1/configs/validate

Validate a routing config.

Checks a config without saving it, with the same rules as create and update, and answers whether it is valid. Problems are reported with a 200 and valid: false, not as an error status: errors then holds one entry whose message lists each problem with its path.

The rules:

  • At least one target; a CONDITIONAL strategy needs at least one condition.
  • Each target is either a leaf (virtual_key_slug) or a nested strategy (strategy_mode with its own targets), never both and never neither. Strategies nest at most 3 levels below the top.
  • weight, when set, is greater than 0; retry.attempts is from 1 to 10.
  • override_params: temperature 0 to 2, top_p 0 to 1, max_tokens at least 1, frequency_penalty and presence_penalty -2 to 2, seed at least 0.
  • Every condition's then_target_name names a target at its level; in a nested CONDITIONAL target, conditional_default_target_name names one of its targets too.
  • A condition's query is not empty and uses only metadata.* and params.* fields (params.model, temperature, max_tokens, top_p, stream), the operators $eq, $ne, $gt, $gte, $lt, $lte, $in, $nin, $regex and $exists, and $and / $or arrays of such queries.
  • Every virtual key exists in organization and is not EXPIRED. A key of another organization is reported exactly as one that does not exist.

Requires membership of organization, or of the workspace named by workspace_id; anyone else gets 403. A body without organization is a 400.

Authorization

  • AuthorizationBearer va_

    A platform API key (va_...), created under Settings > API keys. Scoped to an organization or one workspace, with an admin or member role. Used by the management API.

Request body application/json

the config to check

  • organizationstringrequired

    The organization slug the config's virtual keys must belong to. Required.

  • strategy_modeenum<string>required

    The strategy: SINGLE, LOADBALANCE, FALLBACK or CONDITIONAL. Required.

    One of "SINGLE", "LOADBALANCE", "FALLBACK", "CONDITIONAL"

  • targetsobject[]required

    The targets. At least one. Required.

    Child attributes
    • namestring

      The target's name, which conditions and conditional_default_target_name refer to. Optional otherwise.

    • virtual_key_slugstring

      For a virtual key target: the key's slug. The key must belong to the config's organization and not be EXPIRED. Requests to this target use the key's provider credential.

    • weightnumber<double>

      For LOADBALANCE: the target's share of requests, relative to its siblings. Greater than 0. Default 1.

    • order_indexinteger<int32>

      The target's position among its siblings, which sets the FALLBACK order and which target SINGLE uses. Absent: its position in the list.

    • strategy_modeenum<string>

      For a nested strategy target: how it picks among its own targets: SINGLE, LOADBALANCE, FALLBACK or CONDITIONAL.

      One of "SINGLE", "LOADBALANCE", "FALLBACK", "CONDITIONAL"

    • on_status_codesinteger<int32>[]

      For a nested FALLBACK target: the provider HTTP statuses that move on to its next target. Empty or absent: 429, 500, 502, 503 and 504.

    • conditional_default_target_namestring

      For a nested CONDITIONAL target: the name of one of its targets, used when no condition matches.

    • conditionsobject[]

      For a nested CONDITIONAL target (at least one required): the rules that pick one of its targets.

      Child attributes
      • condition_orderinteger<int32>required

        The rule's position: lower numbers are tried first. Required.

      • querymap<string, object>required

        What the request must match, as a JSON object of field paths to operator objects, all of which must hold, e.g. {"metadata.tier": {"$eq": "premium"}}. Required and not empty.

        • Fields: metadata. followed by a key of the JSON object in the request's x-metadata header, and params.model, params.temperature, params.max_tokens, params.top_p, params.stream (an omitted stream is false).
        • Operators: $eq, $ne, $gt, $gte, $lt, $lte (numbers), $in, $nin (arrays), $regex (case-insensitive, must match the whole value) and $exists (true or false).
        • $and and $or take an array of such objects.
      • then_target_namestringrequired

        The name of the target, at the same level as this rule, that a matching request goes to. Required.

    • override_paramsobject

      Request parameters a routing target sets on the requests it receives, in place of the caller's. A field left out keeps the caller's value. model, temperature, max_tokens, top_p and stop are applied; the other fields are validated and stored but not applied at present.

      Child attributes
      • modelstring

        The model to call instead of the request's, e.g. gpt-4o-mini.

      • temperaturenumber<double>

        The sampling temperature, from 0 to 2.

      • max_tokensinteger<int32>

        The most tokens to generate; at least 1.

      • top_pnumber<double>

        Nucleus sampling, from 0 to 1.

      • frequency_penaltynumber<double>

        From -2 to 2. Stored, not applied at present.

      • presence_penaltynumber<double>

        From -2 to 2. Stored, not applied at present.

      • stopstring[]

        Stop sequences; a non-empty list replaces the request's.

      • seedinteger<int32>

        A sampling seed, at least 0. Stored, not applied at present.

      • response_format_typeenum<string>

        json_object, text or json_schema. Accepted, but neither applied nor returned at present.

        One of "json_object", "text", "json_schema"

    • cacheobject

      Response cache settings stored with a routing config or target. Requests served through a routing config are not answered from the response cache at present.

      Child attributes
      • modestring

        The cache mode: simple (exact match) or semantic. Absent: none.

      • max_age_secondsinteger<int32>

        How long a cached answer stays valid, in seconds. Absent: none.

    • retryobject

      Retries for a routing target's provider calls. A failed call with a listed status is tried again after 1, 2, 4, ... seconds (at most 16), until attempts calls have been made.

      Child attributes
      • attemptsinteger<int32>required

        How many calls to make in all, the first one included (1 means no retry). From 1 to 10. Required.

      • on_status_codesinteger<int32>[]

        The provider HTTP statuses to retry. Empty or absent: 429, 500, 502, 503 and 504.

    • request_timeout_msinteger<int32>

      For a virtual key target: the time limit for each call to its provider, in milliseconds. A call that takes longer fails. Absent: no limit of its own.

  • workspace_idstring<uuid>

    The workspace the config is for (UUID). Optional: a member of that workspace (or a key scoped to it) may validate with it; without it the caller must be a member of the organization.

  • conditionsobject[]

    For CONDITIONAL (at least one required): the rules that pick a target.

    Child attributes
    • condition_orderinteger<int32>required

      The rule's position: lower numbers are tried first. Required.

    • querymap<string, object>required

      What the request must match, as a JSON object of field paths to operator objects, all of which must hold, e.g. {"metadata.tier": {"$eq": "premium"}}. Required and not empty.

      • Fields: metadata. followed by a key of the JSON object in the request's x-metadata header, and params.model, params.temperature, params.max_tokens, params.top_p, params.stream (an omitted stream is false).
      • Operators: $eq, $ne, $gt, $gte, $lt, $lte (numbers), $in, $nin (arrays), $regex (case-insensitive, must match the whole value) and $exists (true or false).
      • $and and $or take an array of such objects.
    • then_target_namestringrequired

      The name of the target, at the same level as this rule, that a matching request goes to. Required.

  • on_status_codesinteger<int32>[]

    For FALLBACK: the statuses that move on to the next target. Not checked.

  • conditional_default_target_namestring

    For CONDITIONAL: the target used when no condition matches. Not checked at this level.

  • cacheobject

    Response cache settings stored with a routing config or target. Requests served through a routing config are not answered from the response cache at present.

    Child attributes
    • modestring

      The cache mode: simple (exact match) or semantic. Absent: none.

    • max_age_secondsinteger<int32>

      How long a cached answer stays valid, in seconds. Absent: none.

  • retryobject

    Retries for a routing target's provider calls. A failed call with a listed status is tried again after 1, 2, 4, ... seconds (at most 16), until attempts calls have been made.

    Child attributes
    • attemptsinteger<int32>required

      How many calls to make in all, the first one included (1 means no retry). From 1 to 10. Required.

    • on_status_codesinteger<int32>[]

      The provider HTTP statuses to retry. Empty or absent: 429, 500, 502, 503 and 504.

Responses

200application/json
  • validboolean

    True when the config would be accepted by create and update.

  • errorsobject[]

    Empty when valid is true; otherwise one entry listing the problems.

    Child attributes
    • pathstring

      Where the problem is. Currently always request: the message carries each problem's own path.

    • messagestring

      The problems, each as [path] message and separated by ; , e.g. [targets[0].weight] Weight must be greater than 0.

NVIDIA Inception Program member

VectorAxis is built by GK Labs, a member of NVIDIA Inception.