# API keys

> Kontiga is document fraud detection by Bynn Intelligence for insurers, letting agents, lenders and HR screening teams: every document is compared with a proprietary library of more than 300 million original documents, gathered over 20 years.

Documentation index: https://kontiga.com/llms.txt

Section: Reference. URL: https://kontiga.com/docs/keys

An API key lets your own systems call Kontiga for the workspace. A secret key is for a server, a restricted key is for one job with only the scopes it needs, and a publishable key starts an end customer's session from a page or an app. Every key is live or test. A secret is shown once, when the key is made or rolled.

Updated December 1, 2026

## The key object

- `id` (string): The key's id: `key_` and 32 hex characters. It is not the secret.
- `name` (string): The system that uses it.
- `kind` (enum): `secret`, `restricted` or `publishable`.
- `mode` (enum): `live` or `test`. A test key makes test objects that never bill.
- `prefix` (string): How its secret starts: `kt_live_` or `kt_test_` for a secret or restricted key, `kt_pub_live_` or `kt_pub_test_` for a publishable key (one made before 29 November 2026 starts `kt_pub_` and keeps working). The secret is the prefix and 64 hex characters.
- `last4` (string): The last four characters of its secret.
- `scopes` (array): For a restricted key: what it may do, each `resource:read` or `resource:write`, such as `documents:write` or `cases:read`. Write includes read. Empty on other keys.
- `origins` (array): For a publishable key: the exact web addresses it works from. Empty on other keys.
- `allow_native` (boolean): For a publishable key only: a native app, which sends no origin, may start a verification with it. A publishable key has at least one origin, or this set to `true`.
- `created_by` (string): Who made it: a member's id (`mem_`) or, for a device's key, the provisioning key's id (`key_`).
- `created_at` (string): When it was made.
- `last_used_at` (string): When it last made a call, to within ten minutes, or `null`.
- `expires_at` (string): When it stops working, or `null` for never.
- `status` (enum): `active`, or `expired` once past `expires_at` (its calls are refused with `key_expired`).
- `old_secret_expires_at` (string): After a roll that kept the old secret working: when it stops. `null` otherwise.
- `device_id` (string): For a device's restricted key: the device it was made for, or `null`.
- `labels` (object): For a device's restricted key: the labels a bulk revoke selects by, or `null`.
- `secret` (string): Only in the answer that makes or rolls the key. Store it then: it cannot be read again.

**A key**

```json
{
  "id": "key_bf17a8a43ad428b8b6de567666b9a46b",
  "name": "Document sync worker",
  "kind": "restricted",
  "mode": "live",
  "prefix": "kt_live_",
  "last4": "0f3c",
  "scopes": ["documents:write", "cases:read"],
  "origins": [],
  "created_by": "mem_34e593e655241ff32e468c8e54ddd984",
  "created_at": "2026-10-17T13:04:22Z",
  "last_used_at": "2026-11-27T08:58:40Z",
  "expires_at": "2027-04-16T00:00:00Z",
  "status": "active",
  "old_secret_expires_at": null,
  "device_id": null,
  "labels": null
}
```

## Create an API key

A key for a server (secret or restricted) or for a page or an app (publishable), live or test.

`POST /v1/keys`. Who may: Owner, Admin and Developer. CLI: `kontiga keys create --name <name> [--kind <secret|restricted|publishable>] [--mode <live|test>] [--scopes <scope,...>] [--origins <url,...>] [--allow-native]`. MCP tool: `create_api_key`.

**Parameters**
- `name` (string, required): Name it after the system that uses it. At most 80 characters.
- `kind` (enum, default "secret"): `secret` for a server, `restricted` for one job with only its scopes, `publishable` for a page or an app. A key can do only what your role may in its mode: a kind or a scope past it is refused with 403.
- `mode` (enum): Live or test. Left out, the call's own mode: the `Kontiga-Mode` header's, or live. One of `live`, `test`.
- `scopes` (array of string, default []): For a restricted key: what it may do, each `resource:read` or `resource:write`. Write includes read. At most 30 items.
- `origins` (array of URL, default []): For a publishable key: the exact addresses it works from, such as `https://apply.harbourline.example`. At most 20 items.
- `allow_native` (boolean): For a publishable key: `true` lets your iOS or Android app start a verification with it too (an app sends no origin). With it, `origins` may be empty.

