# Public Cloud › Project Management › Usage API

> Part of the OVHcloud developer hub. Index of every page and section: https://developers.eu.ovhcloud.com/llms.txt
> The Public Cloud product's sections: https://developers.eu.ovhcloud.com/reference/public-cloud/llms.txt
> Everything in one file: https://developers.eu.ovhcloud.com/llms-full.txt

> 8 operations of the OVHcloud API. Calls carry `authorization: Bearer $OVH_TOKEN`; the EU host is shown, Canada and the United States answer on api.ca.ovhcloud.com and api.us.ovhcloud.com.

Page: https://developers.eu.ovhcloud.com/reference/public-cloud/project-management/usage/

OpenAPI v1: https://api.eu.ovhcloud.com/1.0/__schemas/developer-hub-navigation/public-cloud/project-management/usage.json?format=openapi3
OpenAPI v2: https://api.eu.ovhcloud.com/v2/__schemas/developer-hub-navigation/public-cloud/project-management/usage.json?format=openapi3

## Operations

- `GET /cloud/project/{serviceName}/usage/current` — Get current usage
- `GET /cloud/project/{serviceName}/usage/forecast` — Get usage forecast
- `GET /cloud/project/{serviceName}/usage/plans` — Get savings plan consumption
- `GET /cloud/project/{serviceName}/usage/history/{usageId}` — Get a past usage period
- `GET /cloud/project/{serviceName}/usage/history` — List past usage periods
- `GET /cloud/project/{serviceName}/credit` — List project credits. Returns the IDs of the credits added to the project.
- `GET /cloud/project/{serviceName}/credit/{id}` — Get a project credit
- `POST /cloud/project/{serviceName}/credit` — Add a voucher credit. Adds the credit of a voucher code to the project.

## Get current usage

`GET /1.0/cloud/project/{serviceName}/usage/current`

Link: https://developers.eu.ovhcloud.com/reference/public-cloud/project-management/usage/#get-cloud-project-servicename-usage-current

**Status:** Stable production version  
**IAM actions:** `publicCloudProject:apiovh:usage/current/get`

