import { type Context, type Model, type SimpleStreamOptions, type StreamFunction } from '@mariozechner/pi-ai';
export interface InferenceUsageSummary {
    inputTokens: number;
    outputTokens: number;
    totalTokens: number;
    totalCostUsd: number;
}
export interface CloudInferenceReservation {
    id: string;
    request_id: string;
    status: string;
    reserved_cents: number;
}
interface CloudInferenceBillingConfig {
    baseUrl: string;
    orgId: string;
    workspaceId: string;
    token: string;
    required: boolean;
    estimateCents: number;
}
interface LoadedCloudConfig {
    config: CloudInferenceBillingConfig | null;
    required: boolean;
    disabledReason: string | null;
}
export declare function createInferenceUsageSummary(): InferenceUsageSummary;
export declare function addInferenceUsage(summary: InferenceUsageSummary, usage: unknown): void;
export declare function inferenceUsageToBillableCents(summary: InferenceUsageSummary): number | null;
export declare function createCloudInferenceBillingClient(env?: NodeJS.ProcessEnv, fetchFn?: typeof fetch): CloudInferenceBillingClient;
export declare function isStudiographCreditsMode(env?: NodeJS.ProcessEnv): boolean;
export declare function studiographCreditsModel(env?: NodeJS.ProcessEnv): Model<'studiograph-cloud-inference'>;
export declare function createCloudInferenceStreamFn(env?: NodeJS.ProcessEnv, fetchFn?: typeof fetch): StreamFunction<'studiograph-cloud-inference', SimpleStreamOptions>;
export declare class CloudInferenceBillingClient {
    private loaded;
    private fetchFn;
    constructor(loaded: LoadedCloudConfig, fetchFn: typeof fetch);
    isConfigured(): boolean;
    isRequired(): boolean;
    disabledReason(): string | null;
    estimateCents(): number;
    nextRequestId(prefix?: string): string;
    getAiSettings(): Promise<unknown | null>;
    reserve(input: {
        estimatedCents?: number;
        provider?: string | null;
        model?: string | null;
        requestId?: string;
        description?: string;
    }): Promise<CloudInferenceReservation | null>;
    settle(reservation: CloudInferenceReservation, input: {
        actualCents: number;
        inputTokens?: number;
        outputTokens?: number;
        description?: string;
    }): Promise<void>;
    release(reservation: CloudInferenceReservation, reason: string): Promise<void>;
    streamChat(context: Context, options?: SimpleStreamOptions): import("@mariozechner/pi-ai").AssistantMessageEventStream;
    private requireConfigOrNull;
    private runtimePath;
    private runStreamChat;
    private requestJson;
}
export {};
