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

# Update Model

> Update an existing model's configuration

## Body Parameters

<ParamField body="id" type="string" required>
  The unique identifier of the model to update. This field cannot be changed - it must match an existing model.
</ParamField>

<ParamField body="name" type="string" required>
  Updated human-readable display name for the model
</ParamField>

<ParamField body="base_model_id" type="string">
  Updated base model ID that should be used when proxying requests
</ParamField>

<ParamField body="params" type="object" required>
  Updated model parameters. This object can contain any parameters supported by the model.

  Common parameters:

  * `temperature` (number): Controls randomness in responses
  * `max_tokens` (integer): Maximum number of tokens to generate
  * `top_p` (number): Nucleus sampling parameter
  * `frequency_penalty` (number): Penalty for token frequency
  * `presence_penalty` (number): Penalty for token presence
</ParamField>

<ParamField body="meta" type="object" required>
  Updated metadata about the model

  <ParamField body="profile_image_url" type="string">
    Updated URL or data URI for the model's profile image
  </ParamField>

  <ParamField body="description" type="string">
    Updated user-facing description of the model
  </ParamField>

  <ParamField body="capabilities" type="object">
    Updated object describing model capabilities
  </ParamField>
</ParamField>

<ParamField body="access_grants" type="array">
  Updated array of access grant objects. If provided, this will replace all existing access grants.

  Each grant should specify:

  * `access_type` (string): "user" or "group"
  * `access_id` (string): ID of the user or group
  * `permission` (string): "read" or "write"
</ParamField>

<ParamField body="is_active" type="boolean" default={true}>
  Updated active status of the model
</ParamField>

## Response

<ResponseField name="id" type="string">
  The model's unique identifier
</ResponseField>

<ResponseField name="user_id" type="string">
  ID of the user who created the model (unchanged)
</ResponseField>

<ResponseField name="base_model_id" type="string">
  Updated base model ID
</ResponseField>

<ResponseField name="name" type="string">
  Updated model name
</ResponseField>

<ResponseField name="params" type="object">
  Updated model parameters
</ResponseField>

<ResponseField name="meta" type="object">
  Updated model metadata
</ResponseField>

<ResponseField name="access_grants" type="array">
  Updated access grants for the model
</ResponseField>

<ResponseField name="is_active" type="boolean">
  Updated active status
</ResponseField>

<ResponseField name="created_at" type="integer">
  Unix timestamp of original creation (unchanged)
</ResponseField>

<ResponseField name="updated_at" type="integer">
  Unix timestamp of this update
</ResponseField>

## Example Request

```bash theme={null}
curl -X POST "https://api.example.com/api/models/model/update" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "id": "my-custom-gpt4",
    "name": "Updated Custom GPT-4",
    "base_model_id": "gpt-4-turbo",
    "params": {
      "temperature": 0.8,
      "max_tokens": 4000,
      "top_p": 0.95
    },
    "meta": {
      "description": "Enhanced GPT-4 model with higher creativity",
      "capabilities": {
        "vision": true,
        "function_calling": true,
        "json_mode": true
      }
    },
    "access_grants": [
      {
        "access_type": "group",
        "access_id": "developers",
        "permission": "write"
      },
      {
        "access_type": "user",
        "access_id": "user456",
        "permission": "read"
      }
    ],
    "is_active": true
  }'
```

## Example Response

```json theme={null}
{
  "id": "my-custom-gpt4",
  "user_id": "user123",
  "base_model_id": "gpt-4-turbo",
  "name": "Updated Custom GPT-4",
  "params": {
    "temperature": 0.8,
    "max_tokens": 4000,
    "top_p": 0.95
  },
  "meta": {
    "profile_image_url": "/static/favicon.png",
    "description": "Enhanced GPT-4 model with higher creativity",
    "capabilities": {
      "vision": true,
      "function_calling": true,
      "json_mode": true
    }
  },
  "access_grants": [
    {
      "access_type": "group",
      "access_id": "developers",
      "permission": "write"
    },
    {
      "access_type": "user",
      "access_id": "user456",
      "permission": "read"
    }
  ],
  "is_active": true,
  "created_at": 1704067200,
  "updated_at": 1704240000
}
```

## Error Responses

<ResponseField name="401">
  Unauthorized - Model not found

  ```json theme={null}
  {
    "detail": "Model not found"
  }
  ```
</ResponseField>

<ResponseField name="400">
  Bad Request - User does not have write access to this model

  ```json theme={null}
  {
    "detail": "Access prohibited"
  }
  ```
</ResponseField>

## Permissions

To update a model, the user must:

* Be the owner of the model (user\_id matches), OR
* Have write access granted through access\_grants, OR
* Be an admin user