Returns the usage and price of the project for the current month, by resource type: hourly, monthly and per-unit resources.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `serviceName` | path | string | yes | Service name |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | cloud.usage.UsageCurrent | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `hourlyUsage` | cloud.billingView.HourlyResources | read-only | Hourly usage |
| `hourlyUsage.instance` | cloud.billingView.HourlyInstance[] | read-only | Details about hourly instances |
| `hourlyUsage.instance[].deploymentMode` | common.RegionTypeEnum | read-only | Specifies the deployment mode of the region where the resource is deployed (for example, 1-AZ or 3-AZ). Products that are grouped by project or have no region do not include a deployment mode — one of `LOCAL-ZONE`, `REGION-1-AZ`, `REGION-3-AZ` |
| `hourlyUsage.instance[].details` | cloud.billingView.HourlyInstanceDetail[] | read-only | Details about hourly instances |
| `hourlyUsage.instance[].quantity` | cloud.billingView.Quantity | read-only | Hours of run instances |
| `hourlyUsage.instance[].reference` | string | read-only | Instance reference |
| `hourlyUsage.instance[].region` | string | read-only | Instance region |
| `hourlyUsage.instance[].savingsPlanIds` | string[] | read-only | Savings Plan IDs |
| `hourlyUsage.instance[].totalPrice` | number | read-only | Total price |
| `hourlyUsage.instanceBandwidth` | cloud.billingView.HourlyInstanceBandwidth[] | read-only | Details about instances bandwidth consumption |
| `hourlyUsage.instanceBandwidth[].deploymentMode` | common.RegionTypeEnum | read-only | Specifies the deployment mode of the region where the resource is deployed (for example, 1-AZ or 3-AZ). Products that are grouped by project or have no region do not include a deployment mode — one of `LOCAL-ZONE`, `REGION-1-AZ`, `REGION-3-AZ` |
| `hourlyUsage.instanceBandwidth[].incomingBandwidth` | cloud.billingView.BandwidthInstance | read-only | Instance incoming bandwidth details |
| `hourlyUsage.instanceBandwidth[].outgoingBandwidth` | cloud.billingView.BandwidthInstance | read-only | Instance outgoing bandwidth details |
| `hourlyUsage.instanceBandwidth[].region` | string | read-only | Region |
| `hourlyUsage.instanceBandwidth[].totalPrice` | number | read-only | Total price |
| `hourlyUsage.instanceOption` | cloud.billingView.HourlyInstanceOption[] | read-only | Details about hourly instances options |
| `hourlyUsage.instanceOption[].deploymentMode` | common.RegionTypeEnum | read-only | Specifies the deployment mode of the region where the resource is deployed (for example, 1-AZ or 3-AZ). Products that are grouped by project or have no region do not include a deployment mode — one of `LOCAL-ZONE`, `REGION-1-AZ`, `REGION-3-AZ` |
| `hourlyUsage.instanceOption[].details` | cloud.billingView.HourlyInstanceOptionDetail[] | read-only | Details about hourly instances option |
| `hourlyUsage.instanceOption[].quantity` | cloud.billingView.Quantity | read-only | Quantity of instance hours running with this option |
| `hourlyUsage.instanceOption[].reference` | string | read-only | Instance reference |
| `hourlyUsage.instanceOption[].region` | string | read-only | Instance region |
| `hourlyUsage.instanceOption[].totalPrice` | number | read-only | Total price |
| `hourlyUsage.managedKubernetesService` | cloud.billingView.HourlyManagedKubernetesService[] | read-only | Details about managed kubernetes services |
| `hourlyUsage.managedKubernetesService[].deploymentMode` | common.RegionTypeEnum | read-only | Specifies the deployment mode of the region where the resource is deployed (for example, 1-AZ or 3-AZ). Products that are grouped by project or have no region do not include a deployment mode — one of `LOCAL-ZONE`, `REGION-1-AZ`, `REGION-3-AZ` |
| `hourlyUsage.managedKubernetesService[].details` | cloud.billingView.HourlyDetail[] | read-only | Details about managed kubernetes services |
| `hourlyUsage.managedKubernetesService[].quantity` | cloud.billingView.Quantity | read-only | Total hours of usage |
| `hourlyUsage.managedKubernetesService[].reference` | string | read-only | Reference |
| `hourlyUsage.managedKubernetesService[].region` | string | read-only | Region |
| `hourlyUsage.managedKubernetesService[].totalPrice` | order.Price | read-only | Total price |
| `hourlyUsage.quantum` | cloud.billingView.HourlyQuantum | read-only | Details about hourly quantums |
| `hourlyUsage.quantum.notebook` | cloud.billingView.HourlyQuantumNotebook[] | read-only | Details about hourly quantum notebooks |
| `hourlyUsage.quantum.processingUnit` | cloud.billingView.HourlyQuantumProcessingUnit[] | read-only | Details about hourly quantum processing unit |
| `hourlyUsage.rancher` | cloud.billingView.HourlyRancher[] | read-only | Details about hourly Rancher |
| `hourlyUsage.rancher[].deploymentMode` | common.RegionTypeEnum | read-only | Specifies the deployment mode of the region where the resource is deployed (for example, 1-AZ or 3-AZ). Products that are grouped by project or have no region do not include a deployment mode — one of `LOCAL-ZONE`, `REGION-1-AZ`, `REGION-3-AZ` |
| `hourlyUsage.rancher[].details` | cloud.billingView.HourlyRancherDetail[] | read-only | Details about hourly Rancher |
| `hourlyUsage.rancher[].quantity` | cloud.billingView.Quantity | read-only | Hours of Rancher |
| `hourlyUsage.rancher[].reference` | string | read-only | Instance reference |
| `hourlyUsage.rancher[].region` | string | read-only | Instance region |
| `hourlyUsage.rancher[].savingsPlanIds` | string[] | read-only | Savings Plan IDs |
| `hourlyUsage.rancher[].totalPrice` | order.Price | read-only | Total price |
| `hourlyUsage.snapshot` | cloud.billingView.HourlySnapshot[] | read-only | Details about hourly snapshots |
| `hourlyUsage.snapshot[].deploymentMode` | common.RegionTypeEnum | read-only | Specifies the deployment mode of the region where the resource is deployed (for example, 1-AZ or 3-AZ). Products that are grouped by project or have no region do not include a deployment mode — one of `LOCAL-ZONE`, `REGION-1-AZ`, `REGION-3-AZ` |
| `hourlyUsage.snapshot[].instance` | cloud.billingView.InstanceSnapshot | read-only | Instance snapshot details |
| `hourlyUsage.snapshot[].region` | string | read-only | Region |
| `hourlyUsage.snapshot[].totalPrice` | number | read-only | Total price |
| `hourlyUsage.snapshot[].volume` | cloud.billingView.VolumeSnapshot | read-only | Volume snapshot details |
| `hourlyUsage.storage` | cloud.billingView.HourlyStorage[] | read-only | Details about hourly storage |
| `hourlyUsage.storage[].bucketName` | string | read-only | Bucket Name |
| `hourlyUsage.storage[].deploymentMode` | common.RegionTypeEnum | read-only | Specifies the deployment mode of the region where the resource is deployed (for example, 1-AZ or 3-AZ). Products that are grouped by project or have no region do not include a deployment mode — one of `LOCAL-ZONE`, `REGION-1-AZ`, `REGION-3-AZ` |
| `hourlyUsage.storage[].incomingBandwidth` | cloud.billingView.BandwidthStorage | read-only | Storage incoming bandwidth details |
| `hourlyUsage.storage[].incomingInternalBandwidth` | cloud.billingView.BandwidthStorage | read-only | Storage incoming internal bandwidth details |
| `hourlyUsage.storage[].outgoingBandwidth` | cloud.billingView.BandwidthStorage | read-only | Storage outgoing bandwidth details |
| `hourlyUsage.storage[].outgoingInternalBandwidth` | cloud.billingView.BandwidthStorage | read-only | Storage outgoing internal bandwidth details |
| `hourlyUsage.storage[].region` | string | read-only | Region |
| `hourlyUsage.storage[].retrievalFees` | cloud.billingView.RetrievalFees | read-only | Storage retrieval fee details |
| `hourlyUsage.storage[].stored` | cloud.billingView.StoredStorage | read-only | Information about stored data |
| `hourlyUsage.storage[].totalPrice` | number | read-only | Total price |
| `hourlyUsage.storage[].type` | cloud.billingView.StorageTypeEnum | read-only | Storage type — one of `pca`, `pcs`, `storage-coldarchive`, `storage-glacier-ir`, `storage-high-perf`, `storage-standard`, `storage-standard-ia` |
| `hourlyUsage.volume` | cloud.billingView.HourlyVolume[] | read-only | Details about hourly volumes |
| `hourlyUsage.volume[].deploymentMode` | common.RegionTypeEnum | read-only | Specifies the deployment mode of the region where the resource is deployed (for example, 1-AZ or 3-AZ). Products that are grouped by project or have no region do not include a deployment mode — one of `LOCAL-ZONE`, `REGION-1-AZ`, `REGION-3-AZ` |
| `hourlyUsage.volume[].details` | cloud.billingView.HourlyVolumeDetail[] | read-only | Detail about volume consumption |
| `hourlyUsage.volume[].quantity` | cloud.billingView.Quantity | read-only | Total GiBh of volume |
| `hourlyUsage.volume[].region` | string | read-only | Region |
| `hourlyUsage.volume[].totalPrice` | number | read-only | Total price |
| `hourlyUsage.volume[].type` | string | read-only | Volume type |
| `lastUpdate` | string (date-time) | read-only | Entry last update |
| `monthlyUsage` | cloud.billingView.MonthlyResources | read-only | Monthly usage |
| `monthlyUsage.certification` | cloud.billingView.MonthlyCertification[] | read-only | Details about certifications |
| `monthlyUsage.certification[].details` | cloud.billingView.MonthlyCertificationDetail[] | read-only | Details about certifications |
| `monthlyUsage.certification[].reference` | string | read-only | Certification reference |
| `monthlyUsage.certification[].totalPrice` | number | read-only | Total price |
| `monthlyUsage.instance` | cloud.billingView.MonthlyInstance[] | read-only | Details about monthly instances |
| `monthlyUsage.instance[].deploymentMode` | common.RegionTypeEnum | read-only | Specifies the deployment mode of the region where the resource is deployed (for example, 1-AZ or 3-AZ). Products that are grouped by project or have no region do not include a deployment mode — one of `LOCAL-ZONE`, `REGION-1-AZ`, `REGION-3-AZ` |
| `monthlyUsage.instance[].details` | cloud.billingView.MonthlyInstanceDetail[] | read-only | Details about monthly instances |
| `monthlyUsage.instance[].reference` | string | read-only | Instance reference |
| `monthlyUsage.instance[].region` | string | read-only | Instance region |
| `monthlyUsage.instance[].totalPrice` | number | read-only | Total price |
| `monthlyUsage.instanceOption` | cloud.billingView.MonthlyInstanceOption[] | read-only | Details about monthly instances options |
| `monthlyUsage.instanceOption[].deploymentMode` | common.RegionTypeEnum | read-only | Specifies the deployment mode of the region where the resource is deployed (for example, 1-AZ or 3-AZ). Products that are grouped by project or have no region do not include a deployment mode — one of `LOCAL-ZONE`, `REGION-1-AZ`, `REGION-3-AZ` |
| `monthlyUsage.instanceOption[].details` | cloud.billingView.MonthlyInstanceOptionDetail[] | read-only | Details about monthly instances |
| `monthlyUsage.instanceOption[].reference` | string | read-only | Instance reference |
| `monthlyUsage.instanceOption[].region` | string | read-only | Instance region |
| `monthlyUsage.instanceOption[].totalPrice` | number | read-only | Total price |
| `monthlyUsage.savingsPlan` | cloud.billingView.MonthlySavingsPlan[] | read-only | Details about savings plan subscriptions |
| `monthlyUsage.savingsPlan[].details` | cloud.plan.Detail[] | read-only | Detailed listing of all flat fees |
| `monthlyUsage.savingsPlan[].flavor` | string | read-only | Flavor of the savings plan |
| `monthlyUsage.savingsPlan[].totalPrice` | order.Price | read-only | Total price of the flat fee part of associated savings plans |
| `period` | cloud.usage.Period | read-only | Usage dates (from/to) |
| `period.from` | string (date-time) | read-only | Usage from |
| `period.to` | string (date-time) | read-only | Usage to |
| `resourcesUsage` | cloud.billingView.TypedResources[] | read-only | Resource usage (billed per hour/minute/second/unit) |
| `resourcesUsage[].resources` | cloud.billingView.RegionalizedResource[] | read-only | Resources per region |
| `resourcesUsage[].resources[].components` | cloud.billingView.Component[] | read-only | List of components |
| `resourcesUsage[].resources[].deploymentMode` | common.RegionTypeEnum | read-only | Specifies the deployment mode of the region where the resource is deployed (for example, 1-AZ or 3-AZ). Products that are grouped by project or have no region do not include a deployment mode — one of `LOCAL-ZONE`, `REGION-1-AZ`, `REGION-3-AZ` |
| `resourcesUsage[].resources[].region` | string | read-only | Region of the resource |
| `resourcesUsage[].totalPrice` | number | read-only | Total price |
| `resourcesUsage[].type` | string | read-only | Type of the resources |
| `totalPrice` | order.Price | read-only | Total price |
| `totalPrice.currencyCode` | order.CurrencyCodeEnum |  | one of `AUD`, `CAD`, `CZK`, `EUR`, `GBP`, `INR`, `LTL`, `MAD`, `N/A`, `PLN`, `SGD`, `TND`, … |
| `totalPrice.text` | string |  |  |
| `totalPrice.value` | number |  |  |

