---
title: "Update a custom model"
method: PATCH
path: "/api/models/{model_name}/"
tags: ["models"]
---

# Update a custom model

`PATCH /api/models/{model_name}/`

Partially update editable fields for a custom model. The `model_name` field is read-only.

## Path parameters

- `model_name` string, required

## Headers

- `Authorization` string, required

## Request body

- object
  - `base_model_name` string — Base model to inherit properties from.
  - `display_name` string — Human-readable display name.
  - `custom_provider_id` string — Custom provider string ID or provider identifier to associate.
  - `provider_id` string — Alternative to `custom_provider_id`.
  - `input_cost` number, double — Cost per 1M input tokens in USD.
  - `output_cost` number, double — Cost per 1M output tokens in USD.
  - `cache_hit_input_cost` number, double — Cost per 1M cached input tokens in USD.
  - `cache_creation_input_cost` number, double — Cost per 1M cache creation input tokens in USD.
  - `max_context_window` integer — Maximum context window size.
  - `streaming_support` '0' | '1'
  - `function_call` '0' | '1'
  - `image_support` '0' | '1'
  - `supported_params_override` object — Partial override for model parameter support. The response returns computed `supported_params`.

## Response `200`

Updated model.

- ModelsUpdateCustomModelResponse200
  - `id` string, required — Model string ID. Same value as `model_name`.
  - `model_name` string, required — Model name used in API calls.
  - `display_name` string — Human-readable model name.
  - `base_model_name` string — Base model inherited from, when configured.
  - `affiliation_category` 'respan' | 'custom' — Whether the model is built in or organization-specific.
  - `is_called_by_custom_name` boolean — Whether requests are sent upstream using this custom model name.
  - `input_cost` number, double — Cost per 1M input tokens in USD.
  - `output_cost` number, double — Cost per 1M output tokens in USD.
  - `cache_hit_input_cost` number, double — Cost per 1M cached input tokens in USD.
  - `cache_creation_input_cost` number, double — Cost per 1M cache creation input tokens in USD.
  - `max_context_window` integer — Maximum context window size.
  - `streaming_support` '0' | '1' — Streaming support. `0` = no, `1` = yes.
  - `function_call` '0' | '1' — Function/tool calling support. `0` = no, `1` = yes.
  - `image_support` '0' | '1' — Vision input support. `0` = no, `1` = yes.
  - `source` 'db' | 'hardcoded' — Source of the model definition.
  - `model_type` 'chat' | 'embedding' | 'audio' — Model type.
  - `supported_params` object — Computed parameter support after applying model-specific overrides.
  - `throughput` ApiModelsModelNamePatchResponsesContentApplicationJsonSchemaThroughput
    - `average_tps` number, double, nullable — Average output tokens per second over the recent global window.
    - `average_ttft` number, double, nullable — Average time to first token in seconds over the recent global window.
    - `average_latency` number, double, nullable — Average request latency in seconds over the recent global window.
    - `number_of_requests` integer, nullable — Request count over the recent global window.
  - `provider` ApiModelsModelNamePatchResponsesContentApplicationJsonSchemaProvider
    - `id` string, required — Provider string ID. Same value as `provider_id`.
    - `provider_id` string, required — Unique provider identifier within your organization.
    - `provider_name` string, required — Human-readable provider name.
    - `extra_kwargs` object — Provider configuration such as `base_url` and timeout values. Secret values are not returned here.
    - `created_at` string, date-time, nullable
    - `updated_at` string, date-time, nullable
  - `created_at` string, date-time, nullable
  - `updated_at` string, date-time, nullable

## Other responses

- `400` — Bad Request
- `401` — Unauthorized - Missing or invalid authentication
- `403` — Forbidden
- `404` — Not Found

---

[API](https://skmtc.net/keywordsai/apis/api-reference.md) · [All operations](https://skmtc.net/keywordsai/apis/api-reference/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/keywordsai/api-reference/revisions/4e064cf81dae/schema)
