@unkey/api
Version:
Developer-friendly & type-safe Typescript SDK specifically catered to leverage *@unkey/api* API.
47 lines (41 loc) • 1.25 kB
text/typescript
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
import * as z from "zod/v3";
/**
* Controls credit consumption for usage-based billing and quota enforcement.
*
* @remarks
* Omitting this field uses the default cost of 1 credit per verification.
* Credits provide globally consistent usage tracking, essential for paid APIs with strict quotas.
*/
export type KeysVerifyKeyCredits = {
/**
* Sets how many credits to deduct for this verification request.
*
* @remarks
* Use 0 for read-only operations or free tier access, higher values for premium features.
* Credits are deducted after all security checks pass.
* Essential for implementing usage-based pricing with different operation costs.
*/
cost: number;
};
/** @internal */
export type KeysVerifyKeyCredits$Outbound = {
cost: number;
};
/** @internal */
export const KeysVerifyKeyCredits$outboundSchema: z.ZodType<
KeysVerifyKeyCredits$Outbound,
z.ZodTypeDef,
KeysVerifyKeyCredits
> = z.object({
cost: z.number().int(),
});
export function keysVerifyKeyCreditsToJSON(
keysVerifyKeyCredits: KeysVerifyKeyCredits,
): string {
return JSON.stringify(
KeysVerifyKeyCredits$outboundSchema.parse(keysVerifyKeyCredits),
);
}