Save parser routing configuration

Save parser routing configuration and read it back.

PUT https://api.moi.matrixorigin.cn/v5/parser/router

Before you call this API

Set BASE_URL to the product API prefix https://api.moi.matrixorigin.cn/v5. For private deployments, use the corresponding product API URL.

Configure identity, Workspace, and permissions in the same environment.

Request

curl --request PUT \
  "$BASE_URL/parser/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

X-Workspace-ID

Headers

string

Yes

Workspace ID in the same environment.

strategy

Body

string

No

ROUND_ROBIN/LEAST_CONNECTIONS/MODEL_BASED. Invalid/omitted values become ROUND_ROBIN.

health_check_interval

Body

integer

No

Positive seconds. Nonpositive/omitted values become 30.

max_retries

Body

integer

No

Nonpositive/omitted values become 0.

session_affinity

Body

boolean

No

Omission/null means false and overwrites the previous value.

Requires Workspace model_router.update. Writes complete configuration using request values and defaults. The selected Parser selector currently uses MIME priority and candidate rotation without consuming strategy. Back up first, and read back/restore within the same environment.

Verify saved values with Get Router. This does not establish actual selector effects. Restore the original backed-up values within the same environment.

Successful response

{
  "code": "OK",
  "msg": "OK",
  "data": {
    "strategy": "ROUND_ROBIN",
    "health_check_interval": 30,
    "max_retries": 1,
    "session_affinity": false
  }
}

Field

Type

Description

code

string

HTTP200, OK on success.

msg

string

OK on success.

data

object

Actual objects or empty values; do not infer them from LLM envelopes.

Error responses

Errors and result confirmation distinguishes actual input, object admission, and business results.

Last updated on