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

# Update an AI Provider Key

> Update an AI provider key: its name, credentials, model scope or project access.



## OpenAPI

````yaml POST /v1/ai-providers/{id}
openapi: 3.1.0
info:
  title: Activepieces Documentation
  version: 0.0.0
servers:
  - url: https://cloud.activepieces.com/api
    description: Production Server
security: []
externalDocs:
  url: https://www.activepieces.com/docs
  description: Find more info here
paths:
  /v1/ai-providers/{id}:
    post:
      tags:
        - ai-providers
      description: >-
        Update an AI provider key: its name, credentials, model scope or project
        access.
      parameters:
        - schema:
            type: string
          in: path
          name: id
          required: true
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                displayName:
                  type: string
                  minLength: 1
                config:
                  anyOf:
                    - type: object
                      properties:
                        apiKeyHeader:
                          type: string
                        baseUrl:
                          type: string
                        models:
                          type: array
                          items:
                            type: object
                            properties:
                              modelId:
                                type: string
                              modelName:
                                type: string
                              modelType:
                                type: string
                                enum:
                                  - image
                                  - text
                            required:
                              - modelId
                              - modelName
                              - modelType
                        defaultHeaders:
                          type: object
                          propertyNames:
                            type: string
                          additionalProperties:
                            type: string
                        apiStyle:
                          type: string
                          enum:
                            - chat
                            - responses
                      required:
                        - apiKeyHeader
                        - baseUrl
                        - models
                    - type: object
                      properties:
                        accountId:
                          type: string
                        gatewayId:
                          type: string
                        models:
                          type: array
                          items:
                            type: object
                            properties:
                              modelId:
                                type: string
                              modelName:
                                type: string
                              modelType:
                                type: string
                                enum:
                                  - image
                                  - text
                            required:
                              - modelId
                              - modelName
                              - modelType
                        vertexProject:
                          type: string
                        vertexRegion:
                          type: string
                      required:
                        - accountId
                        - gatewayId
                        - models
                    - type: object
                      properties:
                        resourceName:
                          type: string
                        apiVersion:
                          type: string
                      required:
                        - resourceName
                    - type: object
                      properties:
                        project:
                          type: string
                          pattern: ^[a-z0-9][a-z0-9-]{0,62}$
                        region:
                          type: string
                          pattern: ^[a-z0-9][a-z0-9-]{0,62}$
                        models:
                          type: array
                          items:
                            type: object
                            properties:
                              modelId:
                                type: string
                              modelName:
                                type: string
                              modelType:
                                type: string
                                enum:
                                  - image
                                  - text
                            required:
                              - modelId
                              - modelName
                              - modelType
                      required:
                        - project
                        - region
                        - models
                    - type: object
                      properties:
                        region:
                          type: string
                          minLength: 1
                      required:
                        - region
                    - type: object
                      properties: {}
                    - type: object
                      properties: {}
                    - type: object
                      properties: {}
                    - type: object
                      properties: {}
                    - type: object
                      properties: {}
                    - type: object
                      properties: {}
                    - type: object
                      properties: {}
                auth:
                  anyOf:
                    - type: object
                      properties:
                        apiKey:
                          type: string
                      required:
                        - apiKey
                      additionalProperties: false
                    - type: object
                      properties:
                        apiKey:
                          type: string
                      required:
                        - apiKey
                      additionalProperties: false
                    - type: object
                      properties:
                        apiKey:
                          type: string
                      required:
                        - apiKey
                      additionalProperties: false
                    - type: object
                      properties:
                        apiKey:
                          type: string
                      required:
                        - apiKey
                      additionalProperties: false
                    - type: object
                      properties:
                        apiKey:
                          type: string
                      required:
                        - apiKey
                      additionalProperties: false
                    - type: object
                      properties:
                        apiKey:
                          type: string
                      required:
                        - apiKey
                      additionalProperties: false
                    - type: object
                      properties:
                        apiKey:
                          type: string
                      required:
                        - apiKey
                      additionalProperties: false
                    - type: object
                      properties:
                        apiKey:
                          type: string
                        apiKeyHash:
                          type: string
                      required:
                        - apiKey
                        - apiKeyHash
                      additionalProperties: false
                    - type: object
                      properties:
                        accessKeyId:
                          type: string
                          minLength: 1
                        secretAccessKey:
                          type: string
                          minLength: 1
                        sessionToken:
                          type: string
                      required:
                        - accessKeyId
                        - secretAccessKey
                      additionalProperties: false
                    - type: object
                      properties:
                        serviceAccountJson:
                          type: string
                          minLength: 1
                      required:
                        - serviceAccountJson
                      additionalProperties: false
                    - type: object
                      properties:
                        apiKey:
                          type: string
                      required:
                        - apiKey
                      additionalProperties: false
                enabledForChat:
                  type: boolean
                modelScope:
                  type: string
                  enum:
                    - all
                    - selected
                modelIds:
                  type: array
                  items:
                    type: string
                projectScope:
                  type: string
                  enum:
                    - all
                    - selected
                    - except
                projectIds:
                  type: array
                  items:
                    type: string
              required:
                - displayName
        required: true
      responses:
        '200':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                  name:
                    type: string
                  provider:
                    type: string
                    enum:
                      - openai
                      - openrouter
                      - anthropic
                      - azure
                      - google
                      - activepieces
                      - cloudflare-gateway
                      - custom
                      - bedrock
                      - vertex
                      - mistral
                      - xai
                      - deepseek
                      - zai
                      - qwen
                      - minimax
                      - moonshot
                      - meta
                      - nvidia
                  config:
                    anyOf:
                      - type: object
                        properties:
                          apiKeyHeader:
                            type: string
                          baseUrl:
                            type: string
                          models:
                            type: array
                            items:
                              type: object
                              properties:
                                modelId:
                                  type: string
                                modelName:
                                  type: string
                                modelType:
                                  type: string
                                  enum:
                                    - image
                                    - text
                              required:
                                - modelId
                                - modelName
                                - modelType
                          defaultHeaders:
                            type: object
                            propertyNames:
                              type: string
                            additionalProperties:
                              type: string
                          apiStyle:
                            type: string
                            enum:
                              - chat
                              - responses
                        required:
                          - apiKeyHeader
                          - baseUrl
                          - models
                      - type: object
                        properties:
                          accountId:
                            type: string
                          gatewayId:
                            type: string
                          models:
                            type: array
                            items:
                              type: object
                              properties:
                                modelId:
                                  type: string
                                modelName:
                                  type: string
                                modelType:
                                  type: string
                                  enum:
                                    - image
                                    - text
                              required:
                                - modelId
                                - modelName
                                - modelType
                          vertexProject:
                            type: string
                          vertexRegion:
                            type: string
                        required:
                          - accountId
                          - gatewayId
                          - models
                      - type: object
                        properties:
                          resourceName:
                            type: string
                          apiVersion:
                            type: string
                        required:
                          - resourceName
                      - type: object
                        properties:
                          project:
                            type: string
                            pattern: ^[a-z0-9][a-z0-9-]{0,62}$
                          region:
                            type: string
                            pattern: ^[a-z0-9][a-z0-9-]{0,62}$
                          models:
                            type: array
                            items:
                              type: object
                              properties:
                                modelId:
                                  type: string
                                modelName:
                                  type: string
                                modelType:
                                  type: string
                                  enum:
                                    - image
                                    - text
                              required:
                                - modelId
                                - modelName
                                - modelType
                        required:
                          - project
                          - region
                          - models
                      - type: object
                        properties:
                          region:
                            type: string
                            minLength: 1
                        required:
                          - region
                      - type: object
                        properties: {}
                      - type: object
                        properties: {}
                      - type: object
                        properties: {}
                      - type: object
                        properties: {}
                      - type: object
                        properties: {}
                      - type: object
                        properties: {}
                      - type: object
                        properties: {}
                  enabledForChat:
                    type: boolean
                  modelScope:
                    type: string
                    enum:
                      - all
                      - selected
                  modelIds:
                    type: array
                    items:
                      type: string
                  projectScope:
                    type: string
                    enum:
                      - all
                      - selected
                      - except
                  projectIds:
                    type: array
                    items:
                      type: string
                  status:
                    type: string
                    enum:
                      - active
                      - out_of_credits
                      - rejected
                      - unreachable
                  statusReason:
                    anyOf:
                      - type: string
                      - type: 'null'
                  statusUpdated:
                    anyOf:
                      - type: string
                      - type: 'null'
                required:
                  - id
                  - name
                  - provider
                  - config
                  - enabledForChat
                  - modelScope
                  - modelIds
                  - projectScope
                  - projectIds
                  - status
                  - statusReason
                  - statusUpdated
      security:
        - apiKey: []
components:
  securitySchemes:
    apiKey:
      type: http
      description: Use your api key generated from the admin console
      scheme: bearer

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.