**Returns** key with its secret: The key, and its secret shown once.

API:

```bash
curl -X POST https://api.kontiga.com/v1/keys \
  -H "Authorization: Bearer $KONTIGA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Loan origination server",
    "kind": "secret",
    "mode": "live"
  }'
```

CLI:

```bash
kontiga keys create \
  --name 'Loan origination server' \
  --kind secret \
  --mode live
```

MCP tool `create_api_key`:

```json
{
  "name": "create_api_key",
  "arguments": {
    "name": "Loan origination server",
    "kind": "secret",
    "mode": "live"
  }
}
```

TypeScript:

```typescript
import Kontiga from "@kontiga/sdk";

const kontiga = new Kontiga(); // reads KONTIGA_API_KEY
const result = await kontiga.keys.create({
  name: "Loan origination server",
  kind: "secret",
  mode: "live",
});
```

Python:

```python
from kontiga import Kontiga

kontiga = Kontiga()  # reads KONTIGA_API_KEY
result = kontiga.keys.create(
    name="Loan origination server",
    kind="secret",
    mode="live",
)
```

Go:

```go
client := kontiga.NewClient() // reads KONTIGA_API_KEY
result, err := client.Keys.Create(ctx, &kontiga.KeysCreateParams{
	Name: "Loan origination server",
	Kind: "secret",
	Mode: "live",
})
if err != nil {
	return err
}
```

Java:

```java
Kontiga kontiga = Kontiga.fromEnv(); // reads KONTIGA_API_KEY
var result = kontiga.keys().create(KeysCreateParams.builder()
    .name("Loan origination server")
    .kind("secret")
    .mode("live")
    .build());
```

.NET:

```csharp
var kontiga = new KontigaClient(); // reads KONTIGA_API_KEY
var result = await kontiga.Keys.CreateAsync(new KeysCreateOptions
{
    Name = "Loan origination server",
    Kind = "secret",
    Mode = "live",
});
```

PHP:

```php
$kontiga = new \Kontiga\Client(); // reads KONTIGA_API_KEY
$result = $kontiga->keys->create([
    'name' => 'Loan origination server',
    'kind' => 'secret',
    'mode' => 'live',
]);
```

Ruby:

```ruby
require "kontiga"

kontiga = Kontiga::Client.new # reads KONTIGA_API_KEY
result = kontiga.keys.create(
  name: "Loan origination server",
  kind: "secret",
  mode: "live"
)
```

Rust:

```rust
let kontiga = kontiga::Client::from_env()?; // reads KONTIGA_API_KEY
let result = kontiga
    .keys()
    .create(kontiga::keys::CreateParams {
        name: "Loan origination server".into(),
        kind: "secret".into(),
        mode: "live".into(),
        ..Default::default()
    })
    .await?;
```

Response, 201 Created:

```json
{
  "id": "key_8972d33cc4bd488fe0c563a5a75f389b",
  "name": "Loan origination server",
  "kind": "secret",
  "mode": "live",
  "prefix": "kt_live_",
  "last4": "0504",
  "scopes": [],
  "origins": [],
  "created_by": "mem_34e593e655241ff32e468c8e54ddd984",
  "created_at": "2026-11-27T11:30:00Z",
  "last_used_at": null,
  "expires_at": null,
  "status": "active",
  "old_secret_expires_at": null,
  "device_id": null,
  "labels": null,
  "secret": "kt_live_6243686061587473ee05800066d90868143a94e1b583b1c06c42fcb5756b0504"
}
```

