---
title: "Replace Custom Model"
method: PUT
path: "/api/models/{model_name}/"
tags: ["models"]
---

# Replace Custom Model

`PUT /api/models/{model_name}/`

PUT handler with superadmin lock and field protection.

Same as patch() - checks lock and field protection before delegating.

## Path parameters

- `model_name` string, required

## Headers

- `Authorization` string, required

## Request body

- PublicModelUpdateRequest — Public API serializer for updating models - hides internal fields. ``status`` is writable here but the view blocks non-superadmins from changing it (``superadmin_only_fields``).
  - `supported_params_override` union
    - unknown
    - unknown
  - `affiliation_category` 'custom' | 'keywordsai' — * `custom` - Custom * `keywordsai` - Keywordsai
  - `is_managed` boolean
  - `is_called_by_custom_name` boolean
  - `base_model_name` string
  - `display_name` string
  - `max_context_window` integer
  - `input_cost` number, double
  - `output_cost` number, double
  - `cache_hit_input_cost` number, double
  - `cache_creation_input_cost` number, double
  - `respan_discount_rate` number, double, nullable
  - `streaming_support` integer
  - `function_call` integer
  - `image_support` integer
  - `overridden_fields` string[]
  - `load_balance_backups` unknown
  - `status` 'active' | 'deprecated' — * `active` - Active * `deprecated` - Deprecated
  - `is_verified` boolean — Whether the model's pricing has been human-verified. Unverified auto-discovered models are kept out of the live model dictionary.
  - `source` 'hardcoded' | 'db' — * `hardcoded` - Synced from Code * `db` - Database Only
  - `model_type` 'chat' | 'embedding' | 'audio' — * `chat` - Chat * `embedding` - Embedding * `audio` - Audio
  - `metadata` PublicModelUpdateRequestMetadata — Flexible catalog metadata; known keys are documented, extras allowed.
    - `privacy_policy_url` string, nullable
    - `zero_data_retention` boolean, nullable
    - `prompt_training` boolean, nullable
    - `prompt_logging` boolean, nullable
    - `moderation` boolean, nullable
    - `is_available_on_credits` boolean, nullable
    - `stream_cancellation_supported` boolean, nullable
    - `precision` string, nullable
    - `quantization` string, nullable
    - `release_date` string, nullable
    - `context_size` integer, nullable
    - `weekly_tokens` integer, nullable
    - `daily_tokens` integer, nullable
    - `benchmarks` ModelBenchmarksMetadata — Source-keyed benchmark blobs on ``LLMModel.metadata.benchmarks``.
      - `deepswe` DeepSWEBenchmarkPayload — Full DeepSWE v1.1 leaderboard row stored at ``metadata.benchmarks.deepswe``. Includes artifact envelope fields (``version``, ``generated_at``, ``n_tasks_in_set``) plus the complete best-config row from DeepSWE (``pass_rate``, ``pass_at_4``, cost/token aggregates, confidence intervals, etc.).
        - `version` string, nullable
        - `generated_at` string, nullable
        - `n_tasks_in_set` integer, nullable
        - `model` string, nullable
        - `harness` string, nullable
        - `reasoning_effort` string, nullable
        - `config` string, nullable
        - `source` string, nullable
        - `pass_rate` number, double, nullable
        - `pass_at_1` number, double, nullable
        - `pass_at_4` number, double, nullable
  - `provider` integer, nullable

## Response `200`

- PublicModelUpdate — Public API serializer for updating models - hides internal fields. ``status`` is writable here but the view blocks non-superadmins from changing it (``superadmin_only_fields``).
  - `project` string, nullable, required
  - `affiliation_category` 'custom' | 'keywordsai' — * `custom` - Custom * `keywordsai` - Keywordsai
  - `is_managed` boolean
  - `is_called_by_custom_name` boolean
  - `model_name` string, required
  - `base_model_name` string
  - `display_name` string
  - `max_context_window` integer
  - `input_cost` number, double
  - `output_cost` number, double
  - `cache_hit_input_cost` number, double
  - `cache_creation_input_cost` number, double
  - `respan_discount_rate` number, double, nullable
  - `streaming_support` integer
  - `function_call` integer
  - `image_support` integer
  - `overridden_fields` string[]
  - `load_balance_backups` unknown
  - `status` 'active' | 'deprecated' — * `active` - Active * `deprecated` - Deprecated
  - `is_verified` boolean — Whether the model's pricing has been human-verified. Unverified auto-discovered models are kept out of the live model dictionary.
  - `source` 'hardcoded' | 'db' — * `hardcoded` - Synced from Code * `db` - Database Only
  - `model_type` 'chat' | 'embedding' | 'audio' — * `chat` - Chat * `embedding` - Embedding * `audio` - Audio
  - `metadata` PublicModelUpdateMetadata — Flexible catalog metadata; known keys are documented, extras allowed.
    - `privacy_policy_url` string, nullable
    - `zero_data_retention` boolean, nullable
    - `prompt_training` boolean, nullable
    - `prompt_logging` boolean, nullable
    - `moderation` boolean, nullable
    - `is_available_on_credits` boolean, nullable
    - `stream_cancellation_supported` boolean, nullable
    - `precision` string, nullable
    - `quantization` string, nullable
    - `release_date` string, nullable
    - `context_size` integer, nullable
    - `weekly_tokens` integer, nullable
    - `daily_tokens` integer, nullable
    - `benchmarks` ModelBenchmarksMetadata — Source-keyed benchmark blobs on ``LLMModel.metadata.benchmarks``.
      - `deepswe` DeepSWEBenchmarkPayload — Full DeepSWE v1.1 leaderboard row stored at ``metadata.benchmarks.deepswe``. Includes artifact envelope fields (``version``, ``generated_at``, ``n_tasks_in_set``) plus the complete best-config row from DeepSWE (``pass_rate``, ``pass_at_4``, cost/token aggregates, confidence intervals, etc.).
        - `version` string, nullable
        - `generated_at` string, nullable
        - `n_tasks_in_set` integer, nullable
        - `model` string, nullable
        - `harness` string, nullable
        - `reasoning_effort` string, nullable
        - `config` string, nullable
        - `source` string, nullable
        - `pass_rate` number, double, nullable
        - `pass_at_1` number, double, nullable
        - `pass_at_4` number, double, nullable
  - `provider` integer, nullable

---

[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/versions/c26d550029f8/schema)
