Test model connection. POST /api/openapi/v1/models/connection-tests, scope admin.v1.models.manage.
- Scope:
admin.v1.models.manage - Permission: Manage Models
- Action: manage
- Endpoint: POST
/api/openapi/v1/models/connection-tests
Authorization: Bearer \<API_KEY\>. The application must have subject_scope={"mode":"all"}; restricted scopes return 403. Scopes are independently granted. Do not cache responses.
Model configuration covers BYOK custom models and system-model listing.
Creation reuses UI test-and-save: probe first, persist nothing on failure, and save without activating on success. models/connection-tests is an independent preflight that persists neither model nor credentials.
BYOK feature and management gates, endpoint restrictions and credential handling remain unchanged. Lists remain paginated. Creation requires Idempotency-Key.
No update, deletion, activation or credential-rotation operation is added.
Common request headers
Apply the “Authentication and headers” section in “Configure the QwenWork console through APIs”: Authorization is required and X-Request-Id is optional. See this page for the required scope.
Whether Idempotency-Key applies and is required is specified in this page’s request parameters; a tracing identifier does not replace an idempotency key.
Request parameters
Request body: required; Content-Type: application/json.
| Name | Location | Type | Required | Description | Example |
|---|---|---|---|---|---|
api_key | body | string · password | null | No | api key; format="password", maxLength=8192 | - |
endpoint_url | body | string · uri | Yes | endpoint url; format="uri", maxLength=2048 | - |
pass_third_party_user_id | body | boolean | No | pass third party user id | - |
protocol_profile | body | string | Yes | protocol profile; enum=["openai_chat_completions_v1"] Values: "openai_chat_completions_v1" | - |
upstream_model | body | string | Yes | upstream model; maxLength=255 | - |
Response statuses
| HTTP status | Trigger | Response structure | Client action |
|---|---|---|---|
200 | Request succeeded | See “Response” on this page | Read the response. |
default | Other authentication, authorization, validation or dependency errors | See “General error” in “Configure the QwenWork console through APIs” | Handle the status and code; verify the result and idempotency requirements before retrying writes. |
Response
Content-Type: application/json
| Name | Type | Required | Description | Example |
|---|---|---|---|---|
code | string | Yes | Stable business error code | - |
result | string | Yes | result; enum=["success", "failed"] Values: "failed", "success" | - |