import * as z from "zod/v4"; import { OpenEnum } from "../types/enums.js"; import { Result as SafeParseResult } from "../types/fp.js"; import { SDKValidationError } from "./errors/sdkvalidationerror.js"; /** * UTC window the spend is counted over (weeks start Monday); null for a lifetime budget that never resets. */ export declare const KeyBudgetResetInterval: { readonly Daily: "daily"; readonly Weekly: "weekly"; readonly Monthly: "monthly"; }; /** * UTC window the spend is counted over (weeks start Monday); null for a lifetime budget that never resets. */ export type KeyBudgetResetInterval = OpenEnum; /** * Which budget layer this is, in the order enforcement checks them: the workspace default guardrail against the member aggregate (`workspace_default_member`) and against this key (`workspace_default_key`), the member guardrail (`member`), the API key guardrail (`api_key`), a workspace budget (`workspace`), or the key's own limit (`key_limit`). */ export declare const KeyBudgetScope: { readonly WorkspaceDefaultMember: "workspace_default_member"; readonly WorkspaceDefaultKey: "workspace_default_key"; readonly Member: "member"; readonly ApiKey: "api_key"; readonly Workspace: "workspace"; readonly KeyLimit: "key_limit"; }; /** * Which budget layer this is, in the order enforcement checks them: the workspace default guardrail against the member aggregate (`workspace_default_member`) and against this key (`workspace_default_key`), the member guardrail (`member`), the API key guardrail (`api_key`), a workspace budget (`workspace`), or the key's own limit (`key_limit`). */ export type KeyBudgetScope = OpenEnum; /** * One budget layer that applies to requests made with this key, with the spend enforcement compares against it. */ export type KeyBudget = { /** * ID of the workspace budget for the `workspace` scope; null for other scopes. */ budgetId: string | null; /** * ID of the guardrail that carries this budget; null for other scopes. */ guardrailId: string | null; /** * Whether external BYOK inference spend counts toward this budget. */ includeByok: boolean; /** * Budget limit in USD for the current window. */ limitUsd: number; /** * `limit_usd - spend_usd`. Zero or negative means this layer rejects requests with a 403 until it resets. */ remainingUsd: number; /** * UTC window the spend is counted over (weeks start Monday); null for a lifetime budget that never resets. */ resetInterval: KeyBudgetResetInterval | null; /** * ISO 8601 UTC instant at which the window rolls over and spend returns to zero; null for a lifetime budget. */ resetsAt: Date | null; /** * Which budget layer this is, in the order enforcement checks them: the workspace default guardrail against the member aggregate (`workspace_default_member`) and against this key (`workspace_default_key`), the member guardrail (`member`), the API key guardrail (`api_key`), a workspace budget (`workspace`), or the key's own limit (`key_limit`). */ scope: KeyBudgetScope; /** * Spend in USD that enforcement counts against this limit in the current window: the member aggregate for member-scoped layers, otherwise this key or workspace. */ spendUsd: number; }; /** @internal */ export declare const KeyBudgetResetInterval$inboundSchema: z.ZodType; /** @internal */ export declare const KeyBudgetScope$inboundSchema: z.ZodType; /** @internal */ export declare const KeyBudget$inboundSchema: z.ZodType; export declare function keyBudgetFromJSON(jsonString: string): SafeParseResult; //# sourceMappingURL=keybudget.d.ts.map