Ana içeriğe geç

Change a Model ID of an LLM Provider

Endpoint​

POST /apiops/projects/{projectName}/llm-providers/{providerName}/rename-model/

Authentication​

Requires a Personal API Access Token.

Authorization: Bearer YOUR_TOKEN

Request​

Headers​

HeaderValueRequired
AuthorizationBearer {token}Yes
Content-Typeapplication/jsonYes

Path Parameters​

ParameterTypeRequiredDescription
projectNamestringYesProject name
providerNamestringYesLLM provider name

Request Body​

{
"from": "gpt-4o-mini",
"to": "gpt-4o-mini-2026"
}
FieldTypeRequiredDescription
fromstringYesThe current model ID on the provider
tostringYesThe new model ID. It must differ from from

Response​

Success Response (200 OK)​

The call also returns 200 when the old model is kept. Read completed and leftovers to see the outcome.

{
"completed": true,
"moved": [
"API Proxy: chat-gateway",
"Policy Group: shared-guards",
"Limit Plan: engineering-daily"
],
"redeployed": [
"API Proxy: chat-gateway"
],
"leftovers": [],
"unreachedEnvironments": [],
"warnings": {
"refs": ["API Proxy: chat-gateway", "Policy Group: shared-guards"],
"drafts": [],
"conditionValues": [],
"knowledgeBases": [],
"limitAssignments": [],
"variableModels": [],
"limits": ["Limit Plan: engineering-daily"]
}
}

A response where the old model is kept:

{
"completed": false,
"moved": [
"API Proxy: chat-gateway"
],
"redeployed": [
"API Proxy: chat-gateway"
],
"leftovers": [
{ "label": "API Proxy: batch-gateway", "reason": "DRAFT" },
{ "label": "Limit Assignment: team-a", "reason": "LIMIT_TARGET" }
],
"unreachedEnvironments": ["test-env"],
"warnings": {
"refs": ["API Proxy: chat-gateway", "API Proxy: batch-gateway"],
"drafts": ["API Proxy: batch-gateway"],
"conditionValues": [],
"knowledgeBases": [],
"limitAssignments": ["Limit Assignment: team-a"],
"variableModels": [],
"limits": []
}
}

Response Fields​

FieldTypeDescription
completedbooleantrue when the new model is listed, all references moved, and the old model is removed. false when the old model is kept; leftovers says why
movedarray of stringThe records that now name the new ID, for example API Proxy: chat-gateway
redeployedarray of stringThe API proxies and proxy groups that were running and were deployed again
leftoversarray of objectThe records that stop the removal of the old model
leftovers[].labelstringThe record, for example API Proxy: batch-gateway
leftovers[].reasonstringWhy the record stops the removal. See the table below
unreachedEnvironmentsarray of stringEnvironments that the change could not reach and that do not run the model. They do not stop the change. They appear as failed in Deployment Results
warningsobjectWhat the change moves, as the Manager screen shows it before the change
warnings.refsarray of stringWhere the model is named
warnings.draftsarray of stringAPI proxies and proxy groups with undeployed changes
warnings.conditionValuesarray of stringConditional routes that compare the model text with the old ID. They are not changed
warnings.knowledgeBasesarray of stringKnowledge bases that name the model. The stored vectors are not computed again
warnings.limitsarray of stringLimit plans and assignments. The running limit window may start again
warnings.limitAssignmentsarray of stringLimit assignments that target the model. They do not move. End them and create ones for the new model
warnings.variableModelsarray of stringReferences that take their model ID from a variable (${...}, #{...}) that may name this model in an environment. They are not rewritten. The old model stays only while a value needs it

Leftover Reasons​

ReasonMeaningWhat to do
PROVIDER_DEPLOY_FAILEDThe provider could not be sent to the gatewaysResolve the deploy error, then repeat the call
DRAFTThe proxy or group has undeployed changes, so it was not deployed. It runs the old IDDeploy it, then repeat the call
DEPLOY_FAILEDThe deploy failed. It runs the old IDDeploy it again, then repeat the call
LIMIT_TARGETA limit assignment targets this model. A target cannot changeEnd the assignment and create one for the new model
LIMIT_NOT_WRITTENThe limit could not be written, for example a managed planChange the limit by hand
NOT_WRITTENThe record could not be writtenRepeat the call. Change the record by hand if it fails again
VARIABLE_MODELA reference takes its model ID from a variable. Apinizer resolves the variable in each environment and skips an environment with no value. In at least one environment the value reaches the old model and would reach no model once the old one is removed, or no environment knows a value (a request value #{...} counts as unknown). The old model stays and completed is falseCheck the value of the variable in each environment. Then delete the old model from the provider's model list. A variable that names another model, or a base name such as w that reaches the new row w:new, does not stop the change
REFERENCE_REMAINSThe record still names the old ID. For example, an entry of another provider has no model of its own and takes its ID from a target that would moveChange the record by hand

Error Response (400 Bad Request)​

{
"status": "FAILURE",
"resultMessage": "Model 'gpt-4o-mini' is not listed in this LLM provider"
}

A 400 also comes when from or to is empty, when the two IDs are equal, and when the provider is not found.

Two more refusals write nothing:

  • Access lists differ. The to ID is already a model of the provider, and its access list differs from the access list of the from model. An access list that is off counts as empty.
{
"status": "FAILURE",
"resultMessage": "Model 'gpt-4o-mini-2026' already exists with a different access list. Make the access lists the same, or use a new model id"
}
  • Missing permission. You lack the permission to edit, deploy or manage something that uses the model. The message names the assets.
{
"status": "FAILURE",
"resultMessage": "You do not have the permission to change these, so the model id was not changed: API Proxy: chat-gateway, Limit Plan: engineering-daily"
}

Error Response (401 Unauthorized)​

{
"status": "FAILURE",
"resultMessage": "Token is not valid!"
}

cURL Example​

curl -X POST \
"https://demo.apinizer.com/apiops/projects/MyProject/llm-providers/openai-primary/rename-model/" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{"from":"gpt-4o-mini","to":"gpt-4o-mini-2026"}'

Permissions​

  • User must have AI_DEVELOPMENT + MANAGE permission in the project
  • User must have the permission to change every affected asset: API proxies, policy groups, global policies, proxy groups, knowledge bases and limit plans, and to deploy the proxies and groups that were running. If one is missing, nothing is written.

Notes and Warnings​

  • Order of steps: The call adds the new model and deploys the provider, moves the references, deploys again what was running, and removes the old model last.
  • Repeat is safe: Repeat the same call after you resolve the leftovers. Each step looks at what is stored, and the call finishes the rest. A repeat after the old model was removed only deploys the provider again.
  • Undeployed changes: A proxy or group with undeployed changes is not deployed. It runs the old ID until its owner deploys it. Repeat the call after that.
  • Conditions are not changed: A condition on the model text of the client keeps its value. A client that sends the old ID still matches it and reaches the new ID.
  • Knowledge bases: The call changes the model ID that a knowledge base names. It does not compute the stored vectors again.
  • Name-based: The provider is addressed by providerName. The records in the response are named, never identified by internal ID.