Skip to main content
GET
https://agentgate.mynewapi.com
/
api
/
v1
/
usage
/
work-orders
/
{workOrderId}
Get Work Order Usage
curl --request GET \
  --url https://agentgate.mynewapi.com/api/v1/usage/work-orders/{workOrderId} \
  --header 'Authorization: Bearer <token>'
{
  "success": true,
  "data": {
    "totalInputTokens": 123,
    "totalOutputTokens": 123,
    "totalCachedInputTokens": 123,
    "totalCostUsd": 123,
    "executionCount": 123,
    "workOrderCount": 123,
    "totalDurationMs": 123,
    "byModel": {},
    "periodStart": "<string>",
    "periodEnd": "<string>"
  }
}

Get Work Order Usage

Returns aggregated usage summary for a specific work order.

Request

workOrderId
string
required
The work order ID to get usage for
curl https://agentgate.mynewapi.com/api/v1/usage/work-orders/wo_abc123 \
  -H "Authorization: Bearer YOUR_API_KEY"

Response

success
boolean
required
Indicates if the request was successful
data
object
required
Work order usage summary

Example Response

{
  "success": true,
  "data": {
    "totalInputTokens": 45200,
    "totalOutputTokens": 8500,
    "totalCachedInputTokens": 28000,
    "totalCostUsd": 1.23,
    "executionCount": 3,
    "workOrderCount": 1,
    "totalDurationMs": 125000,
    "byModel": {
      "claude-sonnet-4-20250514": {
        "inputTokens": 45200,
        "outputTokens": 8500,
        "cachedInputTokens": 28000,
        "costUsd": 1.23,
        "executionCount": 3
      }
    },
    "periodStart": "2024-01-15T10:30:00.000Z",
    "periodEnd": "2024-01-15T10:35:25.000Z"
  }
}

Use Cases

  • Track costs per task
  • Analyze iteration efficiency
  • Compare work order complexity
  • Per-task billing attribution