> ## 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.

# Create a consumer

> Creates a new consumer in a gateway.



## OpenAPI

````yaml /trustgate/api/openapi.json post /v1/gateways/{gateway_id}/consumers
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: https://agentgateway-admin.dev.neuraltrust.ai
    description: Admin API
security: []
paths:
  /v1/gateways/{gateway_id}/consumers:
    post:
      tags:
        - consumers
      summary: Create a consumer
      description: Creates a new consumer in a gateway.
      parameters:
        - description: Gateway id
          name: gateway_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.CreateConsumerRequest
        description: Consumer to create
        required: true
      responses:
        '201':
          description: Created
          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_helpers.ErrorBody
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github_com_NeuralTrust_TrustGate_pkg_api_handler_http_helpers.ErrorBody
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github_com_NeuralTrust_TrustGate_pkg_api_handler_http_helpers.ErrorBody
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github_com_NeuralTrust_TrustGate_pkg_api_handler_http_helpers.ErrorBody
      security:
        - BearerAuth: []
components:
  schemas:
    github_com_NeuralTrust_TrustGate_pkg_api_handler_http_consumer_request.CreateConsumerRequest:
      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:
          type: array
          items:
            $ref: >-
              #/components/schemas/github_com_NeuralTrust_TrustGate_pkg_api_handler_http_consumer_request.RegistryBindingRequest
        roles:
          type: array
          items:
            type: string
        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_helpers.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
    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
    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:
        models:
          type: array
          items:
            type: string
        registry_id:
          type: string
    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:
        models:
          type: array
          items:
            type: string
        registry_id:
          type: string
    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_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
  securitySchemes:
    BearerAuth:
      type: apiKey
      name: Authorization
      in: header

````