验证 MCP OAuth
curl --request POST \
--url https://agent-api.bigmodel.cn/api/agent/managed/v1/vaults/{vaultId}/credentials/{credentialId}/mcp_oauth_validate \
--header 'Authorization: Bearer <token>' \
--header 'zai-beta: <zai-beta>' \
--header 'zai-version: <zai-version>'import requests
url = "https://agent-api.bigmodel.cn/api/agent/managed/v1/vaults/{vaultId}/credentials/{credentialId}/mcp_oauth_validate"
headers = {
"zai-version": "<zai-version>",
"zai-beta": "<zai-beta>",
"Authorization": "Bearer <token>"
}
response = requests.post(url, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'zai-version': '<zai-version>',
'zai-beta': '<zai-beta>',
Authorization: 'Bearer <token>'
}
};
fetch('https://agent-api.bigmodel.cn/api/agent/managed/v1/vaults/{vaultId}/credentials/{credentialId}/mcp_oauth_validate', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));HttpResponse<String> response = Unirest.post("https://agent-api.bigmodel.cn/api/agent/managed/v1/vaults/{vaultId}/credentials/{credentialId}/mcp_oauth_validate")
.header("zai-version", "<zai-version>")
.header("zai-beta", "<zai-beta>")
.header("Authorization", "Bearer <token>")
.asString();package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://agent-api.bigmodel.cn/api/agent/managed/v1/vaults/{vaultId}/credentials/{credentialId}/mcp_oauth_validate"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("zai-version", "<zai-version>")
req.Header.Add("zai-beta", "<zai-beta>")
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://agent-api.bigmodel.cn/api/agent/managed/v1/vaults/{vaultId}/credentials/{credentialId}/mcp_oauth_validate",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"zai-beta: <zai-beta>",
"zai-version: <zai-version>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"type": "vault_credential_validation",
"credential_id": "<string>",
"vault_id": "<string>",
"validated_at": "2023-11-07T05:31:56Z",
"has_refresh_token": true,
"status": "valid",
"mcp_probe": {
"method": "initialize",
"http_response": {
"status_code": 123,
"content_type": "<string>",
"body": "<string>",
"body_truncated": true
}
},
"refresh": {
"status": "succeeded",
"http_response": {
"status_code": 123,
"content_type": "<string>",
"body": "<string>",
"body_truncated": true
}
}
}{
"type": "error",
"error": {
"type": "invalid_request_error",
"message": "<string>",
"details": {}
},
"request_id": "req_01J..."
}Vault
验证 MCP OAuth
验证指定 MCP OAuth Credential 当前是否能访问其 MCP Server。该操作只执行连通性与认证校验,不返回敏感 Token。点击 Try it 按钮可快速试用。
POST
/
agent
/
managed
/
v1
/
vaults
/
{vaultId}
/
credentials
/
{credentialId}
/
mcp_oauth_validate
验证 MCP OAuth
curl --request POST \
--url https://agent-api.bigmodel.cn/api/agent/managed/v1/vaults/{vaultId}/credentials/{credentialId}/mcp_oauth_validate \
--header 'Authorization: Bearer <token>' \
--header 'zai-beta: <zai-beta>' \
--header 'zai-version: <zai-version>'import requests
url = "https://agent-api.bigmodel.cn/api/agent/managed/v1/vaults/{vaultId}/credentials/{credentialId}/mcp_oauth_validate"
headers = {
"zai-version": "<zai-version>",
"zai-beta": "<zai-beta>",
"Authorization": "Bearer <token>"
}
response = requests.post(url, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'zai-version': '<zai-version>',
'zai-beta': '<zai-beta>',
Authorization: 'Bearer <token>'
}
};
fetch('https://agent-api.bigmodel.cn/api/agent/managed/v1/vaults/{vaultId}/credentials/{credentialId}/mcp_oauth_validate', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));HttpResponse<String> response = Unirest.post("https://agent-api.bigmodel.cn/api/agent/managed/v1/vaults/{vaultId}/credentials/{credentialId}/mcp_oauth_validate")
.header("zai-version", "<zai-version>")
.header("zai-beta", "<zai-beta>")
.header("Authorization", "Bearer <token>")
.asString();package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://agent-api.bigmodel.cn/api/agent/managed/v1/vaults/{vaultId}/credentials/{credentialId}/mcp_oauth_validate"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("zai-version", "<zai-version>")
req.Header.Add("zai-beta", "<zai-beta>")
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://agent-api.bigmodel.cn/api/agent/managed/v1/vaults/{vaultId}/credentials/{credentialId}/mcp_oauth_validate",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"zai-beta: <zai-beta>",
"zai-version: <zai-version>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"type": "vault_credential_validation",
"credential_id": "<string>",
"vault_id": "<string>",
"validated_at": "2023-11-07T05:31:56Z",
"has_refresh_token": true,
"status": "valid",
"mcp_probe": {
"method": "initialize",
"http_response": {
"status_code": 123,
"content_type": "<string>",
"body": "<string>",
"body_truncated": true
}
},
"refresh": {
"status": "succeeded",
"http_response": {
"status_code": 123,
"content_type": "<string>",
"body": "<string>",
"body_truncated": true
}
}
}{
"type": "error",
"error": {
"type": "invalid_request_error",
"message": "<string>",
"details": {}
},
"request_id": "req_01J..."
}Headers
Managed Agents API 协议版本,固定为 2026-05-26。
Available options:
2026-05-26 Example:
"2026-05-26"
必须包含 managed-agents-2026-05-26;可与其他 beta 标识用逗号分隔。
Example:
"managed-agents-2026-05-26"
Response
请求成功。
Available options:
vault_credential_validation 验证时间。
Available options:
valid, invalid, unknown Show child attributes
Show child attributes
Show child attributes
Show child attributes
Was this page helpful?