> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.awardtool.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.awardtool.com/_mcp/server.

# API key usage

POST https://apisv2.awardtoolapi.com/api/v1/api_usage
Content-Type: application/json

## Overview

The **API Usage Metrics API** provides detailed, per-day usage statistics associated with a specific API key. This endpoint enables clients to monitor and audit their API consumption across supported AwardTool services, including Panorama data endpoints and real-time search operations.

Usage data is aggregated by date and is intended for billing validation, quota monitoring, and operational transparency.

---

## Authentication

All requests must include a valid `api_key`.

---

## Request

### Request Body

``` json
{
  "api_key": "YOUR_API_KEY"
}

 ```

### Request Fields

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `api_key` | String | Yes | API key for which usage statistics are being requested. |

---

## Response

### Successful Response

``` json
{
  "data": [
    {
      "date": "2023-12-11",
      "api_key": "683de76f-2e37-4253-8dbf-fd88b507bbc4",
      "panorama_flight_data": 1,
      "panorama_calendar_data": 1,
      "panorama_route_data": 1,
      "real_time_search": 3
    },
    {
      "date": "2023-12-12",
      "api_key": "YOUR_API_KEY",
      "panorama_calendar_data": 1,
      "api_usage": 2
    }
  ],
  "status": 200
}

 ```

---

## Response Fields

### Top-Level Fields

| Field | Type | Description |
| --- | --- | --- |
| `data` | Array | List of daily usage records associated with the API key. |
| `status` | Number | HTTP-like status code indicating request success. |

---

### Daily Usage Record Fields

Each object in the `data` array represents usage metrics for a specific date.

| Field | Type | Description |
| --- | --- | --- |
| `date` | String | Usage date (YYYY-MM-DD). |
| `api_key` | String | API key associated with the usage record. |
| `panorama_flight_data` | Number | Number of Panorama flight data requests. |
| `panorama_calendar_data` | Number | Number of Panorama calendar data requests. |
| `panorama_route_data` | Number | Number of Panorama route data requests. |
| `real_time_search` | Number | Number of real-time search requests. |
| `api_usage` | Number | Number of API usage retrieval calls (this endpoint). |

**Note:** Fields may vary by date depending on which services were accessed on that day. Missing fields indicate zero usage for that category.

---

## Usage Notes

- Usage data is aggregated **per day** and **per API key**.
    
- Counts reflect **successful API calls** only.
    
- This endpoint is intended for **monitoring and reporting** purposes and does not modify usage quotas.
    
- Historical usage availability may be subject to retention limits.
    

---

## Common Use Cases

- Validate monthly usage against contractual limits
    
- Power internal billing and invoicing workflows
    
- Monitor consumption trends and optimize API usage
    
- Display usage dashboards for enterprise clients
    

---

## Error Handling

| Status | Description |
| --- | --- |
| 400 | Invalid or missing API key |
| 401 | Unauthorized access |
| 500 | Internal server error |

Reference: https://docs.awardtool.com/award-tool-api/utility/api-key-usage

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: collection
  version: 1.0.0
