---
updatedAt: 2026-04-21T08:54:41.000Z
agentTools:
  projectIndex: https://docs.scalr.io/llms.txt
---

# Get AI usage

This endpoint returns instance of AI usage.

# OpenAPI definition

```json
{
  "components": {
    "schemas": {
      "AiUsage": {
        "description": "Represents the AI usage item.",
        "properties": {
          "attributes": {
            "properties": {
              "model": {
                "default": "claude",
                "description": "The AI model name used to process the request.",
                "enum": [
                  "claude"
                ],
                "type": "string"
              },
              "request-type": {
                "default": "explain",
                "description": "The type of the AI action request.",
                "enum": [
                  "explain",
                  "summarize"
                ],
                "type": "string"
              },
              "requested-at": {
                "description": "The time when the AI action was requested.",
                "format": "date-time",
                "type": "string"
              },
              "requested-by-email": {
                "description": "The email of the user who requested the AI action.",
                "maxLength": 255,
                "nullable": true,
                "type": "string"
              }
            },
            "type": "object"
          },
          "id": {
            "readOnly": true,
            "type": "string"
          },
          "links": {
            "properties": {
              "input": {
                "description": "Link to download the run data sent to the AI.",
                "nullable": true,
                "type": "string"
              }
            },
            "readOnly": true,
            "type": "object"
          },
          "relationships": {
            "properties": {
              "account": {
                "description": "The account this resource belongs to.",
                "properties": {
                  "data": {
                    "nullable": true,
                    "properties": {
                      "id": {
                        "type": "string"
                      },
                      "type": {
                        "enum": [
                          "accounts",
                          ""
                        ],
                        "type": "string"
                      }
                    },
                    "required": [
                      "type",
                      "id"
                    ],
                    "type": "object"
                  }
                },
                "required": [
                  "data"
                ],
                "type": "object"
              },
              "run": {
                "description": "The run for which the AI action was requested.",
                "properties": {
                  "data": {
                    "nullable": true,
                    "properties": {
                      "id": {
                        "type": "string"
                      },
                      "type": {
                        "enum": [
                          "runs",
                          ""
                        ],
                        "type": "string"
                      }
                    },
                    "required": [
                      "type",
                      "id"
                    ],
                    "type": "object"
                  }
                },
                "required": [
                  "data"
                ],
                "type": "object"
              }
            },
            "type": "object"
          },
          "type": {
            "enum": [
              "ai-usages"
            ],
            "type": "string"
          }
        },
        "required": [
          "type"
        ],
        "type": "object"
      },
      "AiUsageDocument": {
        "description": "JSON:API Document.\n\nsee: https://jsonapi.org/format/#document-structure",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/AiUsage"
          },
          "included": {
            "items": {
              "type": "object"
            },
            "readOnly": true,
            "type": "array"
          },
          "meta": {
            "readOnly": true,
            "type": "object"
          }
        },
        "type": "object"
      }
    },
    "securitySchemes": {
      "API-Key": {
        "scheme": "bearer",
        "type": "http"
      }
    }
  },
  "info": {
    "description": "Scalr IACP API",
    "license": {
      "name": "Apache 2.0",
      "url": "https://www.apache.org/licenses/LICENSE-2.0"
    },
    "title": "Scalr IACP API",
    "version": "unversioned"
  },
  "openapi": "3.0.0",
  "paths": {
    "/reports/ai-usage/{ai_usage}": {
      "get": {
        "description": "This endpoint returns instance of AI usage.",
        "operationId": "get_ai_usage",
        "parameters": [
          {
            "description": "The ID of the AI usage instance.",
            "in": "path",
            "name": "ai_usage",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "The comma-separated list of relationship paths.",
            "explode": false,
            "in": "query",
            "name": "include",
            "required": false,
            "schema": {
              "items": {
                "enum": [
                  "run"
                ],
                "type": "string"
              },
              "type": "array"
            }
          },
          {
            "description": "The value of the fields[resource-type] parameter is a comma-separated list that refers to the name of the fields to be returned for the resource. An empty value indicates that no fields should be returned.",
            "explode": true,
            "in": "query",
            "name": "fields",
            "required": false,
            "schema": {
              "properties": {
                "ai-usages": {
                  "description": "The comma-separated list of fields to return in response for AiUsage resource.",
                  "type": "string"
                },
                "runs": {
                  "description": "The comma-separated list of fields to return in response for Run resource.",
                  "type": "string"
                }
              },
              "type": "object"
            },
            "style": "deepObject"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "$ref": "#/components/schemas/AiUsageDocument"
                }
              }
            },
            "description": "Success."
          },
          "403": {
            "description": "User unauthorized to perform this action."
          },
          "404": {
            "description": "AI usage not found or user unauthorized to perform action."
          },
          "4XX": {
            "description": "Client error."
          },
          "5XX": {
            "description": "Server error."
          }
        },
        "summary": "Get AI usage",
        "tags": [
          "ai-usage"
        ],
        "x-resource": "AiUsage",
        "x-service": "tf-api"
      }
    }
  },
  "security": [
    {
      "API-Key": []
    }
  ],
  "servers": [
    {
      "url": "https://{Domain}/api/iacp/v3",
      "variables": {
        "Domain": {
          "default": "example.scalr.io",
          "description": "Domain where Scalr is hosted"
        }
      }
    }
  ]
}
```

# Sibling pages

* [Get AI Usage](https://docs.scalr.io/scalr/reference/list_ai_usage.md)