```json
{
  "hourlyUsage": {
    "instance": [
      {
        "deploymentMode": "LOCAL-ZONE",
        "details": [
          {
            "instanceId": "string",
            "quantity": {
              "unit": null,
              "value": null
            },
            "resourceId": "string",
            "totalPrice": 0
          }
        ],
        "quantity": {
          "unit": "GiB",
          "value": 0
        },
        "reference": "string",
        "region": "string",
        "savingsPlanIds": [
          "string"
        ],
        "totalPrice": 0
      }
    ],
    "instanceBandwidth": [
      {
        "deploymentMode": "LOCAL-ZONE",
        "incomingBandwidth": {
          "quantity": {
            "unit": "GiB",
            "value": 0
          },
          "totalPrice": 0
        },
        "outgoingBandwidth": {
          "quantity": {
            "unit": "GiB",
            "value": 0
          },
          "totalPrice": 0
        },
        "region": "string",
        "totalPrice": 0
      }
    ],
    "instanceOption": [
      {
        "deploymentMode": "LOCAL-ZONE",
        "details": [
          {
            "instanceId": "string",
            "quantity": {
              "unit": null,
              "value": null
            },
            "totalPrice": 0
          }
        ],
        "quantity": {
          "unit": "GiB",
          "value": 0
        },
        "reference": "string",
        "region": "string",
        "totalPrice": 0
      }
    ],
    "managedKubernetesService": [
      {
        "deploymentMode": "LOCAL-ZONE",
        "details": [
  …
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/1.0/cloud/project/{serviceName}/usage/current" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN"
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

result = client.get("/cloud/project/{serviceName}/usage/current")

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

$result = $ovh->get("/cloud/project/{serviceName}/usage/current");

print_r($result);
?>
```

## Get usage forecast

`GET /1.0/cloud/project/{serviceName}/usage/forecast`

Link: https://developers.eu.ovhcloud.com/reference/public-cloud/project-management/usage/#get-cloud-project-servicename-usage-forecast

**Status:** Stable production version  
**IAM actions:** `publicCloudProject:apiovh:usage/forecast/get`

