CREATE TABLE IF NOT EXISTS agent_token_usage (
    id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
    invocation UUID NOT NULL,
    session UUID NOT NULL,
    model_version UUID NOT NULL,
    input_tokens BIGINT NOT NULL DEFAULT 0,
    output_tokens BIGINT NOT NULL DEFAULT 0,
    cached_input_tokens BIGINT NOT NULL DEFAULT 0,
    total_tokens BIGINT NOT NULL DEFAULT 0,
    cost NUMERIC,
    currency TEXT,
    created_at TIMESTAMPTZ NOT NULL DEFAULT now()
);