## List API keys

The workspace's keys, live and test, each shown by its start and last four characters.

`GET /v1/keys`. Who may: Owner, Admin and Developer. CLI: `kontiga keys list`. MCP tool: `list_api_keys`.

**Parameters**

**Returns** list of keys: The keys, never their secrets.

API:

```bash
curl -X GET https://api.kontiga.com/v1/keys \
  -H "Authorization: Bearer $KONTIGA_API_KEY"
```

CLI:

```bash
kontiga keys list
```

MCP tool `list_api_keys`:

```json
{
  "name": "list_api_keys",
  "arguments": {}
}
```

TypeScript:

```typescript
import Kontiga from "@kontiga/sdk";

const kontiga = new Kontiga(); // reads KONTIGA_API_KEY
const result = await kontiga.keys.list();
```

Python:

```python
from kontiga import Kontiga

kontiga = Kontiga()  # reads KONTIGA_API_KEY
result = kontiga.keys.list()
```

Go:

```go
client := kontiga.NewClient() // reads KONTIGA_API_KEY
result, err := client.Keys.List(ctx)
if err != nil {
	return err
}
```

Java:

```java
Kontiga kontiga = Kontiga.fromEnv(); // reads KONTIGA_API_KEY
var result = kontiga.keys().list();
```

.NET:

```csharp
var kontiga = new KontigaClient(); // reads KONTIGA_API_KEY
var result = await kontiga.Keys.ListAsync();
```

PHP:

```php
$kontiga = new \Kontiga\Client(); // reads KONTIGA_API_KEY
$result = $kontiga->keys->list();
```

Ruby:

```ruby
require "kontiga"

kontiga = Kontiga::Client.new # reads KONTIGA_API_KEY
result = kontiga.keys.list
```

Rust:

```rust
let kontiga = kontiga::Client::from_env()?; // reads KONTIGA_API_KEY
let result = kontiga
    .keys()
    .list()
    .await?;
```

Response, 200 OK:

```json
{
  "items": [
    {
      "id": "key_8972d33cc4bd488fe0c563a5a75f389b",
      "name": "Loan origination server",
      "kind": "secret",
      "mode": "live",
      "prefix": "kt_live_",
      "last4": "174b",
      "scopes": [],
      "origins": [],
      "created_by": "mem_34e593e655241ff32e468c8e54ddd984",
      "created_at": "2026-11-27T11:30:00Z",
      "last_used_at": "2026-11-27T11:40:11Z",
      "expires_at": null,
      "status": "active",
      "old_secret_expires_at": "2026-11-28T11:35:00Z",
      "device_id": null,
      "labels": null
    },
    {
      "id": "key_b293cb646d8c36a861354dec94fa964f",
      "name": "Local development",
      "kind": "secret",
      "mode": "test",
      "prefix": "kt_test_",
      "last4": "9a1e",
      "scopes": [],
      "origins": [],
      "created_by": "mem_34e593e655241ff32e468c8e54ddd984",
      "created_at": "2026-10-02T09:12:45Z",
      "last_used_at": "2026-11-26T03:40:09Z",
      "expires_at": null,
      "status": "active",
      "old_secret_expires_at": null,
      "device_id": null,
      "labels": null
    }
  ],
  "next_cursor": null
}
```

## Change an API key

Rename a key, change the scopes of a restricted key, or the origins of a publishable key and whether a native app may start with it. Its secret stays the same.

`PATCH /v1/keys/{key_id}`. Who may: Owner, Admin and Developer. CLI: `kontiga keys update <key_id> [--name <name>] [--scopes <scope,...>] [--origins <url,...>] [--allow-native <true|false>]`. MCP tool: `update_api_key`.