Returns the forecast usage and price of the project at the end of the current month, and the credits that can pay the next bill.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `serviceName` | path | string | yes | Service name |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | cloud.usage.UsageForecast | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `hourlyUsage` | cloud.billingView.HourlyResources | read-only | Hourly forecast |
| `hourlyUsage.instance` | cloud.billingView.HourlyInstance[] | read-only | Details about hourly instances |
| `hourlyUsage.instance[].deploymentMode` | common.RegionTypeEnum | read-only | Specifies the deployment mode of the region where the resource is deployed (for example, 1-AZ or 3-AZ). Products that are grouped by project or have no region do not include a deployment mode — one of `LOCAL-ZONE`, `REGION-1-AZ`, `REGION-3-AZ` |
| `hourlyUsage.instance[].details` | cloud.billingView.HourlyInstanceDetail[] | read-only | Details about hourly instances |
| `hourlyUsage.instance[].quantity` | cloud.billingView.Quantity | read-only | Hours of run instances |
| `hourlyUsage.instance[].reference` | string | read-only | Instance reference |
| `hourlyUsage.instance[].region` | string | read-only | Instance region |
| `hourlyUsage.instance[].savingsPlanIds` | string[] | read-only | Savings Plan IDs |
| `hourlyUsage.instance[].totalPrice` | number | read-only | Total price |
| `hourlyUsage.instanceBandwidth` | cloud.billingView.HourlyInstanceBandwidth[] | read-only | Details about instances bandwidth consumption |
| `hourlyUsage.instanceBandwidth[].deploymentMode` | common.RegionTypeEnum | read-only | Specifies the deployment mode of the region where the resource is deployed (for example, 1-AZ or 3-AZ). Products that are grouped by project or have no region do not include a deployment mode — one of `LOCAL-ZONE`, `REGION-1-AZ`, `REGION-3-AZ` |
| `hourlyUsage.instanceBandwidth[].incomingBandwidth` | cloud.billingView.BandwidthInstance | read-only | Instance incoming bandwidth details |
| `hourlyUsage.instanceBandwidth[].outgoingBandwidth` | cloud.billingView.BandwidthInstance | read-only | Instance outgoing bandwidth details |
| `hourlyUsage.instanceBandwidth[].region` | string | read-only | Region |
| `hourlyUsage.instanceBandwidth[].totalPrice` | number | read-only | Total price |
| `hourlyUsage.instanceOption` | cloud.billingView.HourlyInstanceOption[] | read-only | Details about hourly instances options |
| `hourlyUsage.instanceOption[].deploymentMode` | common.RegionTypeEnum | read-only | Specifies the deployment mode of the region where the resource is deployed (for example, 1-AZ or 3-AZ). Products that are grouped by project or have no region do not include a deployment mode — one of `LOCAL-ZONE`, `REGION-1-AZ`, `REGION-3-AZ` |
| `hourlyUsage.instanceOption[].details` | cloud.billingView.HourlyInstanceOptionDetail[] | read-only | Details about hourly instances option |
| `hourlyUsage.instanceOption[].quantity` | cloud.billingView.Quantity | read-only | Quantity of instance hours running with this option |
| `hourlyUsage.instanceOption[].reference` | string | read-only | Instance reference |
| `hourlyUsage.instanceOption[].region` | string | read-only | Instance region |
| `hourlyUsage.instanceOption[].totalPrice` | number | read-only | Total price |
| `hourlyUsage.managedKubernetesService` | cloud.billingView.HourlyManagedKubernetesService[] | read-only | Details about managed kubernetes services |
| `hourlyUsage.managedKubernetesService[].deploymentMode` | common.RegionTypeEnum | read-only | Specifies the deployment mode of the region where the resource is deployed (for example, 1-AZ or 3-AZ). Products that are grouped by project or have no region do not include a deployment mode — one of `LOCAL-ZONE`, `REGION-1-AZ`, `REGION-3-AZ` |
| `hourlyUsage.managedKubernetesService[].details` | cloud.billingView.HourlyDetail[] | read-only | Details about managed kubernetes services |
| `hourlyUsage.managedKubernetesService[].quantity` | cloud.billingView.Quantity | read-only | Total hours of usage |
| `hourlyUsage.managedKubernetesService[].reference` | string | read-only | Reference |
| `hourlyUsage.managedKubernetesService[].region` | string | read-only | Region |
| `hourlyUsage.managedKubernetesService[].totalPrice` | order.Price | read-only | Total price |
| `hourlyUsage.quantum` | cloud.billingView.HourlyQuantum | read-only | Details about hourly quantums |
| `hourlyUsage.quantum.notebook` | cloud.billingView.HourlyQuantumNotebook[] | read-only | Details about hourly quantum notebooks |
| `hourlyUsage.quantum.processingUnit` | cloud.billingView.HourlyQuantumProcessingUnit[] | read-only | Details about hourly quantum processing unit |
| `hourlyUsage.rancher` | cloud.billingView.HourlyRancher[] | read-only | Details about hourly Rancher |
| `hourlyUsage.rancher[].deploymentMode` | common.RegionTypeEnum | read-only | Specifies the deployment mode of the region where the resource is deployed (for example, 1-AZ or 3-AZ). Products that are grouped by project or have no region do not include a deployment mode — one of `LOCAL-ZONE`, `REGION-1-AZ`, `REGION-3-AZ` |
| `hourlyUsage.rancher[].details` | cloud.billingView.HourlyRancherDetail[] | read-only | Details about hourly Rancher |
| `hourlyUsage.rancher[].quantity` | cloud.billingView.Quantity | read-only | Hours of Rancher |
| `hourlyUsage.rancher[].reference` | string | read-only | Instance reference |
| `hourlyUsage.rancher[].region` | string | read-only | Instance region |
| `hourlyUsage.rancher[].savingsPlanIds` | string[] | read-only | Savings Plan IDs |
| `hourlyUsage.rancher[].totalPrice` | order.Price | read-only | Total price |
| `hourlyUsage.snapshot` | cloud.billingView.HourlySnapshot[] | read-only | Details about hourly snapshots |
| `hourlyUsage.snapshot[].deploymentMode` | common.RegionTypeEnum | read-only | Specifies the deployment mode of the region where the resource is deployed (for example, 1-AZ or 3-AZ). Products that are grouped by project or have no region do not include a deployment mode — one of `LOCAL-ZONE`, `REGION-1-AZ`, `REGION-3-AZ` |
| `hourlyUsage.snapshot[].instance` | cloud.billingView.InstanceSnapshot | read-only | Instance snapshot details |
| `hourlyUsage.snapshot[].region` | string | read-only | Region |
| `hourlyUsage.snapshot[].totalPrice` | number | read-only | Total price |
| `hourlyUsage.snapshot[].volume` | cloud.billingView.VolumeSnapshot | read-only | Volume snapshot details |
| `hourlyUsage.storage` | cloud.billingView.HourlyStorage[] | read-only | Details about hourly storage |
| `hourlyUsage.storage[].bucketName` | string | read-only | Bucket Name |
| `hourlyUsage.storage[].deploymentMode` | common.RegionTypeEnum | read-only | Specifies the deployment mode of the region where the resource is deployed (for example, 1-AZ or 3-AZ). Products that are grouped by project or have no region do not include a deployment mode — one of `LOCAL-ZONE`, `REGION-1-AZ`, `REGION-3-AZ` |
| `hourlyUsage.storage[].incomingBandwidth` | cloud.billingView.BandwidthStorage | read-only | Storage incoming bandwidth details |
| `hourlyUsage.storage[].incomingInternalBandwidth` | cloud.billingView.BandwidthStorage | read-only | Storage incoming internal bandwidth details |
| `hourlyUsage.storage[].outgoingBandwidth` | cloud.billingView.BandwidthStorage | read-only | Storage outgoing bandwidth details |
| `hourlyUsage.storage[].outgoingInternalBandwidth` | cloud.billingView.BandwidthStorage | read-only | Storage outgoing internal bandwidth details |
| `hourlyUsage.storage[].region` | string | read-only | Region |
| `hourlyUsage.storage[].retrievalFees` | cloud.billingView.RetrievalFees | read-only | Storage retrieval fee details |
| `hourlyUsage.storage[].stored` | cloud.billingView.StoredStorage | read-only | Information about stored data |
| `hourlyUsage.storage[].totalPrice` | number | read-only | Total price |
| `hourlyUsage.storage[].type` | cloud.billingView.StorageTypeEnum | read-only | Storage type — one of `pca`, `pcs`, `storage-coldarchive`, `storage-glacier-ir`, `storage-high-perf`, `storage-standard`, `storage-standard-ia` |
| `hourlyUsage.volume` | cloud.billingView.HourlyVolume[] | read-only | Details about hourly volumes |
| `hourlyUsage.volume[].deploymentMode` | common.RegionTypeEnum | read-only | Specifies the deployment mode of the region where the resource is deployed (for example, 1-AZ or 3-AZ). Products that are grouped by project or have no region do not include a deployment mode — one of `LOCAL-ZONE`, `REGION-1-AZ`, `REGION-3-AZ` |
| `hourlyUsage.volume[].details` | cloud.billingView.HourlyVolumeDetail[] | read-only | Detail about volume consumption |
| `hourlyUsage.volume[].quantity` | cloud.billingView.Quantity | read-only | Total GiBh of volume |
| `hourlyUsage.volume[].region` | string | read-only | Region |
| `hourlyUsage.volume[].totalPrice` | number | read-only | Total price |
| `hourlyUsage.volume[].type` | string | read-only | Volume type |
| `lastUpdate` | string (date-time) | read-only | Entry last update |
| `monthlyUsage` | cloud.billingView.MonthlyResources | read-only | Monthly forecast |
| `monthlyUsage.certification` | cloud.billingView.MonthlyCertification[] | read-only | Details about certifications |
| `monthlyUsage.certification[].details` | cloud.billingView.MonthlyCertificationDetail[] | read-only | Details about certifications |
| `monthlyUsage.certification[].reference` | string | read-only | Certification reference |
| `monthlyUsage.certification[].totalPrice` | number | read-only | Total price |
| `monthlyUsage.instance` | cloud.billingView.MonthlyInstance[] | read-only | Details about monthly instances |
| `monthlyUsage.instance[].deploymentMode` | common.RegionTypeEnum | read-only | Specifies the deployment mode of the region where the resource is deployed (for example, 1-AZ or 3-AZ). Products that are grouped by project or have no region do not include a deployment mode — one of `LOCAL-ZONE`, `REGION-1-AZ`, `REGION-3-AZ` |
| `monthlyUsage.instance[].details` | cloud.billingView.MonthlyInstanceDetail[] | read-only | Details about monthly instances |
| `monthlyUsage.instance[].reference` | string | read-only | Instance reference |
| `monthlyUsage.instance[].region` | string | read-only | Instance region |
| `monthlyUsage.instance[].totalPrice` | number | read-only | Total price |
| `monthlyUsage.instanceOption` | cloud.billingView.MonthlyInstanceOption[] | read-only | Details about monthly instances options |
| `monthlyUsage.instanceOption[].deploymentMode` | common.RegionTypeEnum | read-only | Specifies the deployment mode of the region where the resource is deployed (for example, 1-AZ or 3-AZ). Products that are grouped by project or have no region do not include a deployment mode — one of `LOCAL-ZONE`, `REGION-1-AZ`, `REGION-3-AZ` |
| `monthlyUsage.instanceOption[].details` | cloud.billingView.MonthlyInstanceOptionDetail[] | read-only | Details about monthly instances |
| `monthlyUsage.instanceOption[].reference` | string | read-only | Instance reference |
| `monthlyUsage.instanceOption[].region` | string | read-only | Instance region |
| `monthlyUsage.instanceOption[].totalPrice` | number | read-only | Total price |
| `monthlyUsage.savingsPlan` | cloud.billingView.MonthlySavingsPlan[] | read-only | Details about savings plan subscriptions |
| `monthlyUsage.savingsPlan[].details` | cloud.plan.Detail[] | read-only | Detailed listing of all flat fees |
| `monthlyUsage.savingsPlan[].flavor` | string | read-only | Flavor of the savings plan |
| `monthlyUsage.savingsPlan[].totalPrice` | order.Price | read-only | Total price of the flat fee part of associated savings plans |
| `period` | cloud.usage.Period | read-only | Forecast dates (from/to) |
| `period.from` | string (date-time) | read-only | Usage from |
| `period.to` | string (date-time) | read-only | Usage to |
| `resourcesUsage` | cloud.billingView.TypedResources[] | read-only | Resource usage forecast (billed per hour/minute/second/unit) |
| `resourcesUsage[].resources` | cloud.billingView.RegionalizedResource[] | read-only | Resources per region |
| `resourcesUsage[].resources[].components` | cloud.billingView.Component[] | read-only | List of components |
| `resourcesUsage[].resources[].deploymentMode` | common.RegionTypeEnum | read-only | Specifies the deployment mode of the region where the resource is deployed (for example, 1-AZ or 3-AZ). Products that are grouped by project or have no region do not include a deployment mode — one of `LOCAL-ZONE`, `REGION-1-AZ`, `REGION-3-AZ` |
| `resourcesUsage[].resources[].region` | string | read-only | Region of the resource |
| `resourcesUsage[].totalPrice` | number | read-only | Total price |
| `resourcesUsage[].type` | string | read-only | Type of the resources |
| `totalPrice` | order.Price | read-only | Total price |
| `totalPrice.currencyCode` | order.CurrencyCodeEnum |  | one of `AUD`, `CAD`, `CZK`, `EUR`, `GBP`, `INR`, `LTL`, `MAD`, `N/A`, `PLN`, `SGD`, `TND`, … |
| `totalPrice.text` | string |  |  |
| `totalPrice.value` | number |  |  |
| `usableCredits` | cloud.billingView.UsedCredits | read-only | Usable credit to pay next bill |
| `usableCredits.details` | cloud.billingView.UsedCredit[] | read-only | Details about credits that will be used |
| `usableCredits.details[].description` | string | read-only | Credit description |
| `usableCredits.details[].id` | integer | read-only | Credit ID |
| `usableCredits.details[].usedAmount` | number | read-only | Total credit used |
| `usableCredits.totalCredit` | number | read-only | Total credit that will be used to pay the bill |

