تخطَّ إلى المحتوى

هذه الوثائق متاحة حاليًا باللغة الإنجليزية فقط.

وثائق المطورينAPI referenceAccount

Get usage

Requests, jobs, credits, compute seconds and vehicles per UTC day.

GEThttps://runner.cargoduo.com/v1/usage

Without from/to: the last 30 days. At most 92 days per call.

المصادقة

مفتاح API من نوع Bearer بالصلاحيةaccount:readاعرف المزيد

معاملات الاستعلام

الاسمالنوعمطلوبالوصف
fromstring
string
لا

First day, YYYY-MM-DD (UTC).

tostring
string
لا

Last day, YYYY-MM-DD (UTC). Defaults to today.

مثال على الطلب

curl -X GET "https://runner.cargoduo.com/v1/usage?from=2026-10-17&to=2026-10-19" \
  -H "Authorization: Bearer $CARGODUO_API_KEY"

مثال على الاستجابة

200 OK · Usage
{
  "data": [
    {
      "date": "2026-10-17",
      "requests": 41,
      "jobs": 9,
      "credits": 2.931,
      "compute_seconds": 38.2,
      "vehicles": 11
    },
    {
      "date": "2026-10-18",
      "requests": 12,
      "jobs": 3,
      "credits": 0.829,
      "compute_seconds": 9.8,
      "vehicles": 3
    },
    {
      "date": "2026-10-19",
      "requests": 27,
      "jobs": 6,
      "credits": 1.867,
      "compute_seconds": 21.4,
      "vehicles": 7
    }
  ]
}

الاستجابات

  • 200OKOne row per day.
    الاسمالنوعمطلوبالوصف
    dataUsageDay[]
    UsageDay[]
    لا
  • 401Unauthorizedunauthorizedkey_revokedkey_expired
    • unauthorizedMissing, malformed or unknown API key.
    • key_revokedThe key was revoked.
    • key_expiredThe key passed its expiry date.
    الاسمالنوعمطلوبالوصف
    errorErrorBodyمطلوب
    ErrorBody
    نعم
    كل رموز الأخطاء
  • 403Forbiddenip_not_allowedsubscription_inactiveaccount_inactivescope_missing
    • ip_not_allowedThe calling IP is not on the key's allowlist.
    • subscription_inactiveThe organization has no active subscription that includes the API.
    • account_inactiveThe organization is suspended, or has no owner whose account is active.
    • scope_missingThe key lacks a scope this endpoint needs.
    الاسمالنوعمطلوبالوصف
    errorErrorBodyمطلوب
    ErrorBody
    نعم
    كل رموز الأخطاء
  • 422Unprocessable entityvalidation_failed
    • validation_failedThe request is well-formed JSON but describes an invalid job. details[] lists every problem.
    الاسمالنوعمطلوبالوصف
    errorErrorBodyمطلوب
    ErrorBody
    نعم
    كل رموز الأخطاء
  • 429Too many requestsrate_limited
    • rate_limitedToo many requests in the current minute, hour or day (per key or per organization), or more than 60 failed authentications per minute from your IP address.
    الاسمالنوعمطلوبالوصف
    errorErrorBodyمطلوب
    ErrorBody
    نعم
    كل رموز الأخطاء
  • 500Internal server errorinternal_error
    • internal_errorSomething failed on our side.
    الاسمالنوعمطلوبالوصف
    errorErrorBodyمطلوب
    ErrorBody
    نعم
    كل رموز الأخطاء
  • 503Service unavailableapi_disabled
    • api_disabledThe API is temporarily disabled (maintenance) or switched off for the organization.
    الاسمالنوعمطلوبالوصف
    errorErrorBodyمطلوب
    ErrorBody
    نعم
    كل رموز الأخطاء