Configure an LLM backend and endpoint

Requires Workspace model_backend.create.

POST https://api.moi.matrixorigin.cn/v5/llm/setup

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 model information in the same environment.

Request

curl --request POST \
  "$BASE_URL/llm/setup" \
  --header "X-API-Key: $MOI_KEY" \
  --header "X-Workspace-ID: $WORKSPACE_ID" \
  --header "Content-Type: application/json" \
  --data-raw '{"name":"临时后端","type":"OPENAI","api_key":"provider-key-example","address":"https://provider.example.invalid/v1","models":["chat-example"]}'

Parameter

Location

Type

Required

Description

X-Workspace-ID

Headers

string

Yes

Workspace ID in the same environment.

name

Body

string

Yes

Nonempty name after trimming surrounding whitespace.

type

Body

string

No

OPENAI/OLLAMA/VLLM/QIANWEN/DOUBAO/DEV_LLM/HTTP. Invalid/omitted values become OPENAI, still subject to formal owner validation.

api_key

Body

string

Conditionally required

Provider key required for OPENAI/QIANWEN/DOUBAO; not a product access token.

address

Body

string

Yes

New endpoint URL; must be nonempty after trimming.

models

Body

array (strings)

Yes

At least one valid, nonempty model name. No automatic capability probe.

timeout_seconds

Body

integer

No

Positive seconds. Omitted/nonpositive values become 120.

reasoning_control_protocol

Body

string

No

Defaults to NONE. See shared objects for available reasoning-control protocols.

Requires Workspace model_backend.create. One tenant transaction saves the backend and requested endpoint, returning HTTP 200. This writes configuration without probing or running a model. Query first for unknown outcomes; no business request_id deduplication is provided;

Successful response

{
  "code": "OK",
  "msg": "OK",
  "data": {
    "backend": {
      "id": 12,
      "name": "临时后端",
      "type": "OPENAI",
      "reasoning_control_protocol": "REASONING_CONTROL_NONE",
      "timeout_seconds": 120,
      "models": [
        "chat-example"
      ],
      "created_at": 1794445200,
      "updated_at": 1794445200
    },
    "endpoint": {
      "id": 21,
      "backend_id": 12,
      "address": "https://provider.example.invalid/v1",
      "status": "ONLINE",
      "created_at": 1794445200,
      "updated_at": 1794445200
    }
  }
}

Field

Type

Description

code

string

OK on success.

data

object

Model, probe, or configuration results.

Error responses

States and errors distinguishes string and numeric protocols. Confirm probe candidates, saved configuration, and actual inference separately.

Last updated on