```json
{
  "hourlyUsage": {
    "instance": [
      {
        "deploymentMode": "LOCAL-ZONE",
        "details": [
          {
            "instanceId": "string",
            "quantity": {
              "unit": null,
              "value": null
            },
            "resourceId": "string",
            "totalPrice": 0
          }
        ],
        "quantity": {
          "unit": "GiB",
          "value": 0
        },
        "reference": "string",
        "region": "string",
        "savingsPlanIds": [
          "string"
        ],
        "totalPrice": 0
      }
    ],
    "instanceBandwidth": [
      {
        "deploymentMode": "LOCAL-ZONE",
        "incomingBandwidth": {
          "quantity": {
            "unit": "GiB",
            "value": 0
          },
          "totalPrice": 0
        },
        "outgoingBandwidth": {
          "quantity": {
            "unit": "GiB",
            "value": 0
          },
          "totalPrice": 0
        },
        "region": "string",
        "totalPrice": 0
      }
    ],
    "instanceOption": [
      {
        "deploymentMode": "LOCAL-ZONE",
        "details": [
          {
            "instanceId": "string",
            "quantity": {
              "unit": null,
              "value": null
            },
            "totalPrice": 0
          }
        ],
        "quantity": {
          "unit": "GiB",
          "value": 0
        },
        "reference": "string",
        "region": "string",
        "totalPrice": 0
      }
    ],
    "managedKubernetesService": [
      {
        "deploymentMode": "LOCAL-ZONE",
        "details": [
  …
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/1.0/cloud/project/{serviceName}/usage/forecast" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN"
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

result = client.get("/cloud/project/{serviceName}/usage/forecast")

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

$result = $ovh->get("/cloud/project/{serviceName}/usage/forecast");

print_r($result);
?>
```

## Get savings plan consumption

`GET /1.0/cloud/project/{serviceName}/usage/plans`

Link: https://developers.eu.ovhcloud.com/reference/public-cloud/project-management/usage/#get-cloud-project-servicename-usage-plans

**Status:** Stable production version  
**IAM actions:** `publicCloudProject:apiovh:usage/plans/get`

Returns, for each flavor, the savings plan subscriptions, their coverage and utilization over time, and the amount saved. Filter by flavor, year and month.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `flavor` | query | string |  | Flavor to filter plans on |
| `month` | query | integer |  | Month of the period to extract plans consumption |
| `serviceName` | path | string | yes | Service name |
| `year` | query | integer |  | Year of the period to extract plans consumption |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | cloud.usage.PlanResponse | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `flavors` | cloud.plan.Flavor[] | read-only | List of consumption details by flavor |
| `flavors[].fees` | cloud.plan.Fees | read-only | Fees associated to the plans for this flavor |
| `flavors[].fees.flatFee` | cloud.plan.FlatFee | read-only | Description of the flat fee for the plan |
| `flavors[].fees.overQuota` | cloud.plan.OverQuota | read-only | Detailed of fees when the consumption exceeds the size of the plans |
| `flavors[].fees.savedAmount` | order.Price | read-only | Total amount saved by using plans |
| `flavors[].fees.totalPrice` | order.Price | read-only | Total price of plan subscriptions for this flavor |
| `flavors[].flavor` | string | read-only | The flavor for the plans |
| `flavors[].periods` | cloud.plan.PlanPeriod[] | read-only | Listing of all periods concerning this flavor saving plans : every change in usage or plans will make a new period |
| `flavors[].periods[].begin` | string (date-time) | read-only | Begin date of the period |
| `flavors[].periods[].consumptionSize` | integer | read-only | Size of the plan consumed |
| `flavors[].periods[].coverage` | string | read-only | Human readable percentage of usages covered by the plan |
| `flavors[].periods[].cumulPlanSize` | integer | read-only | Size of all plans combined |
| `flavors[].periods[].end` | string (date-time) | read-only | End date of the period |
| `flavors[].periods[].plansIds` | string (uuid)[] | read-only | List of plans Ids |
| `flavors[].periods[].resourceIds` | string[] | read-only | List of resource IDs that could be covered by this plan |
| `flavors[].periods[].utilization` | string | read-only | Human readable percentage of the savings plan utilization |
| `flavors[].subscriptions` | cloud.plan.Subscription[] | read-only | List of existing plan subscriptions for the flavor |
| `flavors[].subscriptions[].begin` | string (date-time) | read-only | Start date of the savings plan |
| `flavors[].subscriptions[].end` | string (date-time) | read-only | End date of the savings plan |
| `flavors[].subscriptions[].id` | string (uuid) | read-only | Id of the plan |
| `flavors[].subscriptions[].size` | integer | read-only | Size of the plans |
| `period` | cloud.plan.Period | read-only | Requested period |
| `period.from` | string (date-time) | read-only | Start of the period |
| `period.to` | string (date-time) | read-only | End of the period |
| `projectId` | string | read-only | Project ID of the fetched plans |
| `totalSavings` | order.Price | read-only | Total savings for all the flavors |
| `totalSavings.currencyCode` | order.CurrencyCodeEnum |  | one of `AUD`, `CAD`, `CZK`, `EUR`, `GBP`, `INR`, `LTL`, `MAD`, `N/A`, `PLN`, `SGD`, `TND`, … |
| `totalSavings.text` | string |  |  |
| `totalSavings.value` | number |  |  |

