基准测试
获取基准数据
检索指定时间窗口内的平台整体性能基准数据。
GET
/
api
/
v1
/
benchmarks
获取基准数据
curl --request GET \
--url https://api.example.com/api/v1/benchmarksimport requests
url = "https://api.example.com/api/v1/benchmarks"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/api/v1/benchmarks', 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.example.com/api/v1/benchmarks",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/v1/benchmarks"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/api/v1/benchmarks")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/benchmarks")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"window": "<string>",
"latency_by_mode": {},
"ttft_by_mode": {},
"classification": {},
"counters": {}
}查询参数
string
用于聚合的时间窗口。可选值:
24h、7d、30d。默认值:24h。响应
string
所请求的时间窗口。
object
按模式统计的延迟数据:
{ [mode]: { p50, p95, p99, count } }。object
按模式统计的首个令牌延迟数据(仅适用于流式):
{ [mode]: { p50, p95, count } }。object
意图分类延迟:
{ p50, p95, count }。若该时间窗口内没有自动模式请求,则为 null。object
聚合计数器:
total、failover_count、routing_accuracy、total_tokens、total_cost_cents、by_mode。认证
需要提供 API 密钥或仪表盘会话。示例
curl
curl "https://www.hitheo.ai/api/v1/benchmarks?window=24h" \
-H "Authorization: Bearer $THEO_API_KEY"
响应
{
"window": "24h",
"latency_by_mode": {
"fast": { "p50": 450, "p95": 1200, "p99": 2100, "count": 1543 },
"code": { "p50": 890, "p95": 2400, "p99": 4100, "count": 312 }
},
"ttft_by_mode": {
"fast": { "p50": 180, "p95": 450, "count": 1200 }
},
"classification": { "p50": 12, "p95": 310, "count": 890 },
"counters": {
"total": 2847,
"failover_count": 3,
"routing_accuracy": 0.94,
"total_tokens": 4520000,
"total_cost_cents": 1250,
"by_mode": { "fast": 1543, "code": 312, "image": 201 }
},
"bucket": "2026-04-16T05"
}
此页面对您有帮助吗?
获取基准数据
curl --request GET \
--url https://api.example.com/api/v1/benchmarksimport requests
url = "https://api.example.com/api/v1/benchmarks"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/api/v1/benchmarks', 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.example.com/api/v1/benchmarks",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/v1/benchmarks"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/api/v1/benchmarks")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/benchmarks")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"window": "<string>",
"latency_by_mode": {},
"ttft_by_mode": {},
"classification": {},
"counters": {}
}