> ## Documentation Index
> Fetch the complete documentation index at: https://docs.neuraltrust.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Update a consumer

> Updates an existing consumer. The optional `registries` field replaces the whole registry association set, so switching a role_based consumer to inline routing and attaching its registries happens in a single atomic request.



## OpenAPI

````yaml /trustgate/api/openapi.json put /v1/gateways/{gateway_id}/consumers/{id}
openapi: 3.0.0
info:
  description: >-
    Administrative API for managing gateways and their registries, policies,
    consumers, roles and auth credentials.
  title: TrustGate Admin API
  contact:
    name: NeuralTrust
    url: https://neuraltrust.ai/contact
    email: support@neuraltrust.ai
  version: '1.0'
servers:
  - url: /
security: []
paths:
  /v1/gateways/{gateway_id}/consumers/{id}:
    put:
      tags:
        - consumers
      summary: Update a consumer
      description: >-
        Updates an existing consumer. The optional `registries` field replaces
        the whole registry association set, so switching a role_based consumer
        to inline routing and attaching its registries happens in a single
        atomic request.
      parameters:
        - description: Gateway id
          name: gateway_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
        - description: Consumer id
          name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid
      requestBody:
        content:
          application/json:
            schema:
              $ref: >-
                #/components/schemas/github_com_NeuralTrust_TrustGate_pkg_api_handler_http_consumer_request.UpdateConsumerRequest
        description: Consumer fields to update
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github_com_NeuralTrust_TrustGate_pkg_api_handler_http_consumer_response.ConsumerResponse
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github_com_NeuralTrust_TrustGate_pkg_api_handler_http_httpio.ErrorBody
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github_com_NeuralTrust_TrustGate_pkg_api_handler_http_httpio.ErrorBody
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github_com_NeuralTrust_TrustGate_pkg_api_handler_http_httpio.ErrorBody
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github_com_NeuralTrust_TrustGate_pkg_api_handler_http_httpio.ErrorBody
      security:
        - BearerAuth: []