```json
{
  "flavors": [
    {
      "fees": {
        "flatFee": {
          "details": [
            {
              "id": null,
              "period": null,
              "planName": null,
              "size": null,
              "totalPrice": null,
              "unitPrice": null
            }
          ],
          "totalPrice": {
            "currencyCode": "AUD",
            "text": "string",
            "value": 0
          }
        },
        "overQuota": {
          "ids": [
            "00000000-0000-0000-0000-000000000000"
          ],
          "quantity": 0,
          "totalPrice": {
            "currencyCode": "AUD",
            "text": "string",
            "value": 0
          },
          "unitPrice": {
            "currencyCode": "AUD",
            "text": "string",
            "value": 0
          }
        },
        "savedAmount": {
          "currencyCode": "AUD",
          "text": "string",
          "value": 0
        },
        "totalPrice": {
          "currencyCode": "AUD",
          "text": "string",
          "value": 0
        }
      },
      "flavor": "string",
      "periods": [
        {
          "begin": "2024-01-01T12:00:00Z",
          "consumptionSize": 0,
          "coverage": "string",
          "cumulPlanSize": 0,
          "end": "2024-01-01T12:00:00Z",
          "plansIds": [
            "00000000-0000-0000-0000-000000000000"
          ],
          "resourceIds": [
            "string"
          ],
          "utilization": "string"
        }
      ],
      "subscriptions": [
        {
          "begin": "2024-01-01T12:00:00Z",
  …
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/1.0/cloud/project/{serviceName}/usage/plans" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN"
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

result = client.get("/cloud/project/{serviceName}/usage/plans")

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

$result = $ovh->get("/cloud/project/{serviceName}/usage/plans");

print_r($result);
?>
```

## Get a past usage period

`GET /1.0/cloud/project/{serviceName}/usage/history/{usageId}`

Link: https://developers.eu.ovhcloud.com/reference/public-cloud/project-management/usage/#get-cloud-project-servicename-usage-history-usageid

**Status:** Stable production version  
**IAM actions:** `publicCloudProject:apiovh:usage/history/get`

