---
title: Rate Usage Records
slug: rate-usage-records
docTags: 
createdAt: 2026-08-25T19:28:59.170Z
---

{
  "id": "GO5MnsstdpRtE0WRCVRE3",
  "type": "api-oas-v2",
  "data": {
    "method": "POST",
    "url": "https://api.nue.io/usage/usage:rate",
    "servers": [
      {
        "url": "https://api.nue.io/usage/usage:rate",
        "description": "Nue Production API Endpoint"
      },
      {
        "url": "https://api.sandbox.nue.io/usage/usage:rate",
        "description": "Nue Sandbox API Endpoint"
      }
    ],
    "name": "Rate Usage Records",
    "description": "<p>Rate or re-rate usage records by ID. This applies pricing rules to convert raw usage quantities into billable amounts. Note: Usage that has already been billed cannot be re-rated.</p>",
    "contentType": "application/json",
    "request": {
      "pathParameters": [],
      "headerParameters": [
        {
          "name": "accept",
          "type": "string",
          "kind": "optional",
          "description": "Generated from available response content types",
          "enum": [
            "application/json"
          ],
          "default": "application/json"
        }
      ],
      "queryParameters": [],
      "bodyDataParameters": [
        {
          "kind": "required",
          "name": "body",
          "type": "object",
          "description": "Usage IDs or GraphQL filter to specify which usage records to rate",
          "schema": [
            {
              "name": "usageIds",
              "kind": "optional",
              "type": "array",
              "description": "Array of usage record IDs to rate",
              "example": "",
              "itemType": "string",
              "customType": "string[]",
              "itemExample": "",
              "itemDefault": ""
            },
            {
              "name": "graphqlFilter",
              "kind": "optional",
              "type": "string",
              "description": "GraphQL filter to select usage records for rating",
              "example": "{status:{_eq:\"Open\"}}"
            }
          ],
          "isExpanded": true
        }
      ],
      "formDataParameters": [],
      "oAuthParameters": [
        {
          "id": "apiKeyAuth",
          "name": "nue-api-key",
          "kind": "optional",
          "type": "apiKey",
          "in": "header"
        }
      ],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "Successfully rated usage records",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "schema": [
              {
                "name": "ratedUsages",
                "kind": "optional",
                "type": "array",
                "description": "",
                "example": "",
                "itemType": "object",
                "customType": "object[]",
                "itemExample": "",
                "itemDefault": ""
              }
            ],
            "isExpanded": true
          }
        ]
      }
    ],
    "hasXCodeSamples": false,
    "examples": {
      "languages": [
        {
          "id": "5JDyRNlGQdWea4hIDhepT",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request POST \\\n     --url https://api.nue.io/usage/usage:rate \\\n     --header 'accept: application/json'"
        },
        {
          "id": "3ld_81IT5b1rSeVKgOklh",
          "language": "javascript",
          "label": "javascript",
          "code": "var myHeaders = new Headers();\nmyHeaders.append(\"accept\", \"application/json\");\nmyHeaders.append(\"content-type\", \"application/json\");\n\nvar requestOptions = {\n   method: 'POST',\n   headers: myHeaders,\n   redirect: 'follow'\n};\n\nfetch(\"https://api.nue.io/usage/usage:rate\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "mrUpPqq47hlHrbyC-XjZY",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"https://api.nue.io/usage/usage:rate\")\n\nhttps = Net::HTTP.new(url.host, url.port)\nhttps.use_ssl = true\n\nrequest = Net::HTTP::Post.new(url)\nrequest[\"accept\"] = \"application/json\"\nrequest[\"content-type\"] = \"application/json\"\n\nresponse = https.request(request)\nputs response.read_body\n"
        },
        {
          "id": "hAgewoUbMg_RapL5G5DpI",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"https://api.nue.io/usage/usage:rate\"\n\npayload = {}\nheaders = {\n   'accept': 'application/json',\n   'content-type': 'application/json'\n}\n\nresponse = requests.request(\"POST\", url, headers=headers, data=payload)\n\nprint(response.text)\n"
        }
      ],
      "selectedLanguageId": "5JDyRNlGQdWea4hIDhepT"
    },
    "results": {
      "languages": [
        {
          "id": "DoJu5BeIMwPk3DLbMIiTG",
          "language": "200",
          "code": "// Successfully rated usage records\n{\n  \"ratedUsages\": [\n    {}\n  ]\n}"
        }
      ],
      "selectedLanguageId": "DoJu5BeIMwPk3DLbMIiTG"
    }
  },
  "children": [
    {
      "text": ""
    }
  ]
}