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

> Apply a partial update to an AI Gateway provider. The providerId is immutable after

# Update an AI Gateway provider



## OpenAPI

````yaml openapi/ai-gateway.yaml PATCH /providers/{id}
openapi: 3.0.3
info:
  title: AI Gateway APIs
  version: 0.1.0
  description: |
    Control-plane HTTP APIs served by the ai-gateway-control service.
servers:
  - url: https://api.ngrok.ai
security:
  - bearerAuth: []
tags:
  - name: AI Gateway Access Key Configurations
    description: Manage reusable access key configurations (scope and routing rules).
  - name: AI Gateway Access Keys
    description: Manage ngrok-managed access keys associated with AI Gateway endpoints.
  - name: AI Gateway Configuration
    description: >-
      Manage per-account AI Gateway configuration (timeouts, token caps,
      metadata).
  - name: AI Gateway API Keys
    description: Manage customer-facing AI Gateway API Keys.
  - name: AI Gateway Credits
    description: Purchase AI Gateway credits via Stripe Checkout.
  - name: AI Gateway Providers
    description: Manage AI Gateway providers and the models they expose.
  - name: AI Gateway Custom Providers
    description: Manage custom AI Gateway providers and the models they expose.
  - name: AI Gateway Provider Keys
    description: Manage provider keys attached to AI Gateway managed access keys.
  - name: AI Gateway Usage
    description: >-
      Read-only AI Gateway usage events and aggregated usage overview for the
      authenticated account.
paths:
  /providers/{id}:
    parameters:
      - $ref: '#/components/parameters/AIGatewayProviderID'
    patch:
      tags:
        - AI Gateway Providers
      summary: Update an AI Gateway provider
      description: >
        Apply a partial update to an AI Gateway provider. The providerId is
        immutable after

        creation. Models follow REST PATCH-array semantics: omit the field to
        leave existing

        models alone, send an empty array to clear all models, or send a full
        list to replace

        the existing set.
      operationId: UpdateAIGatewayProvider
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AIGatewayProviderUpdate'
      responses:
        '200':
          description: The updated AI Gateway provider.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AIGatewayProvider'
        default:
          $ref: '#/components/responses/Error'
components:
  parameters:
    AIGatewayProviderID:
      name: id
      in: path
      required: true
      description: Unique identifier for an AI Gateway provider.
      schema:
        type: string
  schemas:
    AIGatewayProviderUpdate:
      type: object
      additionalProperties: false
      properties:
        name:
          type: string
          nullable: true
          minLength: 1
          maxLength: 255
          description: User-friendly label for this provider.
        baseUrl:
          type: string
          minLength: 1
          maxLength: 2048
          description: >-
            Base URL of the provider's API endpoint. Cannot be cleared (every
            provider has one).
        metadata:
          type: string
          nullable: true
          maxLength: 4096
          description: Arbitrary user-defined metadata for this provider.
        supportedApiSurfaces:
          type: array
          nullable: true
          description: API surfaces supported by this provider.
          items:
            $ref: '#/components/schemas/SupportedAPISurface'
        models:
          type: array
          nullable: true
          description: >
            Full replacement set for the models attached to this provider. Omit
            the field to

            leave existing models alone, send an empty array to clear all
            models, or send a

            full list to replace the existing set.
          items:
            $ref: '#/components/schemas/AIGatewayProviderModelCreate'
    AIGatewayProvider:
      type: object
      additionalProperties: false
      required:
        - id
        - uri
        - providerId
        - name
        - baseUrl
        - createdAt
        - updatedAt
        - createdBy
        - lastUpdatedBy
      properties:
        id:
          type: string
          description: Unique identifier for this provider.
        uri:
          type: string
          description: URI of this AI Gateway Provider API resource.
        providerId:
          type: string
          description: >-
            Provider identifier used as the address segment in model strings
            (for example "internal-vllm").
        name:
          type: string
          description: User-friendly label for this provider.
        baseUrl:
          type: string
          description: Base URL of the provider's API endpoint.
        metadata:
          type: string
          description: Arbitrary user-defined metadata for this provider.
        createdAt:
          type: string
          format: date-time
          description: Timestamp when the provider was created.
        updatedAt:
          type: string
          format: date-time
          description: Timestamp when the provider was last updated.
        createdBy:
          $ref: '#/components/schemas/Ref'
        lastUpdatedBy:
          $ref: '#/components/schemas/Ref'
        supportedApiSurfaces:
          type: array
          description: API surfaces supported by this provider.
          items:
            $ref: '#/components/schemas/SupportedAPISurface'
        models:
          type: array
          description: Models exposed by this provider.
          items:
            $ref: '#/components/schemas/AIGatewayProviderModel'
    SupportedAPISurface:
      type: object
      additionalProperties: false
      required:
        - format
      properties:
        format:
          type: string
          description: |
            The API format this surface conforms to (for example "openai" or
            "anthropic"). Validated against ngrok's known formats at runtime.
        surface:
          type: string
          description: |
            The specific API surface within the format (for example
            "chat-completions", "responses", or "messages"). Validated against
            ngrok's known surfaces at runtime.
        supportedParams:
          type: array
          description: Top-level request body parameters supported by this surface.
          items:
            $ref: '#/components/schemas/SupportedAPISurfaceParam'
    AIGatewayProviderModelCreate:
      type: object
      additionalProperties: false
      required:
        - modelId
      properties:
        modelId:
          type: string
          minLength: 1
          maxLength: 255
          description: Model identifier (for example "llama-3").
    Ref:
      type: object
      additionalProperties: false
      required:
        - id
        - uri
      properties:
        id:
          type: string
          description: Resource identifier.
        uri:
          type: string
          description: URI for locating the resource.
    AIGatewayProviderModel:
      type: object
      additionalProperties: false
      required:
        - id
        - modelId
      properties:
        id:
          type: string
          description: Unique identifier for this model.
        modelId:
          type: string
          description: Model identifier (for example "llama-3").
    Error:
      type: object
      additionalProperties: false
      required:
        - statusCode
        - msg
        - details
      properties:
        errorCode:
          type: string
          description: Stable ngrok error code when available.
        statusCode:
          type: integer
          format: int32
          description: HTTP status code for this error.
        msg:
          type: string
          description: Human-readable error message.
        details:
          type: object
          description: Structured error details.
          additionalProperties:
            type: string
    SupportedAPISurfaceParam:
      type: object
      additionalProperties: false
      required:
        - name
      properties:
        name:
          type: string
          description: Name of a supported top-level request body parameter.
  responses:
    Error:
      description: API error response.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````