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

# Change a channel's language model

> Set the language model a channel uses on a draft branch. Pass a `providerModelId` from `GET /v1/llm-models`, which is the same in every region. The channel must be set up, and the model must be one the channel can use. Changes reach the live agent when the branch is merged.



## OpenAPI

````yaml PATCH /v1/agents/{agentId}/branches/{branchId}/llm-models
openapi: 3.1.0
info:
  title: PolyAI Agents API
  version: 1.0.11
  description: Manage PolyAI agents, telephony, deployments, and real-time configs.
servers:
  - url: https://api.us.poly.ai
    description: US region
  - url: https://api.eu.poly.ai
    description: EU region
  - url: https://api.uk.poly.ai
    description: UK region
  - url: https://api.studio.poly.ai
    description: Studio region
security:
  - polyApiKey: []
paths:
  /v1/agents/{agentId}/branches/{branchId}/llm-models:
    parameters:
      - name: agentId
        in: path
        required: true
        schema:
          type: string
      - name: branchId
        in: path
        required: true
        schema:
          type: string
    patch:
      tags:
        - Models
      summary: Change a channel's language model
      description: >-
        Set the language model a channel uses on a draft branch. Pass a
        `providerModelId` from `GET /v1/llm-models`, which is the same in every
        region. The channel must be set up, and the model must be one the
        channel can use. Changes reach the live agent when the branch is merged.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateBranchLlmModelBody'
      responses:
        '200':
          description: The channel's new language model
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BranchLlmModelResponse'
components:
  schemas:
    UpdateBranchLlmModelBody:
      type: object
      properties:
        channel:
          type: string
          enum:
            - voice
            - web-chat
            - sms
            - email
          description: 'A channel: voice, web chat, SMS or email.'
        providerModelId:
          type: string
          minLength: 1
          description: >-
            A `providerModelId` from `GET /v1/llm-models`. The same in every
            region.
      required:
        - channel
        - providerModelId
      additionalProperties: false
      description: The channel to change and the language model it's to use.
      title: UpdateBranchLlmModelBody
    BranchLlmModelResponse:
      anyOf:
        - type: object
          properties:
            id:
              type: string
              description: >-
                The ID a channel stores for this model. IDs differ between
                regions, so set a model by `providerModelId`.
            name:
              type: string
              description: The name Agent Studio shows.
            providerModelId:
              type: string
              description: >-
                The ID to set a channel or flow step override with. The same in
                every region.
            endToEnd:
              type: boolean
              description: >-
                Whether the model handles speech itself. On voice it makes the
                channel speech-native, and the ASR model stops applying.
            polyaiModel:
              type: boolean
              description: >-
                Whether PolyAI built the model. Agent Studio lists these first
                and tags them 'PolyAI'.
            supportsWebchat:
              type: boolean
              description: Whether web chat, SMS and email can use it.
            supportsTemperature:
              type: boolean
              description: Whether a temperature can be set with it.
            channel:
              type: string
              enum:
                - voice
                - web-chat
                - sms
                - email
              description: 'A channel: voice, web chat, SMS or email.'
          required:
            - id
            - name
            - providerModelId
            - endToEnd
            - polyaiModel
            - supportsWebchat
            - supportsTemperature
            - channel
          additionalProperties: false
          description: A language model an account can choose.
        - type: object
          properties:
            id:
              type: string
              description: The model ID the channel stores.
            name:
              enum:
                - 'null'
              nullable: true
            providerModelId:
              enum:
                - 'null'
              nullable: true
            channel:
              type: string
              enum:
                - voice
                - web-chat
                - sms
                - email
              description: 'A channel: voice, web chat, SMS or email.'
          required:
            - id
            - name
            - providerModelId
            - channel
          additionalProperties: false
          description: >-
            A model the channel stores that isn't in the list. Choose another
            from `GET /v1/llm-models`.
      description: >-
        A channel's language model on a branch, in the same shape as `GET
        /v1/llm-models`. When the stored model isn't listed, only its `id` is
        known.
      title: BranchLlmModelResponse
  securitySchemes:
    polyApiKey:
      type: apiKey
      in: header
      name: X-API-KEY

````