Skip to main content
The TypeScript SDK and docs are currently in beta. Report issues on GitHub.

Example Usage

import { KeyAssignment } from "@openrouter/sdk/models";

let value: KeyAssignment = {
  assignedBy: "user_abc123",
  createdAt: "2025-08-24T10:30:00Z",
  guardrailId: "550e8400-e29b-41d4-a716-446655440001",
  id: "550e8400-e29b-41d4-a716-446655440000",
  keyHash: "c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93",
  keyLabel: "prod-key",
  keyName: "Production Key",
};

Fields

FieldTypeRequiredDescriptionExample
assignedBystring:heavy_check_mark:User ID of who made the assignmentuser_abc123
createdAtstring:heavy_check_mark:ISO 8601 timestamp of when the assignment was created2025-08-24T10:30:00Z
guardrailIdstring:heavy_check_mark:ID of the guardrail550e8400-e29b-41d4-a716-446655440001
idstring:heavy_check_mark:Unique identifier for the assignment550e8400-e29b-41d4-a716-446655440000
keyHashstring:heavy_check_mark:Hash of the assigned API keyc56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93
keyLabelstring:heavy_check_mark:Label of the API keyprod-key
keyNamestring:heavy_check_mark:Name of the API keyProduction Key