---
title: "Update Llm Configuration"
method: PATCH
path: "/v1/llm-configurations/{config_id}"
tags: ["LLM Configurations"]
---

# Update Llm Configuration

`PATCH /v1/llm-configurations/{config_id}`

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

## Path parameters

- `config_id` string, required

## Cookies

- `la_session` string

## Request body

- UpdateLLMConfigurationSchema — Request schema for updating an LLM configuration
  - `base_url` string — The LLM API endpoint URL
  - `display_name` string — Display name for the configuration
  - `model_name` string — The model name to use
  - `secret_id` string — ID of the secret containing the API key

## Response `200`

Successful Response

- ResponseLLMConfigurationResponseSchema
  - `code` integer
  - `data` LLMConfigurationResponseSchema — Response schema for an LLM configuration
    - `id` string, required
    - `base_url` string, required
    - `display_name` string, required
    - `model_name` string, required
    - `secret_id` string, required
    - `created_at` string, date-time, required
    - `updated_at` string, date-time, required
  - `message` string

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/liveavatar/apis/live-avatar-api.md) · [All operations](https://skmtc.net/liveavatar/apis/live-avatar-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/liveavatar/live-avatar-api/versions/fbfa5cdbd7f9/schema)
