Логи и задачи (Расширенный API)

Use your Account Permission Key to query call logs, token/cost summaries, and async task records across all personal tokens or filtered by a specific kid.

[!IMPORTANT]

  • Base URL: https://ai.artsmcp.com/api/open/v1
  • Auth Header (Choose One): Authorization: Bearer <your_account_key>, X-Account-Api-Key: <your_account_key>, or X-Api-Key: <your_account_key>
  • Pagination & Rate Limits: Online pagination supports up to the first 20,000 records; /logs is rate-limited to 30 req/min and /task_logs to 60 req/min; timestamps use the site operating timezone

1. List Account-Wide Call Logs

Paginated query of model calls across all personal tokens or a specified kid. Summary stats (total_cost, success_count, total_tokens, etc.) are computed on page=1 only (defaulting to the past 30 calendar days when start_date is omitted) and return 0 on page > 1.

  • Path: GET /api/open/v1/logs
  • Query Parameters:
ParameterTypeDefaultDescription
pageinteger1Page number (starting from 1)
per_pageinteger20Items per page (1..100)
kidstringAllFilter by token kid (alias: token_kid)
modelstringAllFuzzy filter by model ID (e.g., gpt-4o)
statusstringAllFilter by status: success, fail, processing
status_codeintegerAllFilter by exact HTTP status code (e.g., 200, 429)
action_typestringAllFilter by modality: chat, image, video, audio, embedding, rerank, vision, other
log_idstringNoneExact lookup by log_id
task_idstringNoneExact lookup by async task_id
start_datestringNoneStart time (YYYY-MM-DD or YYYY-MM-DD HH:mm:ss)
end_datestringNoneEnd time (YYYY-MM-DD or YYYY-MM-DD HH:mm:ss)
has_videointegerAllFilter by video input (1 yes, 0 no)
  • Example (Curl):
curl -s "https://ai.artsmcp.com/api/open/v1/logs?page=1&per_page=20&kid=086421" \
  -H "Authorization: Bearer <your_account_key>"
  • Response Example:
{
  "data": [
    {
      "log_id": "log_01jdxyz1234567890abcdef",
      "token_kid": "086421",
      "token_name": "production-app",
      "model": "gpt-4o",
      "endpoint": "/v1/chat/completions",
      "action_type": "chat",
      "prompt_tokens": 320,
      "completion_tokens": 512,
      "cached_tokens": 0,
      "cost": 0.0098,
      "pre_deduct_gift": 0.0,
      "latency_ms": 920,
      "status_code": 200,
      "is_stream": 1,
      "is_completed": 1,
      "has_video": 0,
      "created_at": "2026-11-29 21:30:15 (UTC+8)"
    }
  ],
  "total": 1,
  "page": 1,
  "per_page": 20,
  "total_cost": 0.0098,
  "total_system_cost": 0.0098,
  "total_gift_cost": 0.0,
  "success_count": 1,
  "fail_count": 0,
  "total_tokens": 832,
  "total_prompt_tokens": 320,
  "total_completion_tokens": 512
}
  • Response Fields:
FieldTypeDescription
dataarrayCall log records on the current page
data[].log_idstringUnique log identifier
data[].token_kid / data[].token_namestringToken kid and name
data[].model / data[].endpointstringModel ID and request path
data[].action_typestringRequest category (e.g., chat, image, video, audio)
data[].prompt_tokens / data[].completion_tokens / data[].cached_tokensintegerInput, output, and cached token counts
data[].cost / data[].pre_deduct_giftnumberSettled total cost and gift balance portion
data[].latency_msintegerRequest latency in milliseconds
data[].status_codeintegerHTTP status code (0 while processing)
data[].is_stream / data[].is_completed / data[].has_videointegerStreaming flag, completion flag, and video-input flag (1 yes, 0 no)
data[].created_atstringCreation timestamp in site operating timezone
total / page / per_pageintegerTotal matching records, current page, and page size
total_cost / total_system_cost / total_gift_costnumberTotal, cash, and gift cost summaries (page=1 only)
success_count / fail_countintegerSucceeded and failed request counts (page=1 only)
total_tokens / total_prompt_tokens / total_completion_tokensintegerTotal, input, and output token summaries (page=1 only)

2. List Account-Wide Async Tasks

Paginated query of video/image async generation tasks and preview URLs across all personal tokens or a specified kid.

  • Path: GET /api/open/v1/task_logs
  • Query Parameters:
ParameterTypeDefaultDescription
pageinteger1Page number (starting from 1)
per_pageinteger20Items per page (1..100)
kidstringAllFilter by token kid (alias: token_kid)
modelstringAllFuzzy filter by model ID
statusstringAllFilter by status: success, fail, processing
action_typestringAllFilter by task type (e.g., image, video, audio)
log_idstringNoneExact lookup by log_id
task_idstringNoneExact lookup by async task_id
start_datestringNoneStart time (YYYY-MM-DD or YYYY-MM-DD HH:mm:ss)
end_datestringNoneEnd time (YYYY-MM-DD or YYYY-MM-DD HH:mm:ss)
  • Example (Curl):
curl -s "https://ai.artsmcp.com/api/open/v1/task_logs?page=1&per_page=20" \
  -H "Authorization: Bearer <your_account_key>"
  • Response Example:
{
  "data": [
    {
      "log_id": "log_01jdvideo9876543210abcd",
      "task_id": "cgt-20261129210000-xxxxx",
      "token_kid": "086421",
      "token_name": "production-app",
      "model": "doubao-seedance-1-0-pro-250528",
      "endpoint": "/v1/video/generations",
      "action_type": "video",
      "prompt_tokens": 0,
      "completion_tokens": 108000,
      "cached_tokens": 0,
      "cost": 1.5,
      "latency_ms": 42000,
      "status_code": 200,
      "is_completed": 1,
      "has_video": 0,
      "preview_urls": [
        "https://example-cdn.com/videos/output.mp4"
      ],
      "created_at": "2026-11-29 21:10:00 (UTC+8)"
    }
  ],
  "total": 1,
  "page": 1,
  "per_page": 20
}
  • Response Fields:
FieldTypeDescription
dataarrayAsync task records on the current page
data[].log_id / data[].task_idstringLog ID and async task ID
data[].token_kid / data[].token_namestringToken kid and name
data[].model / data[].endpointstringModel ID and submission path
data[].action_typestringTask type (e.g., video, image)
data[].prompt_tokens / data[].completion_tokens / data[].cached_tokensintegerInput, output, and cached token counts
data[].cost / data[].latency_msnumber / integerSettled task cost and latency (ms)
data[].status_code / data[].is_completedintegerTerminal HTTP status code and completion flag (1 done, 0 processing)
data[].preview_urlsstring[]Output preview URLs once completed
data[].created_atstringTask submission timestamp in site operating timezone
total / page / per_pageintegerTotal records, current page, and page size

Raw Markdown (.md) · llms.txt