# Check Usage API

This API provides the overall invocation count for your Nected account. It’s helpful for monitoring usage, tracking consumption against plan limits, and integrating usage stats into your internal reporting or billing dashboards.

### Authentication

All requests require your Nected API key.

```
Nected-API-Key: <YOUR_API_KEY>
```

### **Endpoint**

```
GET https://api.nected.ai/dev/usage
```

### **Headers**

| Header         | Value               | Required |
| -------------- | ------------------- | -------- |
| Nected-API-Key | Your API key string | Yes      |

**Query Parameters**\
\&#xNAN;*None*

**Example Request (cURL)**

```bash
curl --location "https://api.nected.ai/dev/usage" \
  --header "Nected-API-Key: <YOUR_API_KEY>"
```

**Sample Response**

```json
{
  "data": {
    "invocations": 1000
  },
  "code": "success",
  "message": "Success."
}
```

**Response Fields**

| Field            | Type   | Description                              |
| ---------------- | ------ | ---------------------------------------- |
| data.invocations | number | Count of total invocations recorded.     |
| code             | string | Request status string (e.g., `success`). |
| message          | string | Human-readable status message.           |

### Error Handling

| HTTP Status | Error Code              | Description             | Recommended Action                   |
| ----------- | ----------------------- | ----------------------- | ------------------------------------ |
| 401         | UNAUTHORIZED            | Missing/invalid API key | Check the `Nected-API-Key` header    |
| 429         | TOO\_MANY\_REQUESTS     | Rate limit exceeded     | Back off and retry later             |
| 500         | INTERNAL\_SERVER\_ERROR | Unexpected system error | Retry; contact support if persistent |

### Notes & Best Practices

* Call this endpoint from secure server-side code only; do not expose your API key in client apps.
* For automation/monitoring, cache the value your system needs and poll at reasonable intervals to avoid rate limits.
