检查接口
curl --request POST \
--url https://api.glasser.ai/v1/endpoints/inspect \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"provider": "<string>",
"endpoint": "<string>",
"endpoint_version": 1,
"task_id": "<string>",
"metadata": {}
}
'import requests
url = "https://api.glasser.ai/v1/endpoints/inspect"
payload = {
"provider": "<string>",
"endpoint": "<string>",
"endpoint_version": 1,
"task_id": "<string>",
"metadata": {}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
provider: '<string>',
endpoint: '<string>',
endpoint_version: 1,
task_id: '<string>',
metadata: {}
})
};
fetch('https://api.glasser.ai/v1/endpoints/inspect', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.glasser.ai/v1/endpoints/inspect",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'provider' => '<string>',
'endpoint' => '<string>',
'endpoint_version' => 1,
'task_id' => '<string>',
'metadata' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.glasser.ai/v1/endpoints/inspect"
payload := strings.NewReader("{\n \"provider\": \"<string>\",\n \"endpoint\": \"<string>\",\n \"endpoint_version\": 1,\n \"task_id\": \"<string>\",\n \"metadata\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.glasser.ai/v1/endpoints/inspect")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"provider\": \"<string>\",\n \"endpoint\": \"<string>\",\n \"endpoint_version\": 1,\n \"task_id\": \"<string>\",\n \"metadata\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.glasser.ai/v1/endpoints/inspect")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"provider\": \"<string>\",\n \"endpoint\": \"<string>\",\n \"endpoint_version\": 1,\n \"task_id\": \"<string>\",\n \"metadata\": {}\n}"
response = http.request(request)
puts response.read_body{
"provider": "<string>",
"provider_label": "<string>",
"endpoint": "<string>",
"endpoint_version": 123,
"name": "<string>",
"description": "<string>",
"tags": [
"<string>"
],
"price": {
"rule": {
"type": "flat",
"amount_usd": "<string>"
},
"display": {
"amount_usd": "<string>",
"unit": "<string>",
"cap_usd": "<string>"
},
"charges": {
"NO_RESULT": "<string>",
"PROVIDER_ERROR": "<string>",
"TIMED_OUT": "<string>",
"INTERNAL": "<string>"
}
},
"run_mode": "sync",
"method": "GET",
"input_schema": {},
"output_schema": {},
"output_schema_source": "provider",
"sample_input": {},
"doc_url": "<string>",
"timeout_ms": 1,
"client": {
"client_version": "<string>",
"minimum_version": "<string>",
"latest_version": "<string>",
"upgrade_command": "<string>",
"reason": "<string>"
}
}{
"error": {
"code": "validation_failed",
"message": "<string>",
"reason": "<string>",
"control": "<string>",
"retry_after_ms": 123,
"details": {}
},
"request_id": "<string>"
}{
"error": {
"code": "unauthorized",
"message": "<string>",
"reason": "<string>",
"control": "<string>",
"retry_after_ms": 123,
"details": {}
},
"request_id": "<string>"
}{
"error": {
"code": "forbidden",
"message": "<string>",
"reason": "<string>",
"control": "<string>",
"retry_after_ms": 123,
"details": {}
},
"request_id": "<string>"
}{
"error": {
"code": "not_found",
"message": "<string>",
"reason": "<string>",
"control": "<string>",
"retry_after_ms": 123,
"details": {}
},
"request_id": "<string>"
}{
"error": {
"code": "endpoint_version_mismatch",
"message": "<string>",
"reason": "<string>",
"control": "<string>",
"retry_after_ms": 123,
"details": {}
},
"request_id": "<string>"
}{
"error": {
"code": "rate_limited",
"message": "<string>",
"reason": "<string>",
"control": "<string>",
"retry_after_ms": 123,
"details": {}
},
"request_id": "<string>"
}接口
检查接口
获取接口 Schema、当前价格和示例输入,为 Run 准备请求。
POST
/
v1
/
endpoints
/
inspect
检查接口
curl --request POST \
--url https://api.glasser.ai/v1/endpoints/inspect \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"provider": "<string>",
"endpoint": "<string>",
"endpoint_version": 1,
"task_id": "<string>",
"metadata": {}
}
'import requests
url = "https://api.glasser.ai/v1/endpoints/inspect"
payload = {
"provider": "<string>",
"endpoint": "<string>",
"endpoint_version": 1,
"task_id": "<string>",
"metadata": {}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
provider: '<string>',
endpoint: '<string>',
endpoint_version: 1,
task_id: '<string>',
metadata: {}
})
};
fetch('https://api.glasser.ai/v1/endpoints/inspect', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.glasser.ai/v1/endpoints/inspect",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'provider' => '<string>',
'endpoint' => '<string>',
'endpoint_version' => 1,
'task_id' => '<string>',
'metadata' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.glasser.ai/v1/endpoints/inspect"
payload := strings.NewReader("{\n \"provider\": \"<string>\",\n \"endpoint\": \"<string>\",\n \"endpoint_version\": 1,\n \"task_id\": \"<string>\",\n \"metadata\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.glasser.ai/v1/endpoints/inspect")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"provider\": \"<string>\",\n \"endpoint\": \"<string>\",\n \"endpoint_version\": 1,\n \"task_id\": \"<string>\",\n \"metadata\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.glasser.ai/v1/endpoints/inspect")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"provider\": \"<string>\",\n \"endpoint\": \"<string>\",\n \"endpoint_version\": 1,\n \"task_id\": \"<string>\",\n \"metadata\": {}\n}"
response = http.request(request)
puts response.read_body{
"provider": "<string>",
"provider_label": "<string>",
"endpoint": "<string>",
"endpoint_version": 123,
"name": "<string>",
"description": "<string>",
"tags": [
"<string>"
],
"price": {
"rule": {
"type": "flat",
"amount_usd": "<string>"
},
"display": {
"amount_usd": "<string>",
"unit": "<string>",
"cap_usd": "<string>"
},
"charges": {
"NO_RESULT": "<string>",
"PROVIDER_ERROR": "<string>",
"TIMED_OUT": "<string>",
"INTERNAL": "<string>"
}
},
"run_mode": "sync",
"method": "GET",
"input_schema": {},
"output_schema": {},
"output_schema_source": "provider",
"sample_input": {},
"doc_url": "<string>",
"timeout_ms": 1,
"client": {
"client_version": "<string>",
"minimum_version": "<string>",
"latest_version": "<string>",
"upgrade_command": "<string>",
"reason": "<string>"
}
}{
"error": {
"code": "validation_failed",
"message": "<string>",
"reason": "<string>",
"control": "<string>",
"retry_after_ms": 123,
"details": {}
},
"request_id": "<string>"
}{
"error": {
"code": "unauthorized",
"message": "<string>",
"reason": "<string>",
"control": "<string>",
"retry_after_ms": 123,
"details": {}
},
"request_id": "<string>"
}{
"error": {
"code": "forbidden",
"message": "<string>",
"reason": "<string>",
"control": "<string>",
"retry_after_ms": 123,
"details": {}
},
"request_id": "<string>"
}{
"error": {
"code": "not_found",
"message": "<string>",
"reason": "<string>",
"control": "<string>",
"retry_after_ms": 123,
"details": {}
},
"request_id": "<string>"
}{
"error": {
"code": "endpoint_version_mismatch",
"message": "<string>",
"reason": "<string>",
"control": "<string>",
"retry_after_ms": 123,
"details": {}
},
"request_id": "<string>"
}{
"error": {
"code": "rate_limited",
"message": "<string>",
"reason": "<string>",
"control": "<string>",
"retry_after_ms": 123,
"details": {}
},
"request_id": "<string>"
}按
input_schema 构造请求,并在运行前检查价格。将 endpoint_version 用于 Run;版本不会锁定价格。同步接口的客户端超时应高于 timeout_ms。请求体
application/json
Pattern:
^[a-z0-9][a-z0-9-]*$Pattern:
^\/.+$选择受支持的接口版本,包括旧版本;省略则使用默认版本。版本不可用或已停用时返回 409。
必填范围:
x > 0本次检查所属 Task,来自数据源搜索响应,接受任意稳定字符串。
可选追踪字段,随 Run 返回,也可用于筛选。不会发送给数据提供商,也不影响路由、价格或幂等。
- 最多 20 个键:小写字母、数字和下划线,以字母开头,最长 40 个字符。
- 值:长度为 1–500 的字符串。
- user_id:终端用户的不透明 ID,不得使用邮箱或姓名。
无效条目整体丢弃,不截断。请求继续执行,Run 返回实际保存的字段。
Show child attributes
Show child attributes
响应
成功
Pattern:
^[a-z0-9][a-z0-9-]*$数据提供商品牌名称,仅用于展示,例如 provider 为 pdl 时显示 People Data Labs。身份仍由 provider 标识,运行和检查时使用 provider,不传回此展示名称。
Pattern:
^\/.+$受支持的接口版本。兼容更新保持此版本号。
当前价格及计费规则。价格可在不更改接口版本的情况下变化。新 Run 使用受理时价格,已受理 Run 保留该价格。
Show child attributes
Show child attributes
可用选项:
sync, async 可用选项:
GET, POST, PUT, PATCH, DELETE, HEAD Run 输入的数据提供商原生 JSON Schema。
成功输出的 JSON Schema。没有可靠 Schema 时为 null,示例响应不构成 Schema。
输出 Schema 的定义方:数据提供商或 Glasser。output_schema 为 null 时,此值也为 null。
可用选项:
provider, glasser 示例输入。根据请求调整,并按 input_schema 校验。
数据提供商文档链接,如有。
同步接口从 Run 请求到终态响应的最长毫秒数。HTTP 客户端超时应高于此值。
必填范围:
x > 0Show child attributes
Show child attributes