v4

latestOpenAPI 3.0.22026-08-02109239415.7 KB
manage

Retrieve usage information segmented by time period with tool-specific breakdowns

get/manage/api/usage

Query parameters

organization_idstring required

Base64 encoded organization ID to filter usage information for a specific organization

segment_by'DAY' | 'HOUR' required

Time segment granularity for usage breakdown

Example:DAY

Time segment granularity for usage breakdown

start_timestring date-time required

Start time for usage information

end_timestring date-time

Inclusive end time for usage information. If not provided, the current time will be used.

model_versionsModelVersion[]

Filter usage information by specific model versions

[
  "V_0_3"
]
toolsToolType[]

Filter usage information by specific tool types

[
  "GENERATE"
]
api_key_idsstring[]

Filter usage information by specific API key IDs

user_emailsstring[]

Filter usage information by specific user email addresses (for web app usage)

source'API' | 'APP'

Filter usage by source - API for programmatic API usage, APP for web application usage

Filter usage by source - API for programmatic API usage, APP for web application usage. Defaults to API.

Response

Usage information retrieved successfully

Example response

{
  "usage_segments": [
    {
      "segment_start": "2023-08-09T00:00:00+00:00",
      "tool_usage": [
        {
          "user_email_address": "user@company.com",
          "model_version": "V_0_3",
          "full_tool_name": "Turbo Image Generation V3",
          "amount": {
            "amount": 1050,
            "currency_code": "USD"
          },
          "tool_type": "GENERATE",
          "api_key_id": "JRPVD7jWR1aTBYiJ0UFVOg"
        },
        {
          "user_email_address": "user@company.com",
          "model_version": "V_0_3",
          "full_tool_name": "Turbo Image Generation V3",
          "amount": {
            "amount": 1050,
            "currency_code": "USD"
          },
          "tool_type": "GENERATE",
          "api_key_id": "JRPVD7jWR1aTBYiJ0UFVOg"
        }
      ],
      "segment_end": "2023-08-09T23:59:59+00:00"
    },
    {
      "segment_start": "2023-08-09T00:00:00+00:00",
      "tool_usage": [
        {
          "user_email_address": "user@company.com",
          "model_version": "V_0_3",
          "full_tool_name": "Turbo Image Generation V3",
          "amount": {
            "amount": 1050,
            "currency_code": "USD"
          },
          "tool_type": "GENERATE",
          "api_key_id": "JRPVD7jWR1aTBYiJ0UFVOg"
        },
        {
          "user_email_address": "user@company.com",
          "model_version": "V_0_3",
          "full_tool_name": "Turbo Image Generation V3",
          "amount": {
            "amount": 1050,
            "currency_code": "USD"
          },
          "tool_type": "GENERATE",
          "api_key_id": "JRPVD7jWR1aTBYiJ0UFVOg"
        }
      ],
      "segment_end": "2023-08-09T23:59:59+00:00"
    }
  ]
}