**Parameters**
- `key_id` (id (key_), required): The key to change. Its secret stays the same. In the path.
- `name` (string): A new name. At most 80 characters.
- `scopes` (array of string): For a restricted key: its new scopes, each one your role holds in the key's mode. At most 30 items.
- `origins` (array of string): For a publishable key: its new origins. At most 20 items.
- `allow_native` (boolean): For a publishable key: whether a native app may start with it. Turning it off needs at least one origin left.

**Returns** key: The key as it now stands, never its secret.

API:

```bash
curl -X PATCH https://api.kontiga.com/v1/keys/key_bf17a8a43ad428b8b6de567666b9a46b \
  -H "Authorization: Bearer $KONTIGA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "scopes": [
      "documents:write",
      "cases:read",
      "people:read"
    ]
  }'
```

CLI:

```bash
kontiga keys update key_bf17a8a43ad428b8b6de567666b9a46b \
  --scopes documents:write,cases:read,people:read
```

MCP tool `update_api_key`:

```json
{
  "name": "update_api_key",
  "arguments": {
    "key_id": "key_bf17a8a43ad428b8b6de567666b9a46b",
    "scopes": [
      "documents:write",
      "cases:read",
      "people:read"
    ]
  }
}
```

TypeScript:

```typescript
import Kontiga from "@kontiga/sdk";

const kontiga = new Kontiga(); // reads KONTIGA_API_KEY
const result = await kontiga.keys.update("key_bf17a8a43ad428b8b6de567666b9a46b", {
  scopes: ["documents:write", "cases:read", "people:read"],
});
```

Python:

```python
from kontiga import Kontiga

kontiga = Kontiga()  # reads KONTIGA_API_KEY
result = kontiga.keys.update("key_bf17a8a43ad428b8b6de567666b9a46b", scopes=["documents:write", "cases:read", "people:read"])
```

Go:

```go
client := kontiga.NewClient() // reads KONTIGA_API_KEY
result, err := client.Keys.Update(ctx, "key_bf17a8a43ad428b8b6de567666b9a46b", &kontiga.KeysUpdateParams{
	Scopes: []string{"documents:write", "cases:read", "people:read"},
})
if err != nil {
	return err
}
```

Java:

```java
Kontiga kontiga = Kontiga.fromEnv(); // reads KONTIGA_API_KEY
var result = kontiga.keys().update("key_bf17a8a43ad428b8b6de567666b9a46b", KeysUpdateParams.builder()
    .scopes(List.of("documents:write", "cases:read", "people:read"))
    .build());
```

.NET:

```csharp
var kontiga = new KontigaClient(); // reads KONTIGA_API_KEY
var result = await kontiga.Keys.UpdateAsync("key_bf17a8a43ad428b8b6de567666b9a46b", new KeysUpdateOptions
{
    Scopes = new[] { "documents:write", "cases:read", "people:read" },
});
```

PHP:

```php
$kontiga = new \Kontiga\Client(); // reads KONTIGA_API_KEY
$result = $kontiga->keys->update('key_bf17a8a43ad428b8b6de567666b9a46b', [
    'scopes' => ['documents:write', 'cases:read', 'people:read'],
]);
```

Ruby:

```ruby
require "kontiga"

kontiga = Kontiga::Client.new # reads KONTIGA_API_KEY
result = kontiga.keys.update("key_bf17a8a43ad428b8b6de567666b9a46b", scopes: ["documents:write", "cases:read", "people:read"])
```

Rust:

```rust
let kontiga = kontiga::Client::from_env()?; // reads KONTIGA_API_KEY
let result = kontiga
    .keys()
    .update("key_bf17a8a43ad428b8b6de567666b9a46b".into(), kontiga::keys::UpdateParams {
        scopes: vec!["documents:write".into(), "cases:read".into(), "people:read".into()],
        ..Default::default()
    })
    .await?;
```

Response, 200 OK:

```json
{
  "id": "key_bf17a8a43ad428b8b6de567666b9a46b",
  "name": "Document sync worker",
  "kind": "restricted",
  "mode": "live",
  "prefix": "kt_live_",
  "last4": "0f3c",
  "scopes": ["documents:write", "cases:read"],
  "origins": [],
  "created_by": "mem_34e593e655241ff32e468c8e54ddd984",
  "created_at": "2026-10-17T13:04:22Z",
  "last_used_at": "2026-11-27T08:58:40Z",
  "expires_at": "2027-04-16T00:00:00Z",
  "status": "active",
  "old_secret_expires_at": null,
  "device_id": null,
  "labels": null
}
```

## Roll an API key

Replace a key's secret; the old one keeps working for the hours you give, up to 30 days, then stops.

`POST /v1/keys/{key_id}/roll`. Who may: Owner, Admin and Developer. CLI: `kontiga keys roll <key_id> [--expire-old-in-hours <0-720>]`. MCP tool: `roll_api_key`.

**Parameters**
- `key_id` (id (key_), required): The key whose secret to replace. Your role must hold everything the key can do, in its mode. In the path.
- `expire_old_in_hours` (integer, default 0): How long the old secret keeps working, up to 720 hours (30 days). 0 stops it at once.

**Returns** key with its secret: The key with its new secret, shown once.

API:

```bash
curl -X POST https://api.kontiga.com/v1/keys/key_8972d33cc4bd488fe0c563a5a75f389b/roll \
  -H "Authorization: Bearer $KONTIGA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "expire_old_in_hours": 24
  }'
```

CLI:

```bash
kontiga keys roll key_8972d33cc4bd488fe0c563a5a75f389b \
  --expire-old-in-hours 24
```

MCP tool `roll_api_key`:

```json
{
  "name": "roll_api_key",
  "arguments": {
    "key_id": "key_8972d33cc4bd488fe0c563a5a75f389b",
    "expire_old_in_hours": 24
  }
}
```

TypeScript:

```typescript
import Kontiga from "@kontiga/sdk";

const kontiga = new Kontiga(); // reads KONTIGA_API_KEY
const result = await kontiga.keys.roll("key_8972d33cc4bd488fe0c563a5a75f389b", {
  expire_old_in_hours: 24,
});
```

Python:

```python
from kontiga import Kontiga

kontiga = Kontiga()  # reads KONTIGA_API_KEY
result = kontiga.keys.roll("key_8972d33cc4bd488fe0c563a5a75f389b", expire_old_in_hours=24)
```

Go:

```go
client := kontiga.NewClient() // reads KONTIGA_API_KEY
result, err := client.Keys.Roll(ctx, "key_8972d33cc4bd488fe0c563a5a75f389b", &kontiga.KeysRollParams{
	ExpireOldInHours: 24,
})
if err != nil {
	return err
}
```

Java:

```java
Kontiga kontiga = Kontiga.fromEnv(); // reads KONTIGA_API_KEY
var result = kontiga.keys().roll("key_8972d33cc4bd488fe0c563a5a75f389b", KeysRollParams.builder()
    .expireOldInHours(24)
    .build());
```

.NET:

```csharp
var kontiga = new KontigaClient(); // reads KONTIGA_API_KEY
var result = await kontiga.Keys.RollAsync("key_8972d33cc4bd488fe0c563a5a75f389b", new KeysRollOptions
{
    ExpireOldInHours = 24,
});
```

PHP:

```php
$kontiga = new \Kontiga\Client(); // reads KONTIGA_API_KEY
$result = $kontiga->keys->roll('key_8972d33cc4bd488fe0c563a5a75f389b', [
    'expire_old_in_hours' => 24,
]);
```

Ruby:

```ruby
require "kontiga"

kontiga = Kontiga::Client.new # reads KONTIGA_API_KEY
result = kontiga.keys.roll("key_8972d33cc4bd488fe0c563a5a75f389b", expire_old_in_hours: 24)
```

Rust:

