# Refrigerants and usage

The refrigerant table with GWP, open to every key, and what the key and the organisation have used this month.

## The refrigerant model

- `id` (string (uuid))
- `designation` (string): Such as `R449A`.
- `group` (string) One of `hfc`, `hfc_blend`, `hfc_hfo_blend`, `hfo`, `natural`.
- `gwp` (number)
- `is_fgas` (boolean)

## The usage model

- `environment` (string): Where the key works. One of `production`, `sandbox`.
- `month` (string): The month as `YYYY-MM`.
- `key` (object)
- `organization` (object)
- `rate_limit_per_minute` (integer)

## List refrigerants

`GET /refrigerants` · any key

The refrigerant table with GWP.

Open to every key.

### Request

```bash
curl https://api.maci.energy/v1/refrigerants \
  -H "Authorization: Bearer $MACI_API_KEY"
```

```javascript
const response = await fetch('https://api.maci.energy/v1/refrigerants', {
  headers: {
    Authorization: `Bearer ${process.env.MACI_API_KEY}`,
  },
});
const data = await response.json();
```

```python
import os
import requests

response = requests.get(
    "https://api.maci.energy/v1/refrigerants",
    headers={"Authorization": f"Bearer {os.environ['MACI_API_KEY']}"},
)
data = response.json()
```

```php
$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.maci.energy/v1/refrigerants', [
    'headers' => [
        'Authorization' => 'Bearer '.getenv('MACI_API_KEY'),
    ],
]);
$data = json_decode($response->getBody(), true);
```

### Response 200

All refrigerants. The fields are those of the refrigerant model.

```json
{
  "data": [
    {
      "id": "2b7c4d1e-9f0a-4b3c-8d6e-5a4f3e2d1c0b",
      "designation": "R449A",
      "group": "hfc",
      "gwp": 1397,
      "is_fgas": false
    }
  ]
}
```

## Get usage

`GET /usage` · any key

What the key and the organisation have used this month.

Open to every key.

### Request

```bash
curl https://api.maci.energy/v1/usage \
  -H "Authorization: Bearer $MACI_API_KEY"
```

```javascript
const response = await fetch('https://api.maci.energy/v1/usage', {
  headers: {
    Authorization: `Bearer ${process.env.MACI_API_KEY}`,
  },
});
const data = await response.json();
```

```python
import os
import requests

response = requests.get(
    "https://api.maci.energy/v1/usage",
    headers={"Authorization": f"Bearer {os.environ['MACI_API_KEY']}"},
)
data = response.json()
```

```php
$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.maci.energy/v1/usage', [
    'headers' => [
        'Authorization' => 'Bearer '.getenv('MACI_API_KEY'),
    ],
]);
$data = json_decode($response->getBody(), true);
```

### Response 200

The usage in the current month (UTC). The fields are those of the usage model.

```json
{
  "environment": "production",
  "month": "2026-10",
  "key": {
    "name": "Ops",
    "calls_this_month": 1240
  },
  "organization": {
    "calls_this_month": 8312,
    "monthly_limit": 100000
  },
  "rate_limit_per_minute": 60
}
```
