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

# Update Llm Configuration

> Update an LLM configuration by ID.

This endpoint:
- Requires API key or session authentication
- Validates that the new secret_id (if provided) belongs to the user's space
- Updates only the provided fields

Args:
    service: Injected LLM configuration service
    config_id: The ID of the LLM configuration to update
    payload: Request containing fields to update

Returns:
    Response with the updated LLM configuration

Raises:
    400 Bad Request: If user doesn't have an associated space or secret is invalid
    404 Not Found: If the configuration doesn't exist



## OpenAPI

````yaml /openapi.json patch /v1/llm-configurations/{config_id}
openapi: 3.1.0
info:
  title: Live avatar API
  version: 0.1.0
servers:
  - url: https://api.liveavatar.com
security: []
paths:
  /v1/llm-configurations/{config_id}:
    patch:
      tags:
        - LLM Configurations
      summary: Update Llm Configuration
      description: >-
        Update an LLM configuration by ID.


        This endpoint:

        - Requires API key or session authentication

        - Validates that the new secret_id (if provided) belongs to the user's
        space

        - Updates only the provided fields


        Args:
            service: Injected LLM configuration service
            config_id: The ID of the LLM configuration to update
            payload: Request containing fields to update

        Returns:
            Response with the updated LLM configuration

        Raises:
            400 Bad Request: If user doesn't have an associated space or secret is invalid
            404 Not Found: If the configuration doesn't exist
      operationId: update_llm_configuration_v1_llm_configurations__config_id__patch
      parameters:
        - name: config_id
          in: path
          required: true
          schema:
            type: string
            title: Config Id
        - name: la_session
          in: cookie
          required: false
          schema:
            title: La Session
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateLLMConfigurationSchema'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Response_LLMConfigurationResponseSchema_'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKeyHeader: []
components:
  schemas:
    UpdateLLMConfigurationSchema:
      properties:
        base_url:
          title: Base Url
          description: The LLM API endpoint URL
          type: string
          minLength: 1
        display_name:
          type: string
          maxLength: 255
          minLength: 1
          title: Display Name
          description: Display name for the configuration
        model_name:
          type: string
          maxLength: 255
          minLength: 1
          title: Model Name
          description: The model name to use
        secret_id:
          type: string
          maxLength: 36
          minLength: 1
          title: Secret Id
          description: ID of the secret containing the API key
      type: object
      title: UpdateLLMConfigurationSchema
      description: Request schema for updating an LLM configuration
    Response_LLMConfigurationResponseSchema_:
      properties:
        code:
          type: integer
          title: Code
          default: 100
        data:
          anyOf:
            - $ref: '#/components/schemas/LLMConfigurationResponseSchema'
            - type: 'null'
        message:
          title: Message
          type: string
      type: object
      title: Response[LLMConfigurationResponseSchema]
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    LLMConfigurationResponseSchema:
      properties:
        id:
          type: string
          title: Id
        base_url:
          title: Base Url
          type: string
        display_name:
          type: string
          title: Display Name
        model_name:
          type: string
          title: Model Name
        secret_id:
          type: string
          title: Secret Id
        created_at:
          type: string
          format: date-time
          title: Created At
        updated_at:
          type: string
          format: date-time
          title: Updated At
      type: object
      required:
        - id
        - base_url
        - display_name
        - model_name
        - secret_id
        - created_at
        - updated_at
      title: LLMConfigurationResponseSchema
      description: Response schema for an LLM configuration
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          title: Message
          type: string
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      in: header
      name: X-API-KEY

````