components:
  schemas:
    github_com_NeuralTrust_TrustGate_pkg_api_handler_http_consumer_request.UpdateConsumerRequest:
      type: object
      properties:
        active:
          type: boolean
        fail_mode:
          type: string
        fallback:
          $ref: >-
            #/components/schemas/github_com_NeuralTrust_TrustGate_pkg_api_handler_http_consumer_request.FallbackRequest
        headers:
          type: object
          additionalProperties:
            type: string
        lb_config:
          $ref: >-
            #/components/schemas/github_com_NeuralTrust_TrustGate_pkg_api_handler_http_consumer_request.LBConfigRequest
        model_policies:
          type: array
          items:
            $ref: >-
              #/components/schemas/github_com_NeuralTrust_TrustGate_pkg_api_handler_http_consumer_request.ModelPolicyRequest
        name:
          type: string
        registries:
          description: >-
            Registries replaces the whole registry association set: registries
            absent

            from the list are detached. Omit the field to leave the associations
            as

            they are; send an empty list to detach every registry.
          type: array
          items:
            $ref: >-
              #/components/schemas/github_com_NeuralTrust_TrustGate_pkg_api_handler_http_consumer_request.RegistryBindingRequest
        routing_mode:
          type: string
        toolkit:
          type: array
          items:
            $ref: >-
              #/components/schemas/github_com_NeuralTrust_TrustGate_pkg_api_handler_http_consumer_request.ToolkitEntryRequest
        type:
          type: string
    github_com_NeuralTrust_TrustGate_pkg_api_handler_http_consumer_response.ConsumerResponse:
      type: object
      properties:
        active:
          type: boolean
        auth_ids:
          type: array
          items:
            type: string
        created_at:
          type: string
        fail_mode:
          type: string
        fallback:
          $ref: >-
            #/components/schemas/github_com_NeuralTrust_TrustGate_pkg_api_handler_http_consumer_response.FallbackResponse
        gateway_id:
          type: string
        headers:
          type: object
          additionalProperties:
            type: string
        id:
          type: string
        lb_config:
          $ref: >-
            #/components/schemas/github_com_NeuralTrust_TrustGate_pkg_api_handler_http_consumer_response.LBConfigResponse
        model_policies:
          type: array
          items:
            $ref: >-
              #/components/schemas/github_com_NeuralTrust_TrustGate_pkg_api_handler_http_consumer_response.ModelPolicyResponse
        name:
          type: string
        registry_ids:
          type: array
          items:
            type: string
        registry_weights:
          type: array
          items:
            $ref: >-
              #/components/schemas/github_com_NeuralTrust_TrustGate_pkg_api_handler_http_consumer_response.RegistryWeightResponse
        role_ids:
          type: array
          items:
            type: string
        routing_mode:
          type: string
        slug:
          type: string
        toolkit:
          type: array
          items:
            $ref: >-
              #/components/schemas/github_com_NeuralTrust_TrustGate_pkg_api_handler_http_consumer_response.ToolkitEntryResponse
        type:
          type: string
        updated_at:
          type: string
    github_com_NeuralTrust_TrustGate_pkg_api_handler_http_httpio.ErrorBody:
      type: object
      properties:
        error:
          type: string
        message:
          type: string
    github_com_NeuralTrust_TrustGate_pkg_api_handler_http_consumer_request.FallbackRequest:
      type: object
      properties:
        budget:
          $ref: >-
            #/components/schemas/github_com_NeuralTrust_TrustGate_pkg_api_handler_http_consumer_request.FallbackBudgetRequest
        chain:
          type: array
          items:
            type: string
        enabled:
          type: boolean
        triggers:
          type: array
          items:
            type: string
    github_com_NeuralTrust_TrustGate_pkg_api_handler_http_consumer_request.LBConfigRequest:
      type: object
      properties:
        algorithm:
          type: string
        embedding_config:
          $ref: >-
            #/components/schemas/github_com_NeuralTrust_TrustGate_pkg_api_handler_http_consumer_request.EmbeddingConfigRequest
        enabled:
          type: boolean
        members:
          type: array
          items:
            $ref: >-
              #/components/schemas/github_com_NeuralTrust_TrustGate_pkg_api_handler_http_consumer_request.LBPoolMemberRequest
        pool_alias:
          type: string
        smart_routing:
          $ref: >-
            #/components/schemas/github_com_NeuralTrust_TrustGate_pkg_api_handler_http_consumer_request.SmartRoutingConfigRequest
    github_com_NeuralTrust_TrustGate_pkg_api_handler_http_consumer_request.ModelPolicyRequest:
      type: object
      properties:
        allowed:
          type: array
          items:
            type: string
        default:
          type: string
        registry_id:
          type: string
    github_com_NeuralTrust_TrustGate_pkg_api_handler_http_consumer_request.RegistryBindingRequest:
      type: object
      properties:
        id:
          type: string
        model_policies:
          $ref: >-
            #/components/schemas/github_com_NeuralTrust_TrustGate_pkg_api_handler_http_consumer_request.RegistryModelPolicyRequest
        weight:
          description: Weight is the relative weighted-round-robin share on a 1..100 scale.
          type: integer
          maximum: 100
          minimum: 1
          example: 1
    github_com_NeuralTrust_TrustGate_pkg_api_handler_http_consumer_request.ToolkitEntryRequest:
      type: object
      properties:
        expose_as:
          type: string
        prompt:
          type: string
        registry_id:
          type: string
        resource:
          type: string
        tool:
          type: string
    github_com_NeuralTrust_TrustGate_pkg_api_handler_http_consumer_response.FallbackResponse:
      type: object
      properties:
        budget:
          $ref: >-
            #/components/schemas/github_com_NeuralTrust_TrustGate_pkg_api_handler_http_consumer_response.FallbackBudgetResponse
        chain:
          type: array
          items:
            type: string
        enabled:
          type: boolean
        triggers:
          type: array
          items:
            type: string
    github_com_NeuralTrust_TrustGate_pkg_api_handler_http_consumer_response.LBConfigResponse:
      type: object
      properties:
        algorithm:
          type: string
        embedding_config:
          $ref: >-
            #/components/schemas/github_com_NeuralTrust_TrustGate_pkg_api_handler_http_consumer_response.EmbeddingConfigResponse
        enabled:
          type: boolean
        members:
          type: array
          items:
            $ref: >-
              #/components/schemas/github_com_NeuralTrust_TrustGate_pkg_api_handler_http_consumer_response.LBPoolMemberResponse
        pool_alias:
          type: string
        smart_routing:
          $ref: >-
            #/components/schemas/github_com_NeuralTrust_TrustGate_pkg_api_handler_http_consumer_response.SmartRoutingConfigResponse
    github_com_NeuralTrust_TrustGate_pkg_api_handler_http_consumer_response.ModelPolicyResponse:
      type: object
      properties:
        allowed:
          type: array
          items:
            type: string
        default:
          type: string
        registry_id:
          type: string
    github_com_NeuralTrust_TrustGate_pkg_api_handler_http_consumer_response.RegistryWeightResponse:
      type: object
      properties:
        registry_id:
          type: string
        weight:
          type: integer
    github_com_NeuralTrust_TrustGate_pkg_api_handler_http_consumer_response.ToolkitEntryResponse:
      type: object
      properties:
        expose_as:
          type: string
        prompt:
          type: string
        registry_id:
          type: string
        resource:
          type: string
        tool:
          type: string
    github_com_NeuralTrust_TrustGate_pkg_api_handler_http_consumer_request.FallbackBudgetRequest:
      type: object
      properties:
        max_attempts:
          type: integer
        max_total_latency_ms:
          type: integer
    github_com_NeuralTrust_TrustGate_pkg_api_handler_http_consumer_request.EmbeddingConfigRequest:
      type: object
      properties:
        auth:
          $ref: >-
            #/components/schemas/github_com_NeuralTrust_TrustGate_pkg_api_handler_http_consumer_request.APIKeyAuthRequest
        model:
          type: string
        provider:
          type: string
    github_com_NeuralTrust_TrustGate_pkg_api_handler_http_consumer_request.LBPoolMemberRequest:
      type: object
      properties:
        model:
          description: >-
            Model pins this pool entry to a single model, which is what allows
            the same

            registry to appear several times as independently balanced routes.
          type: string
        models:
          type: array
          items:
            type: string
        registry_id:
          type: string
        weight:
          description: >-
            Weight is the relative weighted-round-robin share of this route on a
            1..100

            scale, defaulting to the consumer's registry weight.
          type: integer
          maximum: 100
          minimum: 1
          example: 1
    github_com_NeuralTrust_TrustGate_pkg_api_handler_http_consumer_request.SmartRoutingConfigRequest:
      type: object
      properties:
        tiers:
          type: array
          items:
            $ref: >-
              #/components/schemas/github_com_NeuralTrust_TrustGate_pkg_api_handler_http_consumer_request.SmartRoutingTierRequest
    github_com_NeuralTrust_TrustGate_pkg_api_handler_http_consumer_request.RegistryModelPolicyRequest:
      type: object
      properties:
        allowed:
          type: array
          items:
            type: string
        default:
          type: string
    github_com_NeuralTrust_TrustGate_pkg_api_handler_http_consumer_response.FallbackBudgetResponse:
      type: object
      properties:
        max_attempts:
          type: integer
        max_total_latency_ms:
          type: integer
    github_com_NeuralTrust_TrustGate_pkg_api_handler_http_consumer_response.EmbeddingConfigResponse:
      type: object
      properties:
        auth:
          $ref: >-
            #/components/schemas/github_com_NeuralTrust_TrustGate_pkg_api_handler_http_consumer_response.EmbeddingAuthResponse
        model:
          type: string
        provider:
          type: string
    github_com_NeuralTrust_TrustGate_pkg_api_handler_http_consumer_response.LBPoolMemberResponse:
      type: object
      properties:
        model:
          type: string
        models:
          type: array
          items:
            type: string
        registry_id:
          type: string
        weight:
          type: integer
    github_com_NeuralTrust_TrustGate_pkg_api_handler_http_consumer_response.SmartRoutingConfigResponse:
      type: object
      properties:
        tiers:
          type: array
          items:
            $ref: >-
              #/components/schemas/github_com_NeuralTrust_TrustGate_pkg_api_handler_http_consumer_response.SmartRoutingTierResponse
    github_com_NeuralTrust_TrustGate_pkg_api_handler_http_consumer_request.APIKeyAuthRequest:
      type: object
      properties:
        api_key:
          description: '#nosec G117'
          type: string
        header_name:
          type: string
        header_value:
          type: string
        param_location:
          type: string
        param_name:
          type: string
        param_value:
          type: string
    github_com_NeuralTrust_TrustGate_pkg_api_handler_http_consumer_request.SmartRoutingTierRequest:
      type: object
      properties:
        min_score:
          type: number
        model:
          description: >-
            Model selects which route of the registry this tier targets. It is
            required

            when the pool declares the registry more than once.
          type: string
        registry_id:
          type: string
    github_com_NeuralTrust_TrustGate_pkg_api_handler_http_consumer_response.EmbeddingAuthResponse:
      type: object
      properties:
        api_key:
          description: '#nosec G117'
          type: string
        header_name:
          type: string
        header_value:
          type: string
        param_location:
          type: string
        param_name:
          type: string
        param_value:
          type: string
    github_com_NeuralTrust_TrustGate_pkg_api_handler_http_consumer_response.SmartRoutingTierResponse:
      type: object
      properties:
        min_score:
          type: number
        model:
          type: string
        registry_id:
          type: string
  securitySchemes:
    BearerAuth:
      type: apiKey
      name: Authorization
      in: header

````