Write LLM routing configuration through the root API¶
Write the complete LLM routing configuration for the current workspace.
PUT https://api.moi.matrixorigin.cn/v5/llm/router
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/llm/router" \
--header "X-API-Key: $MOI_KEY" \
--header "X-Workspace-ID: $WORKSPACE_ID" \
--header "Content-Type: application/json" \
--data-raw '{"strategy":"ROUND_ROBIN","health_check_interval":30,"max_retries":1,"session_affinity":false}'
Parameter |
Location |
Type |
Required |
Description |
|---|---|---|---|---|
|
Headers |
string |
Yes |
Workspace ID in the same environment. |
|
Body |
string |
No |
Three defined strings. Omission or an invalid value uses ROUND_ROBIN. |
|
Body |
integer |
No |
Positive seconds. Omission or nonpositive values use 30. |
|
Body |
integer |
No |
LLM: nonpositive values use 0. Embedding: nonpositive values use 2. |
|
Body |
boolean |
No |
Omission or null uses false, overwriting the old configuration. |
Requires workspace model_router.update. Writes complete configuration using the request and defaults, rather than preserving omitted fields as a patch. Save old values before writing and reread afterward. Configuration success does not establish verified routing, session affinity, or retries.
Successful response¶
{
"code": "OK",
"msg": "OK",
"data": {
"strategy": "ROUND_ROBIN",
"health_check_interval": 30,
"max_retries": 1,
"session_affinity": false
}
}
HTTP 200。
Field |
Type |
Description |
|---|---|---|
|
string |
OK on success. |
|
string |
OK 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.