curl --request POST \
--url 'https://api.noresponse.org/v1/key_usage/batches' \
--header "Authorization: Bearer $NORESPONSE_API_KEY" \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: account-acct_7f3a9c' \
--data '{
"events": [
{
"key_sha256": "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08",
"ip": "203.0.113.24",
"occurred_at": "2026-10-23T09:14:07Z",
"user_agent": "python-requests/2.32.3",
"model": "gpt-4o-mini",
"input_tokens": 812,
"output_tokens": 164,
"sample_rate": 1
},
{
"key_sha256": "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08",
"ip": "2001:db8:4a::17",
"occurred_at": "2026-10-23T09:14:09.250Z",
"sample_rate": 0.25
}
]
}'
import { NoResponse } from "@noresponse/node";
const noResponse = new NoResponse({
apiKey: process.env["NORESPONSE_API_KEY"] ?? "",
});
async function run() {
const result = await noResponse.keyUsage.record({
idempotencyKey: "account-acct_7f3a9c",
body: {
events: [
{
keySha256: "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08",
ip: "203.0.113.24",
occurredAt: "2026-10-23T09:14:07Z",
userAgent: "python-requests/2.32.3",
model: "gpt-4o-mini",
inputTokens: 812,
outputTokens: 164,
},
{
keySha256: "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08",
ip: "2001:db8:4a::17",
occurredAt: "2026-10-23T09:14:09.250Z",
sampleRate: 0.25,
},
],
},
});
console.log(result);
}
run();
from noresponse import NoResponse
import os
with NoResponse(
api_key=os.getenv("NORESPONSE_API_KEY", ""),
) as no_response:
res = no_response.key_usage.record(idempotency_key="account-acct_7f3a9c", events=[
{
"key_sha256": "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08",
"ip": "203.0.113.24",
"occurred_at": "2026-10-23T09:14:07Z",
"user_agent": "python-requests/2.32.3",
"model": "gpt-4o-mini",
"input_tokens": 812,
"output_tokens": 164,
},
{
"key_sha256": "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08",
"ip": "2001:db8:4a::17",
"occurred_at": "2026-10-23T09:14:09.250Z",
"sample_rate": 0.25,
},
])
# Handle response
print(res)
package main
import(
"context"
"os"
noresponse "github.com/noresponsehq/go/v5"
"github.com/noresponsehq/go/v5/models/components"
"log"
)
func main() {
ctx := context.Background()
s := noresponse.New(
noresponse.WithSecurity(os.Getenv("NORESPONSE_API_KEY")),
)
res, err := s.KeyUsage.Record(ctx, "account-acct_7f3a9c", components.KeyUsageBatchRequest{
Events: []components.KeyUsageEvent{
components.KeyUsageEvent{
KeySha256: "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08",
IP: "203.0.113.24",
OccurredAt: "2026-10-23T09:14:07Z",
UserAgent: noresponse.Pointer("python-requests/2.32.3"),
Model: noresponse.Pointer("gpt-4o-mini"),
InputTokens: noresponse.Pointer[int64](812),
OutputTokens: noresponse.Pointer[int64](164),
},
components.KeyUsageEvent{
KeySha256: "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08",
IP: "2001:db8:4a::17",
OccurredAt: "2026-10-23T09:14:09.250Z",
SampleRate: noresponse.Pointer[float64](0.25),
},
},
})
if err != nil {
log.Fatal(err)
}
if res != nil {
// handle response
}
}
package hello.world;
import java.lang.Exception;
import java.util.List;
import org.noresponse.NoResponse;
import org.noresponse.models.errors.AuthenticationException;
import org.noresponse.models.errors.BadRequestException;
import org.noresponse.models.errors.ConflictException;
import org.noresponse.models.errors.NotFoundException;
import org.noresponse.models.errors.PermissionDeniedException;
import org.noresponse.models.errors.RateLimitException;
import org.noresponse.models.operations.RecordKeyUsageResponse;
import org.noresponse.models.shared.KeyUsageBatchRequest;
import org.noresponse.models.shared.KeyUsageEvent;
public class Application {
public static void main(String[] args) throws Exception {
NoResponse sdk = NoResponse.builder()
.apiKey(System.getenv().getOrDefault("NORESPONSE_API_KEY", ""))
.build();
RecordKeyUsageResponse res = sdk.keyUsage().record()
.idempotencyKey("account-acct_7f3a9c")
.body(KeyUsageBatchRequest.builder()
.events(List.of(
KeyUsageEvent.builder()
.keySha256("9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08")
.ip("203.0.113.24")
.occurredAt("2026-10-23T09:14:07Z")
.userAgent("python-requests/2.32.3")
.model("gpt-4o-mini")
.inputTokens(812L)
.outputTokens(164L)
.build(),
KeyUsageEvent.builder()
.keySha256("9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08")
.ip("2001:db8:4a::17")
.occurredAt("2026-10-23T09:14:09.250Z")
.sampleRate(0.25)
.build()))
.build())
.call();
if (res.keyUsageBatch().isPresent()) {
System.out.println(res.keyUsageBatch().get());
}
}
}
using NoResponse;
using NoResponse.Models.Shared;
using System;
using System.Collections.Generic;
var sdk = new NoResponseClient(apiKey: Environment.GetEnvironmentVariable("NORESPONSE_API_KEY"));
var res = await sdk.KeyUsage.RecordAsync(
body: new KeyUsageBatchRequest() {
Events = new List<KeyUsageEvent>() {
new KeyUsageEvent() {
KeySha256 = "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08",
Ip = "203.0.113.24",
OccurredAt = "2026-10-23T09:14:07Z",
UserAgent = "python-requests/2.32.3",
Model = "gpt-4o-mini",
InputTokens = 812,
OutputTokens = 164,
},
new KeyUsageEvent() {
KeySha256 = "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08",
Ip = "2001:db8:4a::17",
OccurredAt = "2026-10-23T09:14:09.250Z",
SampleRate = 0.25D,
},
},
},
idempotencyKey: "account-acct_7f3a9c"
);
// handle response
<?php
declare(strict_types=1);
require 'vendor/autoload.php';
use NoResponse;
use NoResponse\Models\Shared;
$sdk = NoResponse\NoResponseClient::builder()
->setSecurity(
getenv('NORESPONSE_API_KEY') ?: ''
)
->build();
$body = new Shared\KeyUsageBatchRequest(
events: [
new Shared\KeyUsageEvent(
keySha256: '9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08',
ip: '203.0.113.24',
occurredAt: '2026-10-23T09:14:07Z',
userAgent: 'python-requests/2.32.3',
model: 'gpt-4o-mini',
inputTokens: 812,
outputTokens: 164,
),
new Shared\KeyUsageEvent(
keySha256: '9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08',
ip: '2001:db8:4a::17',
occurredAt: '2026-10-23T09:14:09.250Z',
sampleRate: 0.25,
),
],
);
$response = $sdk->keyUsage->record(
body: $body,
idempotencyKey: 'account-acct_7f3a9c'
);
if ($response->keyUsageBatch !== null) {
// handle response
}
require 'noresponse'
Models = ::NoResponse::Models
s = ::NoResponse::NoResponseClient.new(
api_key: ENV.fetch('NORESPONSE_API_KEY', '')
)
res = s.key_usage.record(body: Models::Shared::KeyUsageBatchRequest.new(
events: [
Models::Shared::KeyUsageEvent.new(
key_sha256: '9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08',
ip: '203.0.113.24',
occurred_at: '2026-10-23T09:14:07Z',
user_agent: 'python-requests/2.32.3',
model: 'gpt-4o-mini',
input_tokens: 812,
output_tokens: 164
),
Models::Shared::KeyUsageEvent.new(
key_sha256: '9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08',
ip: '2001:db8:4a::17',
occurred_at: '2026-10-23T09:14:09.250Z',
sample_rate: 0.25
),
]
), idempotency_key: 'account-acct_7f3a9c')
unless res.nil?
# handle response
end
{
"id": "kub_01JA2ZE4M5N6P7Q8R9S0T1V2W3",
"received_at": "2026-10-23T09:14:12Z",
"accepted": 2,
"ignored": 0
}{
"type": "<string>",
"title": "<string>",
"status": 400,
"detail": "<string>",
"code": "invalid_request",
"request_id": "<string>",
"instance": "<string>",
"invalid_params": [
{
"field": "<string>",
"reason": "<string>",
"example": "<string>"
}
]
}{
"type": "<string>",
"title": "<string>",
"status": 401,
"detail": "<string>",
"code": "unauthorized",
"request_id": "<string>",
"instance": "<string>",
"invalid_params": [
{
"field": "<string>",
"reason": "<string>",
"example": "<string>"
}
]
}{
"type": "https://docs.noresponse.org/problems/workspace-forbidden",
"title": "Forbidden",
"status": 403,
"detail": "The API key does not carry a scope this operation accepts.",
"code": "workspace_forbidden",
"request_id": "0123456789abcdef0123456789abcdef"
}{
"type": "https://docs.noresponse.org/problems/idempotency-key-reused",
"title": "Idempotency key reused",
"status": 409,
"detail": "This Idempotency-Key was used with a different request body.",
"code": "idempotency_key_reused",
"request_id": "0123456789abcdef0123456789abcdef"
}{
"type": "<string>",
"title": "<string>",
"status": 413,
"detail": "<string>",
"code": "payload_too_large",
"request_id": "<string>",
"instance": "<string>",
"invalid_params": [
{
"field": "<string>",
"reason": "<string>",
"example": "<string>"
}
]
}{
"type": "<string>",
"title": "<string>",
"status": 415,
"detail": "<string>",
"code": "unsupported_media_type",
"request_id": "<string>",
"instance": "<string>",
"invalid_params": [
{
"field": "<string>",
"reason": "<string>",
"example": "<string>"
}
]
}{
"type": "https://docs.noresponse.org/problems/rate-limited",
"title": "Rate limited",
"status": 429,
"detail": "The tenant's assessment rate is exhausted; retry after the Retry-After interval.",
"code": "rate_limited",
"request_id": "0123456789abcdef0123456789abcdef"
}{
"type": "<string>",
"title": "<string>",
"status": 503,
"detail": "<string>",
"code": "service_unavailable",
"request_id": "<string>",
"instance": "<string>",
"invalid_params": [
{
"field": "<string>",
"reason": "<string>",
"example": "<string>"
}
]
}Report key usage
Records requests made with API keys your signup gate issued to your accounts, one event per request. Each event names the key by its SHA-256, the issued_credential.sha256 the account’s assessment carried, and gives the client ip, occurred_at and optionally user_agent, model, input_tokens and output_tokens. The Node and Python SDKs buffer events and send them in the background.
A batch holds 1 to 500 events and at most 256 KiB (413 above that). An event whose IP is not a public address, or whose occurred_at is more than 24 hours old or more than 5 minutes ahead, is counted in ignored. Sampling is allowed: sample_rate weights an event’s request and token counts.
NoResponse keeps no raw event. Request and token totals are kept per key for 30 days after the key’s last use, or your retention when that is shorter. The IP, user agent and model are kept only as keyed digests, the IP with its country, for 24 hours. When one key is used from 20 or more IP addresses, or from 3 or more countries, within 24 hours, every account whose assessment carried that key gets the shared_api_key reason in its current risk for 30 days.
Idempotency-Key is required: a retry with the same key and body answers the same record with Idempotent-Replayed: true and counts nothing again, and the same key with a different body answers 409. Requires the assess scope.
curl --request POST \
--url 'https://api.noresponse.org/v1/key_usage/batches' \
--header "Authorization: Bearer $NORESPONSE_API_KEY" \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: account-acct_7f3a9c' \
--data '{
"events": [
{
"key_sha256": "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08",
"ip": "203.0.113.24",
"occurred_at": "2026-10-23T09:14:07Z",
"user_agent": "python-requests/2.32.3",
"model": "gpt-4o-mini",
"input_tokens": 812,
"output_tokens": 164,
"sample_rate": 1
},
{
"key_sha256": "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08",
"ip": "2001:db8:4a::17",
"occurred_at": "2026-10-23T09:14:09.250Z",
"sample_rate": 0.25
}
]
}'
import { NoResponse } from "@noresponse/node";
const noResponse = new NoResponse({
apiKey: process.env["NORESPONSE_API_KEY"] ?? "",
});
async function run() {
const result = await noResponse.keyUsage.record({
idempotencyKey: "account-acct_7f3a9c",
body: {
events: [
{
keySha256: "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08",
ip: "203.0.113.24",
occurredAt: "2026-10-23T09:14:07Z",
userAgent: "python-requests/2.32.3",
model: "gpt-4o-mini",
inputTokens: 812,
outputTokens: 164,
},
{
keySha256: "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08",
ip: "2001:db8:4a::17",
occurredAt: "2026-10-23T09:14:09.250Z",
sampleRate: 0.25,
},
],
},
});
console.log(result);
}
run();
from noresponse import NoResponse
import os
with NoResponse(
api_key=os.getenv("NORESPONSE_API_KEY", ""),
) as no_response:
res = no_response.key_usage.record(idempotency_key="account-acct_7f3a9c", events=[
{
"key_sha256": "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08",
"ip": "203.0.113.24",
"occurred_at": "2026-10-23T09:14:07Z",
"user_agent": "python-requests/2.32.3",
"model": "gpt-4o-mini",
"input_tokens": 812,
"output_tokens": 164,
},
{
"key_sha256": "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08",
"ip": "2001:db8:4a::17",
"occurred_at": "2026-10-23T09:14:09.250Z",
"sample_rate": 0.25,
},
])
# Handle response
print(res)
package main
import(
"context"
"os"
noresponse "github.com/noresponsehq/go/v5"
"github.com/noresponsehq/go/v5/models/components"
"log"
)
func main() {
ctx := context.Background()
s := noresponse.New(
noresponse.WithSecurity(os.Getenv("NORESPONSE_API_KEY")),
)
res, err := s.KeyUsage.Record(ctx, "account-acct_7f3a9c", components.KeyUsageBatchRequest{
Events: []components.KeyUsageEvent{
components.KeyUsageEvent{
KeySha256: "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08",
IP: "203.0.113.24",
OccurredAt: "2026-10-23T09:14:07Z",
UserAgent: noresponse.Pointer("python-requests/2.32.3"),
Model: noresponse.Pointer("gpt-4o-mini"),
InputTokens: noresponse.Pointer[int64](812),
OutputTokens: noresponse.Pointer[int64](164),
},
components.KeyUsageEvent{
KeySha256: "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08",
IP: "2001:db8:4a::17",
OccurredAt: "2026-10-23T09:14:09.250Z",
SampleRate: noresponse.Pointer[float64](0.25),
},
},
})
if err != nil {
log.Fatal(err)
}
if res != nil {
// handle response
}
}
package hello.world;
import java.lang.Exception;
import java.util.List;
import org.noresponse.NoResponse;
import org.noresponse.models.errors.AuthenticationException;
import org.noresponse.models.errors.BadRequestException;
import org.noresponse.models.errors.ConflictException;
import org.noresponse.models.errors.NotFoundException;
import org.noresponse.models.errors.PermissionDeniedException;
import org.noresponse.models.errors.RateLimitException;
import org.noresponse.models.operations.RecordKeyUsageResponse;
import org.noresponse.models.shared.KeyUsageBatchRequest;
import org.noresponse.models.shared.KeyUsageEvent;
public class Application {
public static void main(String[] args) throws Exception {
NoResponse sdk = NoResponse.builder()
.apiKey(System.getenv().getOrDefault("NORESPONSE_API_KEY", ""))
.build();
RecordKeyUsageResponse res = sdk.keyUsage().record()
.idempotencyKey("account-acct_7f3a9c")
.body(KeyUsageBatchRequest.builder()
.events(List.of(
KeyUsageEvent.builder()
.keySha256("9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08")
.ip("203.0.113.24")
.occurredAt("2026-10-23T09:14:07Z")
.userAgent("python-requests/2.32.3")
.model("gpt-4o-mini")
.inputTokens(812L)
.outputTokens(164L)
.build(),
KeyUsageEvent.builder()
.keySha256("9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08")
.ip("2001:db8:4a::17")
.occurredAt("2026-10-23T09:14:09.250Z")
.sampleRate(0.25)
.build()))
.build())
.call();
if (res.keyUsageBatch().isPresent()) {
System.out.println(res.keyUsageBatch().get());
}
}
}
using NoResponse;
using NoResponse.Models.Shared;
using System;
using System.Collections.Generic;
var sdk = new NoResponseClient(apiKey: Environment.GetEnvironmentVariable("NORESPONSE_API_KEY"));
var res = await sdk.KeyUsage.RecordAsync(
body: new KeyUsageBatchRequest() {
Events = new List<KeyUsageEvent>() {
new KeyUsageEvent() {
KeySha256 = "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08",
Ip = "203.0.113.24",
OccurredAt = "2026-10-23T09:14:07Z",
UserAgent = "python-requests/2.32.3",
Model = "gpt-4o-mini",
InputTokens = 812,
OutputTokens = 164,
},
new KeyUsageEvent() {
KeySha256 = "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08",
Ip = "2001:db8:4a::17",
OccurredAt = "2026-10-23T09:14:09.250Z",
SampleRate = 0.25D,
},
},
},
idempotencyKey: "account-acct_7f3a9c"
);
// handle response
<?php
declare(strict_types=1);
require 'vendor/autoload.php';
use NoResponse;
use NoResponse\Models\Shared;
$sdk = NoResponse\NoResponseClient::builder()
->setSecurity(
getenv('NORESPONSE_API_KEY') ?: ''
)
->build();
$body = new Shared\KeyUsageBatchRequest(
events: [
new Shared\KeyUsageEvent(
keySha256: '9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08',
ip: '203.0.113.24',
occurredAt: '2026-10-23T09:14:07Z',
userAgent: 'python-requests/2.32.3',
model: 'gpt-4o-mini',
inputTokens: 812,
outputTokens: 164,
),
new Shared\KeyUsageEvent(
keySha256: '9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08',
ip: '2001:db8:4a::17',
occurredAt: '2026-10-23T09:14:09.250Z',
sampleRate: 0.25,
),
],
);
$response = $sdk->keyUsage->record(
body: $body,
idempotencyKey: 'account-acct_7f3a9c'
);
if ($response->keyUsageBatch !== null) {
// handle response
}
require 'noresponse'
Models = ::NoResponse::Models
s = ::NoResponse::NoResponseClient.new(
api_key: ENV.fetch('NORESPONSE_API_KEY', '')
)
res = s.key_usage.record(body: Models::Shared::KeyUsageBatchRequest.new(
events: [
Models::Shared::KeyUsageEvent.new(
key_sha256: '9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08',
ip: '203.0.113.24',
occurred_at: '2026-10-23T09:14:07Z',
user_agent: 'python-requests/2.32.3',
model: 'gpt-4o-mini',
input_tokens: 812,
output_tokens: 164
),
Models::Shared::KeyUsageEvent.new(
key_sha256: '9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08',
ip: '2001:db8:4a::17',
occurred_at: '2026-10-23T09:14:09.250Z',
sample_rate: 0.25
),
]
), idempotency_key: 'account-acct_7f3a9c')
unless res.nil?
# handle response
end
{
"id": "kub_01JA2ZE4M5N6P7Q8R9S0T1V2W3",
"received_at": "2026-10-23T09:14:12Z",
"accepted": 2,
"ignored": 0
}{
"type": "<string>",
"title": "<string>",
"status": 400,
"detail": "<string>",
"code": "invalid_request",
"request_id": "<string>",
"instance": "<string>",
"invalid_params": [
{
"field": "<string>",
"reason": "<string>",
"example": "<string>"
}
]
}{
"type": "<string>",
"title": "<string>",
"status": 401,
"detail": "<string>",
"code": "unauthorized",
"request_id": "<string>",
"instance": "<string>",
"invalid_params": [
{
"field": "<string>",
"reason": "<string>",
"example": "<string>"
}
]
}{
"type": "https://docs.noresponse.org/problems/workspace-forbidden",
"title": "Forbidden",
"status": 403,
"detail": "The API key does not carry a scope this operation accepts.",
"code": "workspace_forbidden",
"request_id": "0123456789abcdef0123456789abcdef"
}{
"type": "https://docs.noresponse.org/problems/idempotency-key-reused",
"title": "Idempotency key reused",
"status": 409,
"detail": "This Idempotency-Key was used with a different request body.",
"code": "idempotency_key_reused",
"request_id": "0123456789abcdef0123456789abcdef"
}{
"type": "<string>",
"title": "<string>",
"status": 413,
"detail": "<string>",
"code": "payload_too_large",
"request_id": "<string>",
"instance": "<string>",
"invalid_params": [
{
"field": "<string>",
"reason": "<string>",
"example": "<string>"
}
]
}{
"type": "<string>",
"title": "<string>",
"status": 415,
"detail": "<string>",
"code": "unsupported_media_type",
"request_id": "<string>",
"instance": "<string>",
"invalid_params": [
{
"field": "<string>",
"reason": "<string>",
"example": "<string>"
}
]
}{
"type": "https://docs.noresponse.org/problems/rate-limited",
"title": "Rate limited",
"status": 429,
"detail": "The tenant's assessment rate is exhausted; retry after the Retry-After interval.",
"code": "rate_limited",
"request_id": "0123456789abcdef0123456789abcdef"
}{
"type": "<string>",
"title": "<string>",
"status": 503,
"detail": "<string>",
"code": "service_unavailable",
"request_id": "<string>",
"instance": "<string>",
"invalid_params": [
{
"field": "<string>",
"reason": "<string>",
"example": "<string>"
}
]
}Authorizations
Your API key, sent as Authorization: Bearer <key>. A key is nrk_live_ or nrk_test_, a 26-character key id, _ and a 43-character secret. A key sees only its own environment's data.
Each key has one or more scopes: assess creates and reads assessments, records outcomes and reports key usage; history reads assessments, an account's current risk and an account's history, and erases an account; detailed adds the detailed view; webhooks registers, tests, rotates and deletes webhook endpoints; integrations registers and manages hosted provider integrations. A missing, unknown, revoked or expired key answers 401. A valid key without the scope an operation needs answers 403.
Headers
Opaque client key, 16 to 128 characters of [A-Za-z0-9._:-] (a UUID or ULID fits). Scoped to the workspace principal and bound to the canonical body for 24 hours.
16 - 128^[A-Za-z0-9._:-]{16,128}$Body
POST /v1/key_usage/batches body: facts about requests made with API keys your platform issued to your accounts, one event per request. Each event names the key by the SHA-256 that the assessment's issued_credential.sha256 carried, not the key itself. The SDKs buffer events and send them in the background. A batch holds 1 to 500 events and at most 256 KiB. Idempotency-Key is required and binds the body as on POST /v1/assessments, so a retried batch is counted once.
1 - 500 elementsShow child attributes
Show child attributes
Response
The batch was recorded: accepted events are counted and ignored ones added nothing. A replay of the same Idempotency-Key and body answers the record the first request created, with Idempotent-Replayed: true, and counts nothing again.
The 202 answer of POST /v1/key_usage/batches. A replay with the same Idempotency-Key and body answers the same record and counts nothing again.
Opaque, server-assigned id of the batch: 'kub_' and a 26-character Crockford base32 ULID.
^kub_[0-9A-HJKMNP-TV-Z]{26}$When NoResponse first recorded the batch.
Events counted.
0 <= x <= 500Events that added nothing: a private, reserved or unreadable ip, or an occurred_at more than 24 hours old or more than 5 minutes ahead.
0 <= x <= 500