```rust
let kontiga = kontiga::Client::from_env()?; // reads KONTIGA_API_KEY
let result = kontiga
    .keys()
    .roll("key_8972d33cc4bd488fe0c563a5a75f389b".into(), kontiga::keys::RollParams {
        expire_old_in_hours: 24,
        ..Default::default()
    })
    .await?;
```

Response, 200 OK:

```json
{
  "id": "key_8972d33cc4bd488fe0c563a5a75f389b",
  "name": "Loan origination server",
  "kind": "secret",
  "mode": "live",
  "prefix": "kt_live_",
  "last4": "174b",
  "scopes": [],
  "origins": [],
  "created_by": "mem_34e593e655241ff32e468c8e54ddd984",
  "created_at": "2026-11-27T11:30:00Z",
  "last_used_at": "2026-11-27T11:34:10Z",
  "expires_at": null,
  "status": "active",
  "old_secret_expires_at": "2026-11-28T11:35:00Z",
  "device_id": null,
  "labels": null,
  "secret": "kt_live_c301af86f6fca145fac49f0dbe3ca95db5b1d11d755dceb2f8640aa63c9e174b"
}
```

## Revoke an API key

Stop a key at once: every call made with it is refused from now on. It cannot be undone; make a new key instead.

`DELETE /v1/keys/{key_id}`. Who may: Owner, Admin and Developer. CLI: `kontiga keys revoke <key_id>`. MCP tool: `revoke_api_key`.

**Parameters**
- `key_id` (id (key_), required): The key to stop. Every call with it is refused from now on. This cannot be undone. The answer is the key's id with `object` and `deleted: true`, as every delete. In the path.

**Returns** deleted key: The key's id, object key and deleted true: it stopped at once.

API:

```bash
curl -X DELETE https://api.kontiga.com/v1/keys/key_b293cb646d8c36a861354dec94fa964f \
  -H "Authorization: Bearer $KONTIGA_API_KEY"
```

CLI:

```bash
kontiga keys revoke key_b293cb646d8c36a861354dec94fa964f
```

MCP tool `revoke_api_key`:

```json
{
  "name": "revoke_api_key",
  "arguments": {
    "key_id": "key_b293cb646d8c36a861354dec94fa964f"
  }
}
```

TypeScript:

```typescript
import Kontiga from "@kontiga/sdk";

const kontiga = new Kontiga(); // reads KONTIGA_API_KEY
const result = await kontiga.keys.revoke("key_b293cb646d8c36a861354dec94fa964f");
```

Python:

```python
from kontiga import Kontiga

kontiga = Kontiga()  # reads KONTIGA_API_KEY
result = kontiga.keys.revoke("key_b293cb646d8c36a861354dec94fa964f")
```

Go:

```go
client := kontiga.NewClient() // reads KONTIGA_API_KEY
result, err := client.Keys.Revoke(ctx, "key_b293cb646d8c36a861354dec94fa964f")
if err != nil {
	return err
}
```

Java:

```java
Kontiga kontiga = Kontiga.fromEnv(); // reads KONTIGA_API_KEY
var result = kontiga.keys().revoke("key_b293cb646d8c36a861354dec94fa964f");
```

.NET:

```csharp
var kontiga = new KontigaClient(); // reads KONTIGA_API_KEY
var result = await kontiga.Keys.RevokeAsync("key_b293cb646d8c36a861354dec94fa964f");
```

PHP:

```php
$kontiga = new \Kontiga\Client(); // reads KONTIGA_API_KEY
$result = $kontiga->keys->revoke('key_b293cb646d8c36a861354dec94fa964f');
```

Ruby:

```ruby
require "kontiga"

kontiga = Kontiga::Client.new # reads KONTIGA_API_KEY
result = kontiga.keys.revoke("key_b293cb646d8c36a861354dec94fa964f")
```

Rust:

```rust
let kontiga = kontiga::Client::from_env()?; // reads KONTIGA_API_KEY
let result = kontiga
    .keys()
    .revoke("key_b293cb646d8c36a861354dec94fa964f".into())
    .await?;
```

