Verifying a Provider
Function
Verifies the provider connectivity and API key validity.
Debugging
You can debug this API through automatic authentication in API Explorer or use the SDK sample code generated by API Explorer.
Authorization Information
Each account has all the permissions required to call all APIs, but IAM users must be assigned the required permissions.
- If you are using role/policy-based authorization, see Permissions Policies and Supported Actions for details on the required permissions.
- If you are using identity policy-based authorization, the following identity policy-based permissions are required.
Action
Access Level
Resource Type (*: required)
Condition Key
Alias
Dependencies
workspace:modelProvider:verify
Write
-
-
-
-
URI
POST /v3/ai-agents/model-providers/verify
Request Parameters
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| id | No | String | Primary key ID of the provider. If this parameter is specified, other empty fields are supplemented from the provider records saved in the database. |
| provider_type | No | String | Provider type. |
| provider_id | No | String | Provider ID (ID after template instantiation). |
| api_key | No | String | API key of the provider (encrypted using SCC). |
| api_type | No | String | API protocol type (OpenAI/Anthropic). |
| base_url | No | String | Provider base URL. |
| custom_config | No | ProviderCustomConfig object | Customized configuration content. |
| model_id | No | String | ID of the model used to verify the connection. This parameter is transferred as the model parameter when the Chat Completion API is called. |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| model_list_api | No | String | Address of the model list API, which is used to query the provider's remote models. |
| auth_header | No | String | Name of the authentication request header. |
| auth_prefix | No | String | Authentication prefix (for example, Bearer). |
| model_id_field | No | String | Field name of the model ID in the provider model list. |
| model_name_field | No | String | Field name of the model name in the provider model list. |
| headers | No | Map<String,String> | Customized HTTP request header, which is added when the provider API is called. |
Response Parameters
Status code: 200
| Parameter | Type | Description |
|---|---|---|
| provider_id | String | Provider ID. |
| success | Boolean | Whether the verification is successful. |
| message | String | Verification result. |
Status code: 400
| Parameter | Type | Description |
|---|---|---|
| error_code | String | Error code, which is returned upon failure. |
| error_msg | String | Error message. |
Status code: 401
| Parameter | Type | Description |
|---|---|---|
| error_code | String | Error code, which is returned upon failure. |
| error_msg | String | Error message. |
Status code: 403
| Parameter | Type | Description |
|---|---|---|
| error_code | String | Error code, which is returned upon failure. |
| error_msg | String | Error message. |
Status code: 422
| Parameter | Type | Description |
|---|---|---|
| error_code | String | Error code, which is returned upon failure. |
| error_msg | String | Error message. |
Status code: 500
| Parameter | Type | Description |
|---|---|---|
| error_code | String | Error code, which is returned upon failure. |
| error_msg | String | Error message. |
Example Requests
None
Example Responses
None
Status Codes
| Status Code | Description |
|---|---|
| 200 | Operation successful. |
| 400 | The request cannot be understood by the server due to malformed syntax. |
| 401 | Authorization failed. |
| 403 | No permissions. |
| 422 | Verification fails. |
| 500 | Internal server error. |
Error Codes
See Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot