查询 API 使用记录
curl --request POST \
--url https://dk.mountsea.ai/api-user/usage/search \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"dateRange": {
"start": 1767801600000,
"end": 1773071999999
},
"page": 1,
"limit": 10,
"serviceId": "<string>"
}
'import requests
url = "https://dk.mountsea.ai/api-user/usage/search"
payload = {
"dateRange": {
"start": 1767801600000,
"end": 1773071999999
},
"page": 1,
"limit": 10,
"serviceId": "<string>"
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
dateRange: {start: 1767801600000, end: 1773071999999},
page: 1,
limit: 10,
serviceId: '<string>'
})
};
fetch('https://dk.mountsea.ai/api-user/usage/search', 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://dk.mountsea.ai/api-user/usage/search",
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([
'dateRange' => [
'start' => 1767801600000,
'end' => 1773071999999
],
'page' => 1,
'limit' => 10,
'serviceId' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$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://dk.mountsea.ai/api-user/usage/search"
payload := strings.NewReader("{\n \"dateRange\": {\n \"start\": 1767801600000,\n \"end\": 1773071999999\n },\n \"page\": 1,\n \"limit\": 10,\n \"serviceId\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
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://dk.mountsea.ai/api-user/usage/search")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"dateRange\": {\n \"start\": 1767801600000,\n \"end\": 1773071999999\n },\n \"page\": 1,\n \"limit\": 10,\n \"serviceId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://dk.mountsea.ai/api-user/usage/search")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"dateRange\": {\n \"start\": 1767801600000,\n \"end\": 1773071999999\n },\n \"page\": 1,\n \"limit\": 10,\n \"serviceId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodyUsage & Credits
Search API Usage Logs
POST
/
api-user
/
usage
/
search
查询 API 使用记录
curl --request POST \
--url https://dk.mountsea.ai/api-user/usage/search \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"dateRange": {
"start": 1767801600000,
"end": 1773071999999
},
"page": 1,
"limit": 10,
"serviceId": "<string>"
}
'import requests
url = "https://dk.mountsea.ai/api-user/usage/search"
payload = {
"dateRange": {
"start": 1767801600000,
"end": 1773071999999
},
"page": 1,
"limit": 10,
"serviceId": "<string>"
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
dateRange: {start: 1767801600000, end: 1773071999999},
page: 1,
limit: 10,
serviceId: '<string>'
})
};
fetch('https://dk.mountsea.ai/api-user/usage/search', 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://dk.mountsea.ai/api-user/usage/search",
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([
'dateRange' => [
'start' => 1767801600000,
'end' => 1773071999999
],
'page' => 1,
'limit' => 10,
'serviceId' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$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://dk.mountsea.ai/api-user/usage/search"
payload := strings.NewReader("{\n \"dateRange\": {\n \"start\": 1767801600000,\n \"end\": 1773071999999\n },\n \"page\": 1,\n \"limit\": 10,\n \"serviceId\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
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://dk.mountsea.ai/api-user/usage/search")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"dateRange\": {\n \"start\": 1767801600000,\n \"end\": 1773071999999\n },\n \"page\": 1,\n \"limit\": 10,\n \"serviceId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://dk.mountsea.ai/api-user/usage/search")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"dateRange\": {\n \"start\": 1767801600000,\n \"end\": 1773071999999\n },\n \"page\": 1,\n \"limit\": 10,\n \"serviceId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodyResponse Example
{
"items": [
{
"id": 52,
"serviceName": "chat",
"apiPath": "/v1/chat/completions",
"apiMethod": "POST",
"apiKey": "3a43****a987",
"amount": 15,
"statusCode": 200,
"traceId": "1d110e91-9d69-4325-bd42-b55583ae6dc5",
"metadata": {
"model": "gpt-5.1"
},
"createdAt": "2025-08-06T09:36:54.083Z"
}
],
"meta": {
"totalItems": 256,
"itemCount": 10,
"itemsPerPage": 10,
"totalPages": 26,
"currentPage": 1
}
}
Response Fields
items[] — Usage Log Records
| Field | Type | Description |
|---|---|---|
id | number | Record ID |
serviceName | string | Service name (e.g. chat, gemini) |
apiPath | string | API request path |
apiMethod | string | HTTP method (GET, POST, etc.) |
apiKey | string | API Key used (masked) |
amount | number | Credits consumed |
statusCode | number | HTTP response status code |
traceId | string | Request trace ID for troubleshooting |
metadata | object | null | Additional metadata (e.g. model name, token usage) |
createdAt | string | Created time (ISO 8601) |
meta — Pagination Info
| Field | Type | Description |
|---|---|---|
totalItems | number | Total number of records |
itemCount | number | Number of records on current page |
itemsPerPage | number | Page size |
totalPages | number | Total number of pages |
currentPage | number | Current page number |
The
dateRange parameter is required. The maximum date range span is 90 days. Timestamps are in milliseconds.⌘I