Returns the usage and price of the project for one past period, by resource type.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `serviceName` | path | string | yes | Service name |
| `usageId` | path | string | yes | Usage ID |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | cloud.usage.UsageHistoryDetail | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `hourlyUsage` | cloud.billingView.HourlyResources | read-only | Hourly usage |
| `hourlyUsage.instance` | cloud.billingView.HourlyInstance[] | read-only | Details about hourly instances |
| `hourlyUsage.instance[].deploymentMode` | common.RegionTypeEnum | read-only | Specifies the deployment mode of the region where the resource is deployed (for example, 1-AZ or 3-AZ). Products that are grouped by project or have no region do not include a deployment mode — one of `LOCAL-ZONE`, `REGION-1-AZ`, `REGION-3-AZ` |
| `hourlyUsage.instance[].details` | cloud.billingView.HourlyInstanceDetail[] | read-only | Details about hourly instances |
| `hourlyUsage.instance[].quantity` | cloud.billingView.Quantity | read-only | Hours of run instances |
| `hourlyUsage.instance[].reference` | string | read-only | Instance reference |
| `hourlyUsage.instance[].region` | string | read-only | Instance region |
| `hourlyUsage.instance[].savingsPlanIds` | string[] | read-only | Savings Plan IDs |
| `hourlyUsage.instance[].totalPrice` | number | read-only | Total price |
| `hourlyUsage.instanceBandwidth` | cloud.billingView.HourlyInstanceBandwidth[] | read-only | Details about instances bandwidth consumption |
| `hourlyUsage.instanceBandwidth[].deploymentMode` | common.RegionTypeEnum | read-only | Specifies the deployment mode of the region where the resource is deployed (for example, 1-AZ or 3-AZ). Products that are grouped by project or have no region do not include a deployment mode — one of `LOCAL-ZONE`, `REGION-1-AZ`, `REGION-3-AZ` |
| `hourlyUsage.instanceBandwidth[].incomingBandwidth` | cloud.billingView.BandwidthInstance | read-only | Instance incoming bandwidth details |
| `hourlyUsage.instanceBandwidth[].outgoingBandwidth` | cloud.billingView.BandwidthInstance | read-only | Instance outgoing bandwidth details |
| `hourlyUsage.instanceBandwidth[].region` | string | read-only | Region |
| `hourlyUsage.instanceBandwidth[].totalPrice` | number | read-only | Total price |
| `hourlyUsage.instanceOption` | cloud.billingView.HourlyInstanceOption[] | read-only | Details about hourly instances options |
| `hourlyUsage.instanceOption[].deploymentMode` | common.RegionTypeEnum | read-only | Specifies the deployment mode of the region where the resource is deployed (for example, 1-AZ or 3-AZ). Products that are grouped by project or have no region do not include a deployment mode — one of `LOCAL-ZONE`, `REGION-1-AZ`, `REGION-3-AZ` |
| `hourlyUsage.instanceOption[].details` | cloud.billingView.HourlyInstanceOptionDetail[] | read-only | Details about hourly instances option |
| `hourlyUsage.instanceOption[].quantity` | cloud.billingView.Quantity | read-only | Quantity of instance hours running with this option |
| `hourlyUsage.instanceOption[].reference` | string | read-only | Instance reference |
| `hourlyUsage.instanceOption[].region` | string | read-only | Instance region |
| `hourlyUsage.instanceOption[].totalPrice` | number | read-only | Total price |
| `hourlyUsage.managedKubernetesService` | cloud.billingView.HourlyManagedKubernetesService[] | read-only | Details about managed kubernetes services |
| `hourlyUsage.managedKubernetesService[].deploymentMode` | common.RegionTypeEnum | read-only | Specifies the deployment mode of the region where the resource is deployed (for example, 1-AZ or 3-AZ). Products that are grouped by project or have no region do not include a deployment mode — one of `LOCAL-ZONE`, `REGION-1-AZ`, `REGION-3-AZ` |
| `hourlyUsage.managedKubernetesService[].details` | cloud.billingView.HourlyDetail[] | read-only | Details about managed kubernetes services |
| `hourlyUsage.managedKubernetesService[].quantity` | cloud.billingView.Quantity | read-only | Total hours of usage |
| `hourlyUsage.managedKubernetesService[].reference` | string | read-only | Reference |
| `hourlyUsage.managedKubernetesService[].region` | string | read-only | Region |
| `hourlyUsage.managedKubernetesService[].totalPrice` | order.Price | read-only | Total price |
| `hourlyUsage.quantum` | cloud.billingView.HourlyQuantum | read-only | Details about hourly quantums |
| `hourlyUsage.quantum.notebook` | cloud.billingView.HourlyQuantumNotebook[] | read-only | Details about hourly quantum notebooks |
| `hourlyUsage.quantum.processingUnit` | cloud.billingView.HourlyQuantumProcessingUnit[] | read-only | Details about hourly quantum processing unit |
| `hourlyUsage.rancher` | cloud.billingView.HourlyRancher[] | read-only | Details about hourly Rancher |
| `hourlyUsage.rancher[].deploymentMode` | common.RegionTypeEnum | read-only | Specifies the deployment mode of the region where the resource is deployed (for example, 1-AZ or 3-AZ). Products that are grouped by project or have no region do not include a deployment mode — one of `LOCAL-ZONE`, `REGION-1-AZ`, `REGION-3-AZ` |
| `hourlyUsage.rancher[].details` | cloud.billingView.HourlyRancherDetail[] | read-only | Details about hourly Rancher |
| `hourlyUsage.rancher[].quantity` | cloud.billingView.Quantity | read-only | Hours of Rancher |
| `hourlyUsage.rancher[].reference` | string | read-only | Instance reference |
| `hourlyUsage.rancher[].region` | string | read-only | Instance region |
| `hourlyUsage.rancher[].savingsPlanIds` | string[] | read-only | Savings Plan IDs |
| `hourlyUsage.rancher[].totalPrice` | order.Price | read-only | Total price |
| `hourlyUsage.snapshot` | cloud.billingView.HourlySnapshot[] | read-only | Details about hourly snapshots |
| `hourlyUsage.snapshot[].deploymentMode` | common.RegionTypeEnum | read-only | Specifies the deployment mode of the region where the resource is deployed (for example, 1-AZ or 3-AZ). Products that are grouped by project or have no region do not include a deployment mode — one of `LOCAL-ZONE`, `REGION-1-AZ`, `REGION-3-AZ` |
| `hourlyUsage.snapshot[].instance` | cloud.billingView.InstanceSnapshot | read-only | Instance snapshot details |
| `hourlyUsage.snapshot[].region` | string | read-only | Region |
| `hourlyUsage.snapshot[].totalPrice` | number | read-only | Total price |
| `hourlyUsage.snapshot[].volume` | cloud.billingView.VolumeSnapshot | read-only | Volume snapshot details |
| `hourlyUsage.storage` | cloud.billingView.HourlyStorage[] | read-only | Details about hourly storage |
| `hourlyUsage.storage[].bucketName` | string | read-only | Bucket Name |
| `hourlyUsage.storage[].deploymentMode` | common.RegionTypeEnum | read-only | Specifies the deployment mode of the region where the resource is deployed (for example, 1-AZ or 3-AZ). Products that are grouped by project or have no region do not include a deployment mode — one of `LOCAL-ZONE`, `REGION-1-AZ`, `REGION-3-AZ` |
| `hourlyUsage.storage[].incomingBandwidth` | cloud.billingView.BandwidthStorage | read-only | Storage incoming bandwidth details |
| `hourlyUsage.storage[].incomingInternalBandwidth` | cloud.billingView.BandwidthStorage | read-only | Storage incoming internal bandwidth details |
| `hourlyUsage.storage[].outgoingBandwidth` | cloud.billingView.BandwidthStorage | read-only | Storage outgoing bandwidth details |
| `hourlyUsage.storage[].outgoingInternalBandwidth` | cloud.billingView.BandwidthStorage | read-only | Storage outgoing internal bandwidth details |
| `hourlyUsage.storage[].region` | string | read-only | Region |
| `hourlyUsage.storage[].retrievalFees` | cloud.billingView.RetrievalFees | read-only | Storage retrieval fee details |
| `hourlyUsage.storage[].stored` | cloud.billingView.StoredStorage | read-only | Information about stored data |
| `hourlyUsage.storage[].totalPrice` | number | read-only | Total price |
| `hourlyUsage.storage[].type` | cloud.billingView.StorageTypeEnum | read-only | Storage type — one of `pca`, `pcs`, `storage-coldarchive`, `storage-glacier-ir`, `storage-high-perf`, `storage-standard`, `storage-standard-ia` |
| `hourlyUsage.volume` | cloud.billingView.HourlyVolume[] | read-only | Details about hourly volumes |
| `hourlyUsage.volume[].deploymentMode` | common.RegionTypeEnum | read-only | Specifies the deployment mode of the region where the resource is deployed (for example, 1-AZ or 3-AZ). Products that are grouped by project or have no region do not include a deployment mode — one of `LOCAL-ZONE`, `REGION-1-AZ`, `REGION-3-AZ` |
| `hourlyUsage.volume[].details` | cloud.billingView.HourlyVolumeDetail[] | read-only | Detail about volume consumption |
| `hourlyUsage.volume[].quantity` | cloud.billingView.Quantity | read-only | Total GiBh of volume |
| `hourlyUsage.volume[].region` | string | read-only | Region |
| `hourlyUsage.volume[].totalPrice` | number | read-only | Total price |
| `hourlyUsage.volume[].type` | string | read-only | Volume type |
| `id` | string | read-only | Usage id |
| `lastUpdate` | string (date-time) | read-only | Entry last update |
| `monthlyUsage` | cloud.billingView.MonthlyResources | read-only | Monthly usage |
| `monthlyUsage.certification` | cloud.billingView.MonthlyCertification[] | read-only | Details about certifications |
| `monthlyUsage.certification[].details` | cloud.billingView.MonthlyCertificationDetail[] | read-only | Details about certifications |
| `monthlyUsage.certification[].reference` | string | read-only | Certification reference |
| `monthlyUsage.certification[].totalPrice` | number | read-only | Total price |
| `monthlyUsage.instance` | cloud.billingView.MonthlyInstance[] | read-only | Details about monthly instances |
| `monthlyUsage.instance[].deploymentMode` | common.RegionTypeEnum | read-only | Specifies the deployment mode of the region where the resource is deployed (for example, 1-AZ or 3-AZ). Products that are grouped by project or have no region do not include a deployment mode — one of `LOCAL-ZONE`, `REGION-1-AZ`, `REGION-3-AZ` |
| `monthlyUsage.instance[].details` | cloud.billingView.MonthlyInstanceDetail[] | read-only | Details about monthly instances |
| `monthlyUsage.instance[].reference` | string | read-only | Instance reference |
| `monthlyUsage.instance[].region` | string | read-only | Instance region |
| `monthlyUsage.instance[].totalPrice` | number | read-only | Total price |
| `monthlyUsage.instanceOption` | cloud.billingView.MonthlyInstanceOption[] | read-only | Details about monthly instances options |
| `monthlyUsage.instanceOption[].deploymentMode` | common.RegionTypeEnum | read-only | Specifies the deployment mode of the region where the resource is deployed (for example, 1-AZ or 3-AZ). Products that are grouped by project or have no region do not include a deployment mode — one of `LOCAL-ZONE`, `REGION-1-AZ`, `REGION-3-AZ` |
| `monthlyUsage.instanceOption[].details` | cloud.billingView.MonthlyInstanceOptionDetail[] | read-only | Details about monthly instances |
| `monthlyUsage.instanceOption[].reference` | string | read-only | Instance reference |
| `monthlyUsage.instanceOption[].region` | string | read-only | Instance region |
| `monthlyUsage.instanceOption[].totalPrice` | number | read-only | Total price |
| `monthlyUsage.savingsPlan` | cloud.billingView.MonthlySavingsPlan[] | read-only | Details about savings plan subscriptions |
| `monthlyUsage.savingsPlan[].details` | cloud.plan.Detail[] | read-only | Detailed listing of all flat fees |
| `monthlyUsage.savingsPlan[].flavor` | string | read-only | Flavor of the savings plan |
| `monthlyUsage.savingsPlan[].totalPrice` | order.Price | read-only | Total price of the flat fee part of associated savings plans |
| `period` | cloud.usage.Period | read-only | Usage dates (from/to) |
| `period.from` | string (date-time) | read-only | Usage from |
| `period.to` | string (date-time) | read-only | Usage to |
| `resourcesUsage` | cloud.billingView.TypedResources[] | read-only | Resource usage (billed per hour/minute/second/unit) |
| `resourcesUsage[].resources` | cloud.billingView.RegionalizedResource[] | read-only | Resources per region |
| `resourcesUsage[].resources[].components` | cloud.billingView.Component[] | read-only | List of components |
| `resourcesUsage[].resources[].deploymentMode` | common.RegionTypeEnum | read-only | Specifies the deployment mode of the region where the resource is deployed (for example, 1-AZ or 3-AZ). Products that are grouped by project or have no region do not include a deployment mode — one of `LOCAL-ZONE`, `REGION-1-AZ`, `REGION-3-AZ` |
| `resourcesUsage[].resources[].region` | string | read-only | Region of the resource |
| `resourcesUsage[].totalPrice` | number | read-only | Total price |
| `resourcesUsage[].type` | string | read-only | Type of the resources |
| `totalPrice` | order.Price | read-only | Total price |
| `totalPrice.currencyCode` | order.CurrencyCodeEnum |  | one of `AUD`, `CAD`, `CZK`, `EUR`, `GBP`, `INR`, `LTL`, `MAD`, `N/A`, `PLN`, `SGD`, `TND`, … |
| `totalPrice.text` | string |  |  |
| `totalPrice.value` | number |  |  |

