Skip to content
API referenceUpdate a routing config

Update a routing config

PUT/v1/configs/{slug}

Update a routing config.

Changes the config. name, description, strategy_mode, conditional_default_target_name, cache, retry and request_timeout_ms change when present and are kept when left out. on_status_codes is replaced on every update: leaving it out resets it to the default statuses.

targets is required: the update validates the config (as "Validate a routing config") and replaces the whole target tree, and the conditions with it, by what you send. Send the full tree each time.

Requires an organization admin key, or a workspace admin key for the config's workspace.

Errors: 403 without the required role; 404 when the organization has no config with this slug; 422 when the config is not valid, including when targets is missing or empty.

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.

Path parameters

  • slugstringrequired

    the config's slug

Query parameters

  • organizationstringrequired

    the organization slug

Request body application/json

the fields to change

  • namestring

    The config's new name. Left out: unchanged. The slug does not change.

  • descriptionstring

    The new description. Left out: unchanged.

  • strategy_modeenum<string>

    The new strategy: SINGLE, LOADBALANCE, FALLBACK or CONDITIONAL (see "Create a routing config"). Left out: unchanged.

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

  • on_status_codesinteger<int32>[]

    For FALLBACK: the provider HTTP statuses that move a request on to the next target. Replaced on every update: left out or empty, the default (429, 500, 502, 503 and 504) applies.

  • conditional_default_target_namestring

    For CONDITIONAL: the target used when no condition matches. Left out: unchanged.

  • targetsobject[]

    The complete new list of targets, which replaces the old tree. Required, at least one.

    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.

  • conditionsobject[]

    For CONDITIONAL: the complete new list of conditions, replaced together with targets. Left out: the config has no conditions.

    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.

  • 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>

    A time limit in milliseconds, stored with the config (see "Create a routing config"). Left out: unchanged.

Responses

200application/json
  • idstring<uuid>

    The config's id (UUID).

  • slugstring

    The config's slug: send it in the x-config header, and use it to manage the config.

  • namestring

    The config's name, unique within the organization.

  • descriptionstring

    A free-text description. Absent when none was set.

  • organizationstring

    The slug of the organization the config belongs to.

  • workspace_idstring<uuid>

    The workspace the config belongs to (UUID).

  • strategy_modeenum<string>

    How a request picks among targets: SINGLE (the first), LOADBALANCE (at random, by weight), FALLBACK (in order, moving on at a status in on_status_codes) or CONDITIONAL (by conditions).

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

  • on_status_codesinteger<int32>[]

    For FALLBACK: the statuses that move on to the next target. Absent: 429, 500, 502, 503 and 504.

  • conditional_default_target_namestring

    For CONDITIONAL: the target used when no condition matches. Absent: none (such a request fails with 424).

  • targetsobject[]

    The top-level targets in order; nested strategies carry their own targets.

    Child attributes
    • namestring

      The target's name, which conditions refer to. Absent when none was set.

    • virtual_key_slugstring

      For a virtual key target: the key's slug. Absent for a nested strategy target.

    • weightnumber<double>

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

    • order_indexinteger<int32>

      The target's position among its siblings (the FALLBACK order).

    • strategy_modeenum<string>

      For a nested strategy target: SINGLE, LOADBALANCE, FALLBACK or CONDITIONAL. Absent for a virtual key target.

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

    • on_status_codesinteger<int32>[]

      For a nested FALLBACK target: the statuses that move on to its next target. Absent: the default.

    • conditional_default_target_namestring

      For a nested CONDITIONAL target: the target used when no condition matches.

    • conditionsobject[]

      For a nested CONDITIONAL target: its rules, in condition_order. Empty otherwise.

      Child attributes
      • condition_orderinteger<int32>required

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

      • querymap<string, object>required

        What the request must match: field paths (metadata.*, params.*) to operator objects, as described for the rule's request form.

      • then_target_namestringrequired

        The name of the target a matching request goes to.

      • idstring<uuid>

        The rule's id (UUID). Changes whenever the config's targets are replaced by an update.

    • 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 per provider call, in milliseconds. Absent: no limit of its own.

    • idstring<uuid>

      The target's id (UUID). Changes whenever the config's targets are replaced by an update.

  • conditionsobject[]

    For CONDITIONAL: the top-level rules, in condition_order. Empty otherwise.

    Child attributes
    • condition_orderinteger<int32>required

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

    • querymap<string, object>required

      What the request must match: field paths (metadata.*, params.*) to operator objects, as described for the rule's request form.

    • then_target_namestringrequired

      The name of the target a matching request goes to.

    • idstring<uuid>

      The rule's id (UUID). Changes whenever the config's targets are replaced by an update.

  • 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>

    The stored time limit in milliseconds (applied only on virtual key targets). Absent when none was set.

  • schema_versioninteger<int32>

    The version of the config format. Currently always 1.

  • created_bystring

    Who created the config: an identifier of the user, or of the API key, that made the request.

  • created_atstring<date-time>

    When the config was created (ISO 8601 date-time).

  • updated_atstring<date-time>

    When the config last changed (ISO 8601 date-time).

NVIDIA Inception Program member

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