Skip to main content
GET
/
sessions
/
metering
/
{sessionId}
Get Session Metering Reports
curl --request GET \
  --url https://api.mulerun.com/sessions/metering/{sessionId} \
  --header 'Authorization: Bearer <token>'
{
  "status": "success",
  "data": {
    "sessionId": "987e6543-e21b-45cd-b678-123456789abc",
    "sessionStatus": "completed",
    "reportCount": 3,
    "isFinalReported": true,
    "meteringRecords": [
      {
        "meteringId": "abc123efg-456h-789i-jklm-123nop456qr",
        "isFinal": false
      },
      {
        "meteringId": "def456hij-789k-012l-mnop-456qrs789tuv",
        "isFinal": false
      },
      {
        "meteringId": "ghi789klm-012n-345o-pqrs-789tuv012wxy",
        "isFinal": true
      }
    ]
  }
}
This API allows agent creators to query the usage costs for a given session and retrieve its current session status.

Session Status Values

The sessionStatus field in the response indicates the current state of the session:
Status ValueDescription
runningThe session is active and can accept new metering requests
completedThe session has ended normally (either isFinal=true was reported or the session terminated properly)
errorThe session ended abnormally (e.g., platform failure or other errors)

Response Data

The API returns comprehensive information about the session including:
  • sessionId: Unique identifier of the session
  • sessionStatus: Current status of the session (running, completed, or error)
  • reportCount: Total number of successfully processed metering reports
  • isFinalReported: Whether the final report has been received
  • meteringRecords: Array of all successfully processed metering records with their meteringId and isFinal status

Authentication

Authentication is done using your Agent Key as a Bearer token in the Authorization header.

Use Cases

This API is useful for:
  • Verifying that metering reports were successfully received and processed
  • Checking the current status of a session
  • Confirming that the final report was received
  • Debugging billing discrepancies
  • Monitoring active sessions

Authorizations

Authorization
string
header
required

Use your Agent Key as the Bearer token

Path Parameters

sessionId
string<uuid>
required

Unique identifier of the session

Response

Success response

status
enum<string>

Status of the request

Available options:
success
Example:

"success"

data
object