FousDocs

Spend through the API

Review API run counts, failures and spending over the last 7 or 30 days.

GET/v1/usage

Runs made with an API key over the last 7 or 30 days, by day and by tool: spend in USD micros, runs and failures. Needs tools:read.

Requires Authorization: Bearer $FOUS_API_KEY. Create a key.

Query parameters

  • periodstringdefault "7d"

    "7d""30d"

Response 200

Success

  • successtruerequired
  • dataobjectrequired
    Show child attributesHide child attributes
    • periodstringrequired

      "7d""30d"

    • fromstringrequired
    • tostringrequired
    • total_usd_microsintegerrequired
    • runsintegerrequired
    • failedintegerrequired
    • seriesarray of objectrequired
      Show child attributesHide child attributes
      • datestringrequired
      • spend_usd_microsintegerrequired
      • runsintegerrequired
      • failedintegerrequired
    • workflowsarray of objectrequired

Errors

Every failure is an Error: branch on error.code. The errors guide lists each code.

  • 400
  • 401WWW-Authenticate
  • 402
  • 403
  • 404
  • 408
  • 409
  • 410
  • 413
  • 422
  • 429Retry-After
  • 500
  • 502
  • 503Retry-After
  • 504