Open Context Protocol is live! 🚀 Read the launch post
billingGetGithubBillingPremiumRequestUsageReportUser

billingGetGithubBillingPremiumRequestUsageReportUser

Get billing premium request usage report for a user

Details

  • Method: GET
  • Path: /users/{username}/settings/billing/premium_request/usage
  • Operation ID: billing/get-github-billing-premium-request-usage-report-user

Parameters

{
  "username": {
    "description": "The handle for the GitHub user account.",
    "required": true,
    "location": "path",
    "type": "string"
  },
  "year": {
    "description": "If specified, only return results for a single year. The value of `year` is an integer with four digits representing a year. For example, `2025`. Default value is the current year.",
    "required": false,
    "location": "query",
    "type": "integer"
  },
  "month": {
    "description": "If specified, only return results for a single month. The value of `month` is an integer between `1` and `12`. Default value is the current month. If no year is specified the default `year` is used.",
    "required": false,
    "location": "query",
    "type": "integer"
  },
  "day": {
    "description": "If specified, only return results for a single day. The value of `day` is an integer between `1` and `31`. If no `year` or `month` is specified, the default `year` and `month` are used.",
    "required": false,
    "location": "query",
    "type": "integer"
  },
  "model": {
    "description": "The model name to query usage for. The name is not case sensitive.",
    "required": false,
    "location": "query",
    "type": "string"
  },
  "product": {
    "description": "The product name to query usage for. The name is not case sensitive.",
    "required": false,
    "location": "query",
    "type": "string"
  }
}

Response Schema

{
  "type": "object",
  "properties": {
    "timePeriod": {
      "type": "object",
      "properties": {
        "year": {
          "type": "integer",
          "description": "The year for the usage report."
        },
        "month": {
          "type": "integer",
          "description": "The month for the usage report."
        },
        "day": {
          "type": "integer",
          "description": "The day for the usage report."
        }
      },
      "required": [
        "year"
      ]
    },
    "user": {
      "type": "string",
      "description": "The unique identifier of the user."
    },
    "product": {
      "type": "string",
      "description": "The product for the usage report."
    },
    "model": {
      "type": "string",
      "description": "The model for the usage report."
    },
    "usageItems": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "product": {
            "type": "string",
            "description": "Product name."
          },
          "sku": {
            "type": "string",
            "description": "SKU name."
          },
          "model": {
            "type": "string",
            "description": "Model name."
          },
          "unitType": {
            "type": "string",
            "description": "Unit type of the usage line item."
          },
          "pricePerUnit": {
            "type": "number",
            "description": "Price per unit of the usage line item."
          },
          "grossQuantity": {
            "type": "number",
            "description": "Gross quantity of the usage line item."
          },
          "grossAmount": {
            "type": "number",
            "description": "Gross amount of the usage line item."
          },
          "discountQuantity": {
            "type": "number",
            "description": "Discount quantity of the usage line item."
          },
          "discountAmount": {
            "type": "number",
            "description": "Discount amount of the usage line item."
          },
          "netQuantity": {
            "type": "number",
            "description": "Net quantity of the usage line item."
          },
          "netAmount": {
            "type": "number",
            "description": "Net amount of the usage line item."
          }
        },
        "required": [
          "product",
          "sku",
          "model",
          "unitType",
          "pricePerUnit",
          "grossQuantity",
          "grossAmount",
          "discountQuantity",
          "discountAmount",
          "netQuantity",
          "netAmount"
        ]
      }
    }
  },
  "required": [
    "timePeriod",
    "user",
    "usageItems"
  ]
}

Usage

from ocp_agent import OCPAgent

agent = OCPAgent()
await agent.register_api('github')

# Call this tool
result = await agent.call_tool('billingGetGithubBillingPremiumRequestUsageReportUser', {
    # Add required parameters here
})