---
updatedAt: 2025-09-02T07:17:19.000Z
agentTools:
  projectIndex: https://jamaibase.readme.io/llms.txt
---

# Update a model config.

Permissions: `system.MEMBER`.

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "JamAI Base API",
    "license": {
      "name": "Apache 2.0",
      "url": "https://www.apache.org/licenses/LICENSE-2.0.html"
    },
    "version": "0.1.0",
    "x-logo": {
      "url": "https://www.jamaibase.com/favicon.svg"
    }
  },
  "servers": [
    {
      "url": "https://api.jamaibase.com"
    }
  ],
  "paths": {
    "/api/v2/models/configs": {
      "patch": {
        "tags": [
          "Models (Internal API)"
        ],
        "summary": "Update a model config.",
        "description": "Permissions: `system.MEMBER`.",
        "operationId": "update_model_config_api_v2_models_configs_patch",
        "parameters": [
          {
            "name": "model_id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "description": "Deployment ID.",
              "title": "Model Id"
            },
            "description": "Deployment ID."
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Service key.",
              "title": "Authorization"
            },
            "description": "Service key."
          },
          {
            "name": "X-USER-ID",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "description": "User ID.",
              "default": "",
              "title": "X-User-Id"
            },
            "description": "User ID."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ModelConfigUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ModelConfigRead"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Deployment_": {
        "properties": {
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At",
            "description": "Creation datetime (UTC)."
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Updated At",
            "description": "Update datetime (UTC)."
          },
          "meta": {
            "additionalProperties": true,
            "type": "object",
            "title": "Meta",
            "description": "Metadata.",
            "default": {}
          },
          "name": {
            "type": "string",
            "maxLength": 255,
            "title": "Name",
            "description": "Name for the deployment."
          },
          "routing_id": {
            "type": "string",
            "title": "Routing Id",
            "description": "Model routing / mapping ID. Must follow the following format: `{provider}/{model_id}`.Example: `openai/gpt-4o-mini`.",
            "default": ""
          },
          "api_base": {
            "type": "string",
            "title": "Api Base",
            "description": "(Optional) Hosting url. Required for creating external cloud deployment using custom providers. Example: `http://vllm-endpoint.xyz/v1`.",
            "default": ""
          },
          "provider": {
            "type": "string",
            "title": "Provider",
            "description": "Provider of the model.",
            "default": ""
          },
          "weight": {
            "type": "integer",
            "title": "Weight",
            "description": "Routing weight. Must be >= 0. A deployment is selected according to its relative weight.",
            "default": 1
          },
          "cooldown_until": {
            "type": "string",
            "format": "date-time",
            "title": "Cooldown Until",
            "description": "Cooldown until datetime (UTC)."
          },
          "model_id": {
            "type": "string",
            "title": "Model Id",
            "description": "Model ID."
          },
          "id": {
            "type": "string",
            "title": "Id",
            "description": "Deployment ID."
          }
        },
        "type": "object",
        "required": [
          "created_at",
          "updated_at",
          "name",
          "model_id",
          "id"
        ],
        "title": "Deployment_"
      },
      "HTTPValidationError": {
        "properties": {
          "detail": {
            "items": {
              "$ref": "#/components/schemas/ValidationError"
            },
            "type": "array",
            "title": "Detail"
          }
        },
        "type": "object",
        "title": "HTTPValidationError"
      },
      "ModelCapability": {
        "type": "string",
        "enum": [
          "completion",
          "chat",
          "tool",
          "image",
          "audio",
          "embed",
          "rerank",
          "reasoning"
        ],
        "title": "ModelCapability"
      },
      "ModelConfigRead": {
        "properties": {
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At",
            "description": "Creation datetime (UTC)."
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Updated At",
            "description": "Update datetime (UTC)."
          },
          "meta": {
            "additionalProperties": true,
            "type": "object",
            "title": "Meta",
            "description": "Metadata.",
            "default": {}
          },
          "id": {
            "type": "string",
            "title": "Id",
            "description": "Unique identifier. Users will specify this to select a model. Must follow the following format: `{provider}/{model_id}`. Examples=['openai/gpt-4o-mini', 'Qwen/Qwen2.5-0.5B']",
            "default": ""
          },
          "type": {
            "$ref": "#/components/schemas/ModelType",
            "description": "Model type. Can be completion, chat, embed, or rerank."
          },
          "name": {
            "type": "string",
            "maxLength": 255,
            "title": "Name",
            "description": "Model name that is more user friendly."
          },
          "owned_by": {
            "type": "string",
            "title": "Owned By",
            "description": "Model owner.",
            "default": ""
          },
          "capabilities": {
            "items": {
              "$ref": "#/components/schemas/ModelCapability"
            },
            "type": "array",
            "title": "Capabilities",
            "description": "List of capabilities of model."
          },
          "context_length": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "title": "Context Length",
            "description": "Context length of model. Examples=[4096]"
          },
          "languages": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Languages",
            "description": "List of languages which the model is well-versed in. \"*\" and \"mul\" resolves to ['zh', 'en', 'fr', 'it', 'ja', 'ko', 'es'].",
            "default": [
              "en"
            ],
            "examples": [
              [
                "en"
              ],
              [
                "en",
                "zh-CN"
              ]
            ]
          },
          "max_output_tokens": {
            "anyOf": [
              {
                "type": "integer",
                "exclusiveMinimum": 0
              },
              {
                "type": "null"
              }
            ],
            "title": "Max Output Tokens",
            "description": "Maximum number of output tokens, if not specified, will be based on context length."
          },
          "timeout": {
            "type": "number",
            "title": "Timeout",
            "description": "Timeout in seconds. Must be greater than 0. Defaults to 30 minutes.",
            "default": 108000
          },
          "priority": {
            "type": "integer",
            "title": "Priority",
            "description": "Priority for fallback model selection. The larger the number, the higher the priority.",
            "default": 0
          },
          "allowed_orgs": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Allowed Orgs",
            "description": "List of IDs of organizations allowed to use this model. If empty, all orgs are allowed. Allow list is applied first, followed by block list.",
            "default": []
          },
          "blocked_orgs": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Blocked Orgs",
            "description": "List of IDs of organizations NOT allowed to use this model. If empty, no org is blocked. Allow list is applied first, followed by block list.",
            "default": []
          },
          "llm_input_cost_per_mtoken": {
            "type": "number",
            "title": "Llm Input Cost Per Mtoken",
            "description": "Cost in USD per million (mega) input / prompt token.",
            "default": -1
          },
          "llm_output_cost_per_mtoken": {
            "type": "number",
            "title": "Llm Output Cost Per Mtoken",
            "description": "Cost in USD per million (mega) output / completion token.",
            "default": -1
          },
          "embedding_size": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Embedding Size",
            "description": "The default embedding size of the model. For example: `openai/text-embedding-3-large` has `embedding_size` of 3072 but can be shortened to `embedding_dimensions` of 256; `cohere/embed-v4.0` has `embedding_size` of 1536 but can be shortened to `embedding_dimensions` of 256."
          },
          "embedding_dimensions": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Embedding Dimensions",
            "description": "Reduced embedding size. Defaults to None (no reduction). For example: `openai/text-embedding-3-large` has `embedding_size` of 3072 but can be shortened to `embedding_dimensions` of 256; `cohere/embed-v4.0` has `embedding_size` of 1536 but can be shortened to `embedding_dimensions` of 256."
          },
          "embedding_transform_query": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Embedding Transform Query",
            "description": "Transform query that might be needed, especially for HuggingFace models."
          },
          "embedding_cost_per_mtoken": {
            "type": "number",
            "title": "Embedding Cost Per Mtoken",
            "description": "Cost in USD per million embedding tokens.",
            "default": -1
          },
          "reranking_cost_per_ksearch": {
            "type": "number",
            "title": "Reranking Cost Per Ksearch",
            "description": "Cost in USD for a thousand searches.",
            "default": -1
          },
          "is_private": {
            "type": "boolean",
            "title": "Is Private",
            "description": "Whether this is a private model visible only to select organizations.",
            "default": false
          },
          "deployments": {
            "items": {
              "$ref": "#/components/schemas/Deployment_"
            },
            "type": "array",
            "title": "Deployments",
            "description": "List of model deployment configs."
          },
          "is_active": {
            "type": "boolean",
            "title": "Is Active",
            "description": "Whether this model is active and ready for inference."
          }
        },
        "type": "object",
        "required": [
          "created_at",
          "updated_at",
          "type",
          "name",
          "capabilities",
          "context_length",
          "deployments",
          "is_active"
        ],
        "title": "ModelConfigRead"
      },
      "ModelConfigUpdate": {
        "properties": {
          "meta": {
            "additionalProperties": true,
            "type": "object",
            "title": "Meta",
            "description": "Metadata.",
            "default": {}
          },
          "id": {
            "type": "string",
            "title": "Id",
            "description": "Unique identifier. Users will specify this to select a model. Must follow the following format: `{provider}/{model_id}`. Examples=['openai/gpt-4o-mini', 'Qwen/Qwen2.5-0.5B']",
            "default": ""
          },
          "type": {
            "$ref": "#/components/schemas/ModelType",
            "description": "Model type. Can be completion, llm, embed, or rerank.",
            "default": "",
            "examples": [
              "llm"
            ]
          },
          "name": {
            "type": "string",
            "maxLength": 255,
            "title": "Name",
            "description": "Model name that is more user friendly.",
            "default": "",
            "examples": [
              "OpenAI GPT-4o Mini"
            ]
          },
          "owned_by": {
            "type": "string",
            "title": "Owned By",
            "description": "Model owner.",
            "default": ""
          },
          "capabilities": {
            "items": {
              "$ref": "#/components/schemas/ModelCapability"
            },
            "type": "array",
            "minItems": 1,
            "title": "Capabilities",
            "description": "List of capabilities of model.",
            "default": [],
            "examples": [
              [
                "chat"
              ],
              [
                "chat",
                "audio"
              ]
            ]
          },
          "context_length": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "title": "Context Length",
            "description": "Context length of model.",
            "default": 4096,
            "examples": [
              4096
            ]
          },
          "languages": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Languages",
            "description": "List of languages which the model is well-versed in. \"*\" and \"mul\" resolves to ['zh', 'en', 'fr', 'it', 'ja', 'ko', 'es'].",
            "default": [
              "en"
            ],
            "examples": [
              [
                "en"
              ],
              [
                "en",
                "zh-CN"
              ]
            ]
          },
          "max_output_tokens": {
            "anyOf": [
              {
                "type": "integer",
                "exclusiveMinimum": 0
              },
              {
                "type": "null"
              }
            ],
            "title": "Max Output Tokens",
            "description": "Maximum number of output tokens, if not specified, will be based on context length."
          },
          "timeout": {
            "type": "number",
            "title": "Timeout",
            "description": "Timeout in seconds. Must be greater than 0. Defaults to 30 minutes.",
            "default": 108000
          },
          "priority": {
            "type": "integer",
            "title": "Priority",
            "description": "Priority for fallback model selection. The larger the number, the higher the priority.",
            "default": 0
          },
          "allowed_orgs": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Allowed Orgs",
            "description": "List of IDs of organizations allowed to use this model. If empty, all orgs are allowed. Allow list is applied first, followed by block list.",
            "default": []
          },
          "blocked_orgs": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Blocked Orgs",
            "description": "List of IDs of organizations NOT allowed to use this model. If empty, no org is blocked. Allow list is applied first, followed by block list.",
            "default": []
          },
          "llm_input_cost_per_mtoken": {
            "type": "number",
            "title": "Llm Input Cost Per Mtoken",
            "description": "Cost in USD per million (mega) input / prompt token.",
            "default": -1
          },
          "llm_output_cost_per_mtoken": {
            "type": "number",
            "title": "Llm Output Cost Per Mtoken",
            "description": "Cost in USD per million (mega) output / completion token.",
            "default": -1
          },
          "embedding_size": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Embedding Size",
            "description": "The default embedding size of the model. For example: `openai/text-embedding-3-large` has `embedding_size` of 3072 but can be shortened to `embedding_dimensions` of 256; `cohere/embed-v4.0` has `embedding_size` of 1536 but can be shortened to `embedding_dimensions` of 256."
          },
          "embedding_dimensions": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Embedding Dimensions",
            "description": "Reduced embedding size. Defaults to None (no reduction). For example: `openai/text-embedding-3-large` has `embedding_size` of 3072 but can be shortened to `embedding_dimensions` of 256; `cohere/embed-v4.0` has `embedding_size` of 1536 but can be shortened to `embedding_dimensions` of 256."
          },
          "embedding_transform_query": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Embedding Transform Query",
            "description": "Transform query that might be needed, especially for HuggingFace models."
          },
          "embedding_cost_per_mtoken": {
            "type": "number",
            "title": "Embedding Cost Per Mtoken",
            "description": "Cost in USD per million embedding tokens.",
            "default": -1
          },
          "reranking_cost_per_ksearch": {
            "type": "number",
            "title": "Reranking Cost Per Ksearch",
            "description": "Cost in USD for a thousand searches.",
            "default": -1
          }
        },
        "type": "object",
        "title": "ModelConfigUpdate"
      },
      "ModelType": {
        "type": "string",
        "enum": [
          "completion",
          "llm",
          "embed",
          "rerank"
        ],
        "title": "ModelType"
      },
      "ValidationError": {
        "properties": {
          "loc": {
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer"
                }
              ]
            },
            "type": "array",
            "title": "Location"
          },
          "msg": {
            "type": "string",
            "title": "Message"
          },
          "type": {
            "type": "string",
            "title": "Error Type"
          }
        },
        "type": "object",
        "required": [
          "loc",
          "msg",
          "type"
        ],
        "title": "ValidationError"
      }
    },
    "securitySchemes": {
      "Authentication": {
        "type": "http",
        "scheme": "bearer"
      }
    }
  },
  "security": [
    {
      "Authentication": []
    }
  ]
}
```