Update an LLM backend through the workspace API¶
Change a specified LLM backend’s name, declared models, and supported configuration fields.
PUT https://api.moi.matrixorigin.cn/v5/workspaces/{workspace_id}/llm/backends/{backend_id}
Before you call this API¶
Set BASE_URL to the product API prefix https://api.moi.matrixorigin.cn/v5; use the corresponding product API URL for a dedicated deployment.
Configure identity, workspace, and object permissions in the same environment.
Request¶
curl --request PUT \
"$BASE_URL/workspaces/$WORKSPACE_ID/llm/backends/$BACKEND_ID" \
--header "X-API-Key: $MOI_KEY" \
--header "X-Workspace-ID: $WORKSPACE_ID" \
--header "Content-Type: application/json" \
--data-raw '{"name":"更新后","reasoning_control_protocol":0,"origin_ref":"","origin_version":""}'
Parameter |
Location |
Type |
Required |
Description |
|---|---|---|---|---|
|
Headers |
string |
Yes |
Workspace ID in the same environment. |
|
Path |
string |
Yes |
Workspace ID in the same environment. |
|
Path |
integer |
Yes |
Positive ID returned by a preceding read. |
|
Body |
string |
No |
Omission, null, empty strings, or whitespace-only strings retain the old name. |
|
Body |
string |
No |
Nonempty values replace it. Omission, null, or empty values retain it; empty values cannot clear credentials. |
|
Body |
integer |
No |
Updates only for a positive number. Omission, null, or nonpositive values retain it. |
|
Body |
array (strings) or null |
No |
Omission/null retain values; [] clears them; a nonempty array replaces all values. |
|
Body |
integer or null |
No |
LLM only: omission/null retain it; 0 explicitly resets NONE; other valid values are 1–5. |
|
Body |
string or null |
No |
LLM only: omission/null retain it. Only external_provider is accepted explicitly; empty strings rejected. |
|
Body |
string or null |
No |
LLM only: omission/null retain it; an empty string clears it. |
|
Body |
string or null |
No |
LLM only: omission/null retain it; an empty string clears it. |
Requires object model_backend.update. Type is absent from the update structure. No business request_id/CAS protection is supported. Reread required fields after writing. Current dedicated Go/Python/CLI clients omit models=[]. Use a call that preserves the complete HTTP array for clearing. An omitted empty models response field may also mean an empty set.
Successful response¶
{
"code": 0,
"data": {
"id": 12,
"name": "更新后",
"timeout_seconds": 120,
"models": [
"chat-example"
],
"created_at": 1794445200,
"updated_at": 1794445200,
"provider_origin": "external_provider",
"api_key_encrypted": "provider-key-example"
}
}
HTTP 200。
Field |
Type |
Description |
|---|---|---|
|
integer |
0 on success. |
|
object |
Error responses¶
Errors and result confirmation distinguishes the two protocols. Parse omitted fields, SDK zero values, and empty HTTP responses separately. Confirm writes with the corresponding reads.