# Gravitee

## Installation

The Gravitee Metering Plugin zip file can be obtained from the Revenium Customer Success team and installed in the following locations.

<table><thead><tr><th>Component</th><th>Location</th><th data-hidden></th></tr></thead><tbody><tr><td>Gateway</td><td>/opt/graviteeio-gateway/plugins</td><td></td></tr><tr><td>Management API</td><td>/opt/graviteeio-management-api/plugins</td><td></td></tr></tbody></table>

## Configuration

The Metering Plugin is configured from the "Design" section of the Gravitee Management UI

<figure><img src="https://2470865788-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSUfCzMW8qWeXstipFXEh%2Fuploads%2Fgit-blob-c8cd3cbca5b4e0dbc6a75a0e229f5a27a2da53a7%2FScreenshot%202023-05-30%20at%209.57.37%20PM.png?alt=media" alt=""><figcaption></figcaption></figure>

The Revenium Metering Plugin can then be dragged into the Request and Response phases for the API:

<figure><img src="https://2470865788-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSUfCzMW8qWeXstipFXEh%2Fuploads%2Fgit-blob-3870f68f6473931edca24a1ab5f4ac9c5a1c83f3%2FScreenshot%202023-05-30%20at%209.37.59%20PM.png?alt=media" alt=""><figcaption><p>Drag the Revenium Metering plugin to the request and response phases for the API</p></figcaption></figure>

Now you can configure the Metering Plugin. The only piece of required configuration is a [Revenium API Integration Key](https://docs.revenium.io/ai-and-api-monetization/api-integration-keys).

<figure><img src="https://2470865788-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSUfCzMW8qWeXstipFXEh%2Fuploads%2Fgit-blob-2d3d2dddd7cef4b603e64b0bd69aebb2acd5a005%2FScreenshot%202023-05-30%20at%209.39.34%20PM.png?alt=media" alt=""><figcaption></figcaption></figure>

The following table documents the full list of configuration parameters:

| Parameter              | Required | Description                                                                                                                    |
| ---------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------ |
| meteringUrl            | no       | The Revenium Metering API URL                                                                                                  |
| apiKey                 | yes      | The Revenium API Key                                                                                                           |
| metadataExpression     | no       | An EL expression to extract additional metering metadata from the request.                                                     |
| meteringExpression     | no       | An EL expression to extract the metering id (header, etc) from the request.                                                    |
| activeMode             | no       | Actively reject API requests with invalid (expired, out of funds, etc) Subscription or Client ID headers                       |
| productLicenseCacheTTL | no       | The amount of time to cache an valid Subscriptions                                                                             |
| successExpression      | no       | An EL expression to determine whether or not the API response should be metered (default is to meter all 2xx series responses) |