paths:
  /api/v1/api_usage:
    post:
      operationId: API key usage
      summary: API key usage
      description: >-
        ## Overview


        The **API Usage Metrics API** provides detailed, per-day usage
        statistics associated with a specific API key. This endpoint enables
        clients to monitor and audit their API consumption across supported
        AwardTool services, including Panorama data endpoints and real-time
        search operations.


        Usage data is aggregated by date and is intended for billing validation,
        quota monitoring, and operational transparency.


        ---


        ## Authentication


        All requests must include a valid `api_key`.


        ---


        ## Request


        ### Request Body


        ``` json

        {
          "api_key": "YOUR_API_KEY"
        }

         ```

        ### Request Fields


        | Field | Type | Required | Description |

        | --- | --- | --- | --- |

        | `api_key` | String | Yes | API key for which usage statistics are
        being requested. |


        ---


        ## Response


        ### Successful Response


        ``` json

        {
          "data": [
            {
              "date": "2023-12-11",
              "api_key": "683de76f-2e37-4253-8dbf-fd88b507bbc4",
              "panorama_flight_data": 1,
              "panorama_calendar_data": 1,
              "panorama_route_data": 1,
              "real_time_search": 3
            },
            {
              "date": "2023-12-12",
              "api_key": "YOUR_API_KEY",
              "panorama_calendar_data": 1,
              "api_usage": 2
            }
          ],
          "status": 200
        }

         ```

        ---


        ## Response Fields


        ### Top-Level Fields


        | Field | Type | Description |

        | --- | --- | --- |

        | `data` | Array | List of daily usage records associated with the API
        key. |

        | `status` | Number | HTTP-like status code indicating request success.
        |


        ---


        ### Daily Usage Record Fields


        Each object in the `data` array represents usage metrics for a specific
        date.


        | Field | Type | Description |

        | --- | --- | --- |

        | `date` | String | Usage date (YYYY-MM-DD). |

        | `api_key` | String | API key associated with the usage record. |

        | `panorama_flight_data` | Number | Number of Panorama flight data
        requests. |

        | `panorama_calendar_data` | Number | Number of Panorama calendar data
        requests. |

        | `panorama_route_data` | Number | Number of Panorama route data
        requests. |

        | `real_time_search` | Number | Number of real-time search requests. |

        | `api_usage` | Number | Number of API usage retrieval calls (this
        endpoint). |


        **Note:** Fields may vary by date depending on which services were
        accessed on that day. Missing fields indicate zero usage for that
        category.


        ---


        ## Usage Notes


        - Usage data is aggregated **per day** and **per API key**.
            
        - Counts reflect **successful API calls** only.
            
        - This endpoint is intended for **monitoring and reporting** purposes
        and does not modify usage quotas.
            
        - Historical usage availability may be subject to retention limits.
            

        ---


        ## Common Use Cases


        - Validate monthly usage against contractual limits
            
        - Power internal billing and invoicing workflows
            
        - Monitor consumption trends and optimize API usage
            
        - Display usage dashboards for enterprise clients
            

        ---


        ## Error Handling


        | Status | Description |

        | --- | --- |

        | 400 | Invalid or missing API key |

        | 401 | Unauthorized access |

        | 500 | Internal server error |
      tags:
        - Utility
      responses:
        '200':
          description: Successful response
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                api_key:
                  type: string
              required:
                - api_key
servers:
  - url: https://apisv2.awardtoolapi.com
    description: Default

```

## Examples

**Request**

```json
{
  "api_key": "YOUR_API_KEY"
}
```

**SDK Code**

```python
import requests

url = "https://apisv2.awardtoolapi.com/api/v1/api_usage"

payload = { "api_key": "YOUR_API_KEY" }
headers = {"Content-Type": "application/json"}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://apisv2.awardtoolapi.com/api/v1/api_usage';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json'},
  body: '{"api_key":"YOUR_API_KEY"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://apisv2.awardtoolapi.com/api/v1/api_usage"

	payload := strings.NewReader("{\n  \"api_key\": \"YOUR_API_KEY\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://apisv2.awardtoolapi.com/api/v1/api_usage")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n  \"api_key\": \"YOUR_API_KEY\"\n}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://apisv2.awardtoolapi.com/api/v1/api_usage")
  .header("Content-Type", "application/json")
  .body("{\n  \"api_key\": \"YOUR_API_KEY\"\n}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://apisv2.awardtoolapi.com/api/v1/api_usage', [
  'body' => '{
  "api_key": "YOUR_API_KEY"
}',
  'headers' => [
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://apisv2.awardtoolapi.com/api/v1/api_usage");
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"api_key\": \"YOUR_API_KEY\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Content-Type": "application/json"]
let parameters = ["api_key": "YOUR_API_KEY"] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://apisv2.awardtoolapi.com/api/v1/api_usage")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```