```json
{
  "hourlyUsage": {
    "instance": [
      {
        "deploymentMode": "LOCAL-ZONE",
        "details": [
          {
            "instanceId": "string",
            "quantity": {
              "unit": null,
              "value": null
            },
            "resourceId": "string",
            "totalPrice": 0
          }
        ],
        "quantity": {
          "unit": "GiB",
          "value": 0
        },
        "reference": "string",
        "region": "string",
        "savingsPlanIds": [
          "string"
        ],
        "totalPrice": 0
      }
    ],
    "instanceBandwidth": [
      {
        "deploymentMode": "LOCAL-ZONE",
        "incomingBandwidth": {
          "quantity": {
            "unit": "GiB",
            "value": 0
          },
          "totalPrice": 0
        },
        "outgoingBandwidth": {
          "quantity": {
            "unit": "GiB",
            "value": 0
          },
          "totalPrice": 0
        },
        "region": "string",
        "totalPrice": 0
      }
    ],
    "instanceOption": [
      {
        "deploymentMode": "LOCAL-ZONE",
        "details": [
          {
            "instanceId": "string",
            "quantity": {
              "unit": null,
              "value": null
            },
            "totalPrice": 0
          }
        ],
        "quantity": {
          "unit": "GiB",
          "value": 0
        },
        "reference": "string",
        "region": "string",
        "totalPrice": 0
      }
    ],
    "managedKubernetesService": [
      {
        "deploymentMode": "LOCAL-ZONE",
        "details": [
  …
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/1.0/cloud/project/{serviceName}/usage/history/{usageId}" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN"
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

result = client.get("/cloud/project/{serviceName}/usage/history/{usageId}")

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

$result = $ovh->get("/cloud/project/{serviceName}/usage/history/{usageId}");

print_r($result);
?>
```

## List past usage periods

`GET /1.0/cloud/project/{serviceName}/usage/history`

Link: https://developers.eu.ovhcloud.com/reference/public-cloud/project-management/usage/#get-cloud-project-servicename-usage-history

**Status:** Stable production version  
**IAM actions:** `publicCloudProject:apiovh:usage/history/get`

Returns the past usage periods of the project. Filter them with the `from` and `to` dates, then get the details of one period with its ID.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `from` | query | string (date-time) |  | Filter results having date superior to from |
| `serviceName` | path | string | yes | Service name |
| `to` | query | string (date-time) |  | Filter results having date inferior to |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | cloud.usage.UsageHistory[] | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string | read-only | Usage id |
| `lastUpdate` | string (date-time) | read-only | Entry last update |
| `period` | cloud.usage.Period | read-only | Usage dates (from/to) |
| `period.from` | string (date-time) | read-only | Usage from |
| `period.to` | string (date-time) | read-only | Usage to |

```json
[
  {
    "id": "string",
    "lastUpdate": "2024-01-01T12:00:00Z",
    "period": {
      "from": "2024-01-01T12:00:00Z",
      "to": "2024-01-01T12:00:00Z"
    }
  }
]
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/1.0/cloud/project/{serviceName}/usage/history" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN"
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

result = client.get("/cloud/project/{serviceName}/usage/history")

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

$result = $ovh->get("/cloud/project/{serviceName}/usage/history");

print_r($result);
?>
```

## List project credits. Returns the IDs of the credits added to the project.

`GET /1.0/cloud/project/{serviceName}/credit`

Link: https://developers.eu.ovhcloud.com/reference/public-cloud/project-management/usage/#get-cloud-project-servicename-credit

**Status:** Stable production version  
**IAM actions:** `publicCloudProject:apiovh:credit/get`

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `serviceName` | path | string | yes | The project id |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | integer[] | successful operation |

```json
[
  0
]
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/1.0/cloud/project/{serviceName}/credit" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN"
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

result = client.get("/cloud/project/{serviceName}/credit")

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

$result = $ovh->get("/cloud/project/{serviceName}/credit");

print_r($result);
?>
```

## Get a project credit

`GET /1.0/cloud/project/{serviceName}/credit/{id}`

Link: https://developers.eu.ovhcloud.com/reference/public-cloud/project-management/usage/#get-cloud-project-servicename-credit-id

**Status:** Stable production version  
**IAM actions:** `publicCloudProject:apiovh:credit/get`

Get a project credit. Returns the total, used and available amounts of the credit, its validity period and the products it applies to.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | integer | yes | Credit id |
| `serviceName` | path | string | yes | The project id |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | cloud.Credit | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `available_credit` | order.Price | read-only | Available credit |
| `available_credit.currencyCode` | order.CurrencyCodeEnum |  | one of `AUD`, `CAD`, `CZK`, `EUR`, `GBP`, `INR`, `LTL`, `MAD`, `N/A`, `PLN`, `SGD`, `TND`, … |
| `available_credit.text` | string |  |  |
| `available_credit.value` | number |  |  |
| `bill` | string | read-only | Credit bill id |
| `description` | string | read-only | Credit description |
| `id` | integer | read-only | Credit id |
| `products` | string[] | read-only | Use credits on following products |
| `total_credit` | order.Price | read-only | Total credit |
| `total_credit.currencyCode` | order.CurrencyCodeEnum |  | one of `AUD`, `CAD`, `CZK`, `EUR`, `GBP`, `INR`, `LTL`, `MAD`, `N/A`, `PLN`, `SGD`, `TND`, … |
| `total_credit.text` | string |  |  |
| `total_credit.value` | number |  |  |
| `used_credit` | order.Price | read-only | Used credit |
| `used_credit.currencyCode` | order.CurrencyCodeEnum |  | one of `AUD`, `CAD`, `CZK`, `EUR`, `GBP`, `INR`, `LTL`, `MAD`, `N/A`, `PLN`, `SGD`, `TND`, … |
| `used_credit.text` | string |  |  |
| `used_credit.value` | number |  |  |
| `validity` | cloud.common.VoucherValidity | read-only | Credit validity |
| `validity.from` | string (date-time) |  | Valid from |
| `validity.to` | string (date-time) |  | Valid to |
| `voucher` | string | read-only | Voucher code |

```json
{
  "available_credit": {
    "currencyCode": "AUD",
    "text": "string",
    "value": 0
  },
  "bill": "string",
  "description": "string",
  "id": 0,
  "products": [
    "string"
  ],
  "total_credit": {
    "currencyCode": "AUD",
    "text": "string",
    "value": 0
  },
  "used_credit": {
    "currencyCode": "AUD",
    "text": "string",
    "value": 0
  },
  "validity": {
    "from": "2024-01-01T12:00:00Z",
    "to": "2024-01-01T12:00:00Z"
  },
  "voucher": "string"
}
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/1.0/cloud/project/{serviceName}/credit/{id}" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN"
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

result = client.get("/cloud/project/{serviceName}/credit/{id}")

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

$result = $ovh->get("/cloud/project/{serviceName}/credit/{id}");

print_r($result);
?>
```

## Add a voucher credit. Adds the credit of a voucher code to the project.

`POST /1.0/cloud/project/{serviceName}/credit`

Link: https://developers.eu.ovhcloud.com/reference/public-cloud/project-management/usage/#post-cloud-project-servicename-credit

**Status:** Stable production version  
**IAM actions:** `publicCloudProject:apiovh:credit/create`

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `serviceName` | path | string | yes | The project id |

### Request body (required)

Type: `object`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | string | yes | Voucher code |

```json
{
  "code": "string"
}
```

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | — | successful operation |

### Example

```bash
curl -X POST \
  "https://api.eu.ovhcloud.com/1.0/cloud/project/{serviceName}/credit" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN" \
  -H "content-type: application/json" \
  -d '{ }'
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

# Request body type: string
result = client.post("/cloud/project/{serviceName}/credit",
	code = None, # Voucher code (type: string)
)

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

// Request body type: string
$result = $ovh->post("/cloud/project/{serviceName}/credit", array(
	code => null, // Voucher code (type: string)
));

print_r($result);
?>
```