Response, 200 OK:

```json
{
  "id": "key_b293cb646d8c36a861354dec94fa964f",
  "object": "key",
  "deleted": true
}
```

## Read how the keys are used

For each key: its requests in the last 24 hours and the last 7 days, its errors, when it was last used, and until when an old secret still works after a roll.

`GET /v1/key_usage`. Who may: Owner, Admin and Developer. CLI: `kontiga keys usage [--key-id <key_id>]`. MCP tool: `get_api_key_usage`.

**Parameters**
- `key_id` (id (key_)): One key. Every key when left out.

**Returns** list of key usage: One row per key, never a secret.

API:

```bash
curl -X GET "https://api.kontiga.com/v1/key_usage?key_id=key_8972d33cc4bd488fe0c563a5a75f389b" \
  -H "Authorization: Bearer $KONTIGA_API_KEY"
```

CLI:

```bash
kontiga keys usage --key-id key_8972d33cc4bd488fe0c563a5a75f389b
```

MCP tool `get_api_key_usage`:

```json
{
  "name": "get_api_key_usage",
  "arguments": {
    "key_id": "key_8972d33cc4bd488fe0c563a5a75f389b"
  }
}
```

TypeScript:

```typescript
import Kontiga from "@kontiga/sdk";

const kontiga = new Kontiga(); // reads KONTIGA_API_KEY
const result = await kontiga.keys.usage({
  key_id: "key_8972d33cc4bd488fe0c563a5a75f389b",
});
```

Python:

```python
from kontiga import Kontiga

kontiga = Kontiga()  # reads KONTIGA_API_KEY
result = kontiga.keys.usage(key_id="key_8972d33cc4bd488fe0c563a5a75f389b")
```

Go:

```go
client := kontiga.NewClient() // reads KONTIGA_API_KEY
result, err := client.Keys.Usage(ctx, &kontiga.KeysUsageParams{
	KeyId: "key_8972d33cc4bd488fe0c563a5a75f389b",
})
if err != nil {
	return err
}
```

Java:

```java
Kontiga kontiga = Kontiga.fromEnv(); // reads KONTIGA_API_KEY
var result = kontiga.keys().usage(KeysUsageParams.builder()
    .keyId("key_8972d33cc4bd488fe0c563a5a75f389b")
    .build());
```

.NET:

```csharp
var kontiga = new KontigaClient(); // reads KONTIGA_API_KEY
var result = await kontiga.Keys.UsageAsync(new KeysUsageOptions
{
    KeyId = "key_8972d33cc4bd488fe0c563a5a75f389b",
});
```

PHP:

```php
$kontiga = new \Kontiga\Client(); // reads KONTIGA_API_KEY
$result = $kontiga->keys->usage([
    'key_id' => 'key_8972d33cc4bd488fe0c563a5a75f389b',
]);
```

Ruby:

```ruby
require "kontiga"

kontiga = Kontiga::Client.new # reads KONTIGA_API_KEY
result = kontiga.keys.usage(key_id: "key_8972d33cc4bd488fe0c563a5a75f389b")
```

Rust:

```rust
let kontiga = kontiga::Client::from_env()?; // reads KONTIGA_API_KEY
let result = kontiga
    .keys()
    .usage(kontiga::keys::UsageParams {
        key_id: "key_8972d33cc4bd488fe0c563a5a75f389b".into(),
        ..Default::default()
    })
    .await?;
```

Response, 200 OK:

```json
{
  "items": [
    {
      "key_id": "key_8972d33cc4bd488fe0c563a5a75f389b",
      "requests_24h": 2602,
      "daily": [2310, 2475, 1980, 640, 512, 2390, 2602],
      "errors_24h": 14,
      "last_used_at": "2026-11-27T11:40:11Z",
      "old_secret_expires_at": "2026-11-28T11:35:00Z"
    }
  ],
  "next_cursor": null
}
```
