> ## 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.

# Create Model

> Create a new custom model

## Body Parameters

<ParamField body="id" type="string" required>
  Unique identifier for the model (max 256 characters). This will be used in API calls to reference the model.
</ParamField>

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

<ParamField body="base_model_id" type="string">
  Optional pointer to an existing model that should be used when proxying requests. If set, this model will act as a wrapper around the base model.
</ParamField>

<ParamField body="params" type="object" required>
  JSON object containing model parameters. The schema is flexible and can include any parameters supported by the base 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>
  Metadata about the model

  <ParamField body="profile_image_url" type="string">
    URL or data URI for the model's profile image. Defaults to "/static/favicon.png" if not provided.
  </ParamField>

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

  <ParamField body="capabilities" type="object">
    Object describing model capabilities (e.g., vision support, function calling)
  </ParamField>
</ParamField>

<ParamField body="access_grants" type="array">
  Optional array of access grant objects to control who can access this model. 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}>
  Whether the model should be active and available for use
</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
</ResponseField>

<ResponseField name="base_model_id" type="string">
  Base model ID if specified
</ResponseField>

<ResponseField name="name" type="string">
  Model's display name
</ResponseField>

<ResponseField name="params" type="object">
  Model parameters as provided
</ResponseField>

<ResponseField name="meta" type="object">
  Model metadata as provided
</ResponseField>

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

<ResponseField name="is_active" type="boolean">
  Whether the model is active
</ResponseField>

<ResponseField name="created_at" type="integer">
  Unix timestamp of creation
</ResponseField>

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

## Example Request

```bash theme={null}
curl -X POST "https://api.example.com/api/models/create" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "id": "my-custom-gpt4",
    "name": "My Custom GPT-4",
    "base_model_id": "gpt-4",
    "params": {
      "temperature": 0.7,
      "max_tokens": 2000,
      "top_p": 1.0
    },
    "meta": {
      "description": "Custom GPT-4 model for code generation",
      "capabilities": {
        "vision": true,
        "function_calling": true
      }
    },
    "access_grants": [
      {
        "access_type": "group",
        "access_id": "developers",
        "permission": "read"
      }
    ],
    "is_active": true
  }'
```

## Example Response

```json theme={null}
{
  "id": "my-custom-gpt4",
  "user_id": "user123",
  "base_model_id": "gpt-4",
  "name": "My Custom GPT-4",
  "params": {
    "temperature": 0.7,
    "max_tokens": 2000,
    "top_p": 1.0
  },
  "meta": {
    "profile_image_url": "/static/favicon.png",
    "description": "Custom GPT-4 model for code generation",
    "capabilities": {
      "vision": true,
      "function_calling": true
    }
  },
  "access_grants": [
    {
      "access_type": "group",
      "access_id": "developers",
      "permission": "read"
    }
  ],
  "is_active": true,
  "created_at": 1704067200,
  "updated_at": 1704067200
}
```

## Error Responses

<ResponseField name="401">
  Unauthorized - User does not have permission to create models

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

<ResponseField name="400">
  Bad Request - Model ID already exists or is too long

  ```json theme={null}
  {
    "detail": "Model ID is already taken"
  }
  ```

  ```json theme={null}
  {
    "detail": "Model ID is too long (max 256 characters)"
  }
  ```
</ResponseField>
