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

# Proxy chat completion

> Forwards an OpenAI Chat Completions request to the selected provider. Proxy plane route: /{consumer_slug}/v1/chat/completions. Other fixed routes include /v1/messages (Anthropic) and /v1/responses (OpenAI Responses).



## OpenAPI

````yaml /trustgate/api/openapi.json post /{consumer_slug}/v1/chat/completions
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:
  /{consumer_slug}/v1/chat/completions:
    post:
      tags:
        - proxy
      summary: Proxy chat completion
      description: >-
        Forwards an OpenAI Chat Completions request to the selected provider.
        Proxy plane route: /{consumer_slug}/v1/chat/completions. Other fixed
        routes include /v1/messages (Anthropic) and /v1/responses (OpenAI
        Responses).
      parameters:
        - description: Consumer slug
          name: consumer_slug
          in: path
          required: true
          schema:
            type: string
        - description: API key for inline consumers
          name: X-AG-API-Key
          in: header
          schema:
            type: string
        - description: Bearer token for OAuth2 or OIDC consumers
          name: Authorization
          in: header
          schema:
            type: string
        - description: Gateway slug when using header-based gateway discovery
          name: X-AG-Gateway-Slug
          in: header
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
        description: OpenAI Chat Completions request body
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
        '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
        '403':
          description: Forbidden
          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
        '502':
          description: Bad Gateway
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github_com_NeuralTrust_TrustGate_pkg_api_handler_http_helpers.ErrorBody
components:
  schemas:
    github_com_NeuralTrust_TrustGate_pkg_api_handler_http_helpers.ErrorBody:
      type: object
      properties:
        error:
          type: string
        message:
          type: string

````