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

# Update a custom model

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

## Request

- Base URL: `https://api.respan.ai`
- URL: `https://api.respan.ai/api/models/{model_name}/`
- Auth: one of:
  - HTTP bearer
  - HTTP bearer

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

## Path parameters

- `model_name` string, required

## Request body

- object
  - `base_model_name` string: Base model to inherit properties from.
  - `custom_provider_id` string: Custom provider string ID or provider identifier to associate.
  - `provider_id` string: Alternative to `custom_provider_id`.
  - `input_cost` number: Cost per 1M input tokens in USD.
  - `output_cost` number: Cost per 1M output tokens in USD.
  - `cache_hit_input_cost` number: Cost per 1M cached input tokens in USD.
  - `cache_creation_input_cost` number: Cost per 1M cache creation input tokens in USD.
  - `max_context_window` integer: Maximum context window size.
  - `function_call` 0 | 1
  - `image_support` 0 | 1
  - `supported_params_override` object: Partial override for the model's parameters: a map of parameter name to a parameter definition with the same shape as `supported_params` entries (`name`, `type`, `default`, `range` with `min` and `max`, `description`, `required`), or `null` to remove the parameter. Replaces any earlier override. The response returns the computed `supported_params`.

## Response `200`

Updated model.

- object
  - `id` string, required: Model string ID. Same value as `model_name`.
  - `model_name` string, required: Model name used in API calls.
  - `base_model_name` string: Base model inherited from, when configured.
  - `affiliation_category` 'keywordsai' | 'custom': `keywordsai` for built-in models, `custom` for your organization's models.
  - `is_called_by_custom_name` boolean: Whether requests are sent upstream using this custom model name.
  - `input_cost` number: Cost per 1M input tokens in USD.
  - `output_cost` number: Cost per 1M output tokens in USD.
  - `cache_hit_input_cost` number: Cost per 1M cached input tokens in USD.
  - `cache_creation_input_cost` number: Cost per 1M cache creation input tokens in USD.
  - `max_context_window` integer: Maximum context window size.
  - `function_call` 0 | 1: Function/tool calling support. `0` = no, `1` = yes.
  - `image_support` 0 | 1: Vision input support. `0` = no, `1` = yes.
  - `model_type` 'chat' | 'embedding' | 'audio': Model type.
  - `supported_params` object: Computed parameter support after applying model-specific overrides.
  - `provider` object
    - `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

## Other responses

- `400`: Bad Request
- `403`: The API key is missing, invalid or expired, or it doesn't have permission for this action.
- `404`: Not Found

## Changes

- **2026-10-21** `c30bcb383ee8`: 14 breaking, 4 warning, 16 info
  - removed the enum value `0` of the request property `function_call`
  - removed the enum value `0` of the request property `image_support`
  - removed the enum value `1` of the request property `function_call`
  - removed the enum value `1` of the request property `image_support`
  - …30 more
- **2026-10-02** `b830b79cfd52`: 10 warning, 3 info
  - removed the request property `display_name`
  - removed the request property `streaming_support`
  - removed the optional property `created_at` from the response with the `200` status
  - removed the optional property `display_name` from the response with the `200` status
  - …9 more
- **2026-09-17** `6fa8242da8c2`: 1 warning, 1 info
  - deleted the `header` request parameter `Authorization`
  - the endpoint scheme security `RespanApiKey` was added to the API
- **2026-09-12** `22b868ef3f22`: 1 info
  - api operation id `update-custom-model` removed and replaced with `models_updateCustomModel`

[Operation history](https://skmtc.dev/respan/apis/respan-api/changes/api/models/:model_name/patch.md)

---

[API](https://skmtc.dev/respan/apis/respan-api.md) - [All operations](https://skmtc.dev/respan/apis/respan-api/llms.txt) - [OpenAPI document](https://skmtc.dev/respan/apis/respan-api/revisions/900841387635?raw)
