From b5bee4029b72290e13b35c88321e850b6f0cc4e3 Mon Sep 17 00:00:00 2001 From: Luca Steeb Date: Thu, 7 May 2026 21:23:58 +0700 Subject: [PATCH 01/25] feat: add global daily aggregation tables Adds globalDailyModelStats and globalDailySourceStats with the full hourly-stats column set, aggregated from log every 5 min by a new worker loop. Skips current-day rescans when no new logs since the last refresh. Co-Authored-By: Claude Opus 4.7 --- .../src/services/global-stats-aggregator.ts | 371 + .../src/services/project-stats-aggregator.ts | 4 +- apps/worker/src/worker.ts | 35 + .../1778152537_sudden_blue_marvel.sql | 98 + .../migrations/meta/1778152537_snapshot.json | 15732 ++++++++++++++++ packages/db/migrations/meta/_journal.json | 7 + packages/db/src/schema.ts | 140 + 7 files changed, 16385 insertions(+), 2 deletions(-) create mode 100644 apps/worker/src/services/global-stats-aggregator.ts create mode 100644 packages/db/migrations/1778152537_sudden_blue_marvel.sql create mode 100644 packages/db/migrations/meta/1778152537_snapshot.json diff --git a/apps/worker/src/services/global-stats-aggregator.ts b/apps/worker/src/services/global-stats-aggregator.ts new file mode 100644 index 0000000000..12a9cfc701 --- /dev/null +++ b/apps/worker/src/services/global-stats-aggregator.ts @@ -0,0 +1,371 @@ +import { + db, + log, + globalDailyModelStats, + globalDailySourceStats, + sql, + and, + isNull, +} from "@llmgateway/db"; +import { logger } from "@llmgateway/logger"; + +import { + formatUTCTimestamp, + getCommonAggregationFields, +} from "./project-stats-aggregator.js"; + +export const GLOBAL_DAILY_STATS_REFRESH_INTERVAL_SECONDS = + Number(process.env.GLOBAL_DAILY_STATS_REFRESH_INTERVAL_SECONDS) || 300; + +const STATS_BATCH_SIZE = Number(process.env.STATS_BATCH_SIZE) || 100; + +const STATS_BACKFILL_ENABLED = process.env.STATS_BACKFILL_ENABLED === "true"; +const STATS_BACKFILL_DAYS = Number(process.env.STATS_BACKFILL_DAYS) || 30; + +const STATS_STALE_ENABLED = process.env.STATS_STALE_ENABLED !== "false"; +const STATS_STALE_DAYS = Number(process.env.STATS_STALE_DAYS) || 7; + +function getCurrentDayStart(): string { + const now = new Date(); + return formatUTCTimestamp( + new Date( + Date.UTC( + now.getUTCFullYear(), + now.getUTCMonth(), + now.getUTCDate(), + 0, + 0, + 0, + 0, + ), + ), + ); +} + +async function recalculateGlobalDailyModelStats(dayTimestamp: string) { + const database = db; + + const modelStats = await database + .select({ + usedModel: log.usedModel, + usedProvider: log.usedProvider, + ...getCommonAggregationFields(), + }) + .from(log) + .where( + and( + sql`${log.createdAt} >= ${dayTimestamp}::timestamp`, + sql`${log.createdAt} < ${dayTimestamp}::timestamp + interval '1 day'`, + ), + ) + .groupBy(log.usedModel, log.usedProvider); + + for (const stat of modelStats) { + const { usedModel, usedProvider, ...statsFields } = stat; + await database + .insert(globalDailyModelStats) + .values({ + dayTimestamp: sql`${dayTimestamp}::timestamp`, + usedModel, + usedProvider, + ...statsFields, + }) + .onConflictDoUpdate({ + target: [ + globalDailyModelStats.dayTimestamp, + globalDailyModelStats.usedModel, + globalDailyModelStats.usedProvider, + ], + set: { + ...statsFields, + updatedAt: new Date(), + }, + }); + } +} + +async function recalculateGlobalDailySourceStats(dayTimestamp: string) { + const database = db; + + const sourceStats = await database + .select({ + source: sql`coalesce(${log.source}, 'unknown')`.as("source"), + ...getCommonAggregationFields(), + }) + .from(log) + .where( + and( + sql`${log.createdAt} >= ${dayTimestamp}::timestamp`, + sql`${log.createdAt} < ${dayTimestamp}::timestamp + interval '1 day'`, + ), + ) + .groupBy(sql`coalesce(${log.source}, 'unknown')`); + + for (const stat of sourceStats) { + const { source, ...statsFields } = stat; + await database + .insert(globalDailySourceStats) + .values({ + dayTimestamp: sql`${dayTimestamp}::timestamp`, + source, + ...statsFields, + }) + .onConflictDoUpdate({ + target: [ + globalDailySourceStats.dayTimestamp, + globalDailySourceStats.source, + ], + set: { + ...statsFields, + updatedAt: new Date(), + }, + }); + } +} + +async function recalculateGlobalDailyStats(dayTimestamp: string) { + await recalculateGlobalDailyModelStats(dayTimestamp); + await recalculateGlobalDailySourceStats(dayTimestamp); +} + +export async function aggregateHistoricalGlobalStats() { + const database = db; + const currentDayStart = getCurrentDayStart(); + let totalBucketsProcessed = 0; + + try { + // Phase 1: Re-process stale day buckets where new logs arrived + // after the last aggregation. Days are deduped via groupBy because each + // day has many (model, provider) rows in globalDailyModelStats. + if (STATS_STALE_ENABLED) { + const staleStart = + STATS_STALE_DAYS > 0 + ? formatUTCTimestamp( + // eslint-disable-next-line no-mixed-operators + new Date(Date.now() - STATS_STALE_DAYS * 24 * 60 * 60 * 1000), + ) + : undefined; + + logger.info( + `[global-stale] Scanning for stale day buckets (lookback: ${staleStart ?? "unlimited"})`, + ); + + const staleBuckets = await database + .select({ + dayTimestamp: + sql`to_char(${globalDailyModelStats.dayTimestamp}, 'YYYY-MM-DD HH24:MI:SS')`.as( + "dayTimestamp", + ), + }) + .from(globalDailyModelStats) + .where( + staleStart + ? sql`${globalDailyModelStats.dayTimestamp} >= ${staleStart}::timestamp` + : undefined, + ) + .groupBy(globalDailyModelStats.dayTimestamp) + .having( + sql`EXISTS ( + SELECT 1 FROM ${log} + WHERE ${log.createdAt} >= ${globalDailyModelStats.dayTimestamp} + AND ${log.createdAt} < ${globalDailyModelStats.dayTimestamp} + interval '1 day' + AND ${log.createdAt} > MIN(${globalDailyModelStats.updatedAt}) + LIMIT 1 + )`, + ) + .orderBy(globalDailyModelStats.dayTimestamp) + .limit(STATS_BATCH_SIZE); + + if (staleBuckets.length > 0) { + logger.info( + `[global-stale] Found ${staleBuckets.length} stale day buckets with new logs (oldest: ${staleBuckets[0].dayTimestamp}, newest: ${staleBuckets[staleBuckets.length - 1].dayTimestamp})`, + ); + + for (let i = 0; i < staleBuckets.length; i++) { + const bucket = staleBuckets[i]; + await recalculateGlobalDailyStats(bucket.dayTimestamp); + logger.info( + `[global-stale] Processed bucket ${i + 1}/${staleBuckets.length}: day=${bucket.dayTimestamp}`, + ); + } + + totalBucketsProcessed += staleBuckets.length; + + if (staleBuckets.length === STATS_BATCH_SIZE) { + logger.info( + `[global-stale] Batch limit reached (${STATS_BATCH_SIZE}), more stale buckets may remain — will continue in next run`, + ); + } + } else { + logger.debug("[global-stale] No stale buckets found"); + } + } + + // Phase 2: Backfill — find day buckets present in `log` but missing + // from globalDailyModelStats. + if (STATS_BACKFILL_ENABLED) { + const backfillStart = + STATS_BACKFILL_DAYS > 0 + ? formatUTCTimestamp( + // eslint-disable-next-line no-mixed-operators + new Date(Date.now() - STATS_BACKFILL_DAYS * 24 * 60 * 60 * 1000), + ) + : undefined; + + logger.info( + `[global-backfill] Scanning for unprocessed day buckets (lookback: ${backfillStart ?? "unlimited"})`, + ); + + const backfillBuckets = await database + .select({ + dayTimestamp: + sql`to_char(date_trunc('day', ${log.createdAt}), 'YYYY-MM-DD HH24:MI:SS')`.as( + "dayTimestamp", + ), + }) + .from(log) + .leftJoin( + globalDailyModelStats, + sql`${globalDailyModelStats.dayTimestamp} = date_trunc('day', ${log.createdAt})`, + ) + .where( + and( + sql`${log.createdAt} < ${currentDayStart}::timestamp`, + isNull(globalDailyModelStats.dayTimestamp), + backfillStart + ? sql`${log.createdAt} >= ${backfillStart}::timestamp` + : undefined, + ), + ) + .groupBy(sql`date_trunc('day', ${log.createdAt})`) + .orderBy(sql`date_trunc('day', ${log.createdAt}) ASC`) + .limit(STATS_BATCH_SIZE); + + if (backfillBuckets.length > 0) { + logger.info( + `[global-backfill] Found ${backfillBuckets.length} unprocessed day buckets (oldest: ${backfillBuckets[0].dayTimestamp}, newest: ${backfillBuckets[backfillBuckets.length - 1].dayTimestamp})`, + ); + + for (let i = 0; i < backfillBuckets.length; i++) { + const bucket = backfillBuckets[i]; + await recalculateGlobalDailyStats(bucket.dayTimestamp); + logger.info( + `[global-backfill] Processed bucket ${i + 1}/${backfillBuckets.length}: day=${bucket.dayTimestamp}`, + ); + } + + totalBucketsProcessed += backfillBuckets.length; + + if (backfillBuckets.length === STATS_BATCH_SIZE) { + logger.info( + `[global-backfill] Batch limit reached (${STATS_BATCH_SIZE}), more unprocessed buckets may remain — will continue in next run`, + ); + } else { + logger.info( + `[global-backfill] Complete: ${backfillBuckets.length} buckets processed`, + ); + } + } else { + logger.debug("[global-backfill] No unprocessed buckets found"); + } + } + + logger.info( + `Global daily stats aggregation complete: ${totalBucketsProcessed} total buckets processed`, + ); + + return { + bucketsProcessed: totalBucketsProcessed, + }; + } catch (error) { + logger.error( + "Error processing logs for global daily stats aggregation", + error instanceof Error ? error : new Error(String(error)), + ); + throw error; + } +} + +export async function refreshCurrentDayStats() { + const database = db; + const currentDayStart = getCurrentDayStart(); + + logger.info(`Refreshing current day global stats for ${currentDayStart}`); + + try { + // Skip the full-day rescan if nothing has changed since the last refresh. + // EXISTS+LIMIT 1 is an index-only scan on log_created_at_*_idx — sub-ms. + // Without this guard the worker rescans every row in the current day on + // every tick (288 times/day at 5-min cadence), which gets expensive once + // daily volume reaches millions. + const [watermark] = await database + .select({ + minUpdatedAt: sql`MIN(${globalDailyModelStats.updatedAt})`.as( + "minUpdatedAt", + ), + }) + .from(globalDailyModelStats) + .where( + sql`${globalDailyModelStats.dayTimestamp} = ${currentDayStart}::timestamp`, + ); + + if (watermark?.minUpdatedAt) { + const [{ hasNewLogs }] = await database + .select({ + hasNewLogs: sql`EXISTS ( + SELECT 1 FROM ${log} + WHERE ${log.createdAt} >= ${currentDayStart}::timestamp + AND ${log.createdAt} < ${currentDayStart}::timestamp + interval '1 day' + AND ${log.createdAt} > ${watermark.minUpdatedAt} + LIMIT 1 + )`.as("hasNewLogs"), + }) + .from(sql`(SELECT 1) AS dummy`); + + if (!hasNewLogs) { + logger.debug( + `No new logs since last refresh (${watermark.minUpdatedAt.toISOString()}), skipping current-day rescan`, + ); + return; + } + } + + await recalculateGlobalDailyStats(currentDayStart); + logger.info(`Refreshed current day global stats (${currentDayStart})`); + } catch (error) { + logger.error( + "Error refreshing current day global stats", + error instanceof Error ? error : new Error(String(error)), + ); + throw error; + } +} + +export async function refreshGlobalDailyStats() { + const start = Date.now(); + logger.info("Starting global daily stats refresh..."); + + try { + const liveStart = Date.now(); + await refreshCurrentDayStats(); + logger.info( + `Current day global stats refresh took ${Date.now() - liveStart}ms`, + ); + + const recentStart = Date.now(); + await aggregateHistoricalGlobalStats(); + logger.info( + `Global stale detection + backfill took ${Date.now() - recentStart}ms`, + ); + + logger.info( + `Global daily stats refresh complete in ${Date.now() - start}ms`, + ); + } catch (error) { + logger.error( + "Error refreshing global daily stats", + error instanceof Error ? error : new Error(String(error)), + ); + throw error; + } +} diff --git a/apps/worker/src/services/project-stats-aggregator.ts b/apps/worker/src/services/project-stats-aggregator.ts index 4fb706e2a5..ec3d9c9c2e 100644 --- a/apps/worker/src/services/project-stats-aggregator.ts +++ b/apps/worker/src/services/project-stats-aggregator.ts @@ -20,7 +20,7 @@ export const PROJECT_STATS_REFRESH_INTERVAL_SECONDS = * Avoids the pg driver's local-timezone interpretation of `timestamp without timezone` * by keeping timestamps as strings and casting via `::timestamp` in SQL. */ -function formatUTCTimestamp(date: Date): string { +export function formatUTCTimestamp(date: Date): string { return date.toISOString().slice(0, 19).replace("T", " "); } @@ -47,7 +47,7 @@ function getCurrentHourStart(): string { /** * Common aggregation select fields for all stats tables */ -function getCommonAggregationFields() { +export function getCommonAggregationFields() { return { requestCount: sql`count(*)::int`.as("requestCount"), errorCount: diff --git a/apps/worker/src/worker.ts b/apps/worker/src/worker.ts index d11777b744..6bee73e647 100644 --- a/apps/worker/src/worker.ts +++ b/apps/worker/src/worker.ts @@ -35,6 +35,10 @@ import { runFollowUpEmailsLoop, sendLowBalanceEmail, } from "./services/follow-up-emails.js"; +import { + GLOBAL_DAILY_STATS_REFRESH_INTERVAL_SECONDS, + refreshGlobalDailyStats, +} from "./services/global-stats-aggregator.js"; import { PROJECT_STATS_REFRESH_INTERVAL_SECONDS, refreshProjectHourlyStats, @@ -1557,6 +1561,33 @@ async function runProjectStatsLoop() { } } +async function runGlobalDailyStatsLoop() { + activeLoops++; + const interval = GLOBAL_DAILY_STATS_REFRESH_INTERVAL_SECONDS * 1000; + logger.info( + `Starting global daily stats loop (interval: ${GLOBAL_DAILY_STATS_REFRESH_INTERVAL_SECONDS} seconds)...`, + ); + + try { + while (!isStopRequested()) { + try { + await refreshGlobalDailyStats(); + + await interruptibleSleep(interval); + } catch (error) { + logger.error( + "Error in global daily stats loop", + error instanceof Error ? error : new Error(String(error)), + ); + await interruptibleSleep(5000); + } + } + } finally { + activeLoops--; + logger.info("Global daily stats loop stopped"); + } +} + async function runDataRetentionLoop() { activeLoops++; const interval = (process.env.NODE_ENV === "production" ? 300 : 60) * 1000; // 5 minutes in prod, 1 minute in dev @@ -1654,6 +1685,9 @@ export async function startWorker() { logger.info( `- Project hourly stats: runs every ${PROJECT_STATS_REFRESH_INTERVAL_SECONDS} seconds for dashboard aggregations`, ); + logger.info( + `- Global daily stats: runs every ${GLOBAL_DAILY_STATS_REFRESH_INTERVAL_SECONDS} seconds for cross-org aggregations`, + ); logger.info( "- Follow-up emails: runs every hour to check for lifecycle emails", ); @@ -1664,6 +1698,7 @@ export async function startWorker() { void runVideoWebhookLoop(); void runAggregatedStatsLoop(); void runProjectStatsLoop(); + void runGlobalDailyStatsLoop(); void runLogQueueLoop(); void runAutoTopUpLoop(); void runBatchProcessLoop(); diff --git a/packages/db/migrations/1778152537_sudden_blue_marvel.sql b/packages/db/migrations/1778152537_sudden_blue_marvel.sql new file mode 100644 index 0000000000..72828b009b --- /dev/null +++ b/packages/db/migrations/1778152537_sudden_blue_marvel.sql @@ -0,0 +1,98 @@ +CREATE TABLE "global_daily_model_stats" ( + "id" text PRIMARY KEY, + "created_at" timestamp DEFAULT now() NOT NULL, + "updated_at" timestamp DEFAULT now() NOT NULL, + "day_timestamp" timestamp NOT NULL, + "used_model" text NOT NULL, + "used_provider" text NOT NULL, + "request_count" integer DEFAULT 0 NOT NULL, + "error_count" integer DEFAULT 0 NOT NULL, + "cache_count" integer DEFAULT 0 NOT NULL, + "streamed_count" integer DEFAULT 0 NOT NULL, + "non_streamed_count" integer DEFAULT 0 NOT NULL, + "completed_count" integer DEFAULT 0 NOT NULL, + "length_limit_count" integer DEFAULT 0 NOT NULL, + "content_filter_count" integer DEFAULT 0 NOT NULL, + "tool_calls_count" integer DEFAULT 0 NOT NULL, + "canceled_count" integer DEFAULT 0 NOT NULL, + "unknown_finish_count" integer DEFAULT 0 NOT NULL, + "client_error_count" integer DEFAULT 0 NOT NULL, + "gateway_error_count" integer DEFAULT 0 NOT NULL, + "upstream_error_count" integer DEFAULT 0 NOT NULL, + "input_tokens" numeric DEFAULT '0' NOT NULL, + "output_tokens" numeric DEFAULT '0' NOT NULL, + "total_tokens" numeric DEFAULT '0' NOT NULL, + "reasoning_tokens" numeric DEFAULT '0' NOT NULL, + "cached_tokens" numeric DEFAULT '0' NOT NULL, + "cache_write_tokens" numeric DEFAULT '0' NOT NULL, + "cost" real DEFAULT 0 NOT NULL, + "input_cost" real DEFAULT 0 NOT NULL, + "output_cost" real DEFAULT 0 NOT NULL, + "request_cost" real DEFAULT 0 NOT NULL, + "data_storage_cost" real DEFAULT 0 NOT NULL, + "discount_savings" real DEFAULT 0 NOT NULL, + "image_input_cost" real DEFAULT 0 NOT NULL, + "image_output_cost" real DEFAULT 0 NOT NULL, + "video_output_cost" real DEFAULT 0 NOT NULL, + "cached_input_cost" real DEFAULT 0 NOT NULL, + "cache_write_input_cost" real DEFAULT 0 NOT NULL, + "credits_request_count" integer DEFAULT 0 NOT NULL, + "api_keys_request_count" integer DEFAULT 0 NOT NULL, + "credits_cost" real DEFAULT 0 NOT NULL, + "api_keys_cost" real DEFAULT 0 NOT NULL, + "credits_data_storage_cost" real DEFAULT 0 NOT NULL, + "api_keys_data_storage_cost" real DEFAULT 0 NOT NULL, + CONSTRAINT "global_daily_model_stats_day_timestamp_used_model_used_provider_unique" UNIQUE("day_timestamp","used_model","used_provider") +); +--> statement-breakpoint +CREATE TABLE "global_daily_source_stats" ( + "id" text PRIMARY KEY, + "created_at" timestamp DEFAULT now() NOT NULL, + "updated_at" timestamp DEFAULT now() NOT NULL, + "day_timestamp" timestamp NOT NULL, + "source" text NOT NULL, + "request_count" integer DEFAULT 0 NOT NULL, + "error_count" integer DEFAULT 0 NOT NULL, + "cache_count" integer DEFAULT 0 NOT NULL, + "streamed_count" integer DEFAULT 0 NOT NULL, + "non_streamed_count" integer DEFAULT 0 NOT NULL, + "completed_count" integer DEFAULT 0 NOT NULL, + "length_limit_count" integer DEFAULT 0 NOT NULL, + "content_filter_count" integer DEFAULT 0 NOT NULL, + "tool_calls_count" integer DEFAULT 0 NOT NULL, + "canceled_count" integer DEFAULT 0 NOT NULL, + "unknown_finish_count" integer DEFAULT 0 NOT NULL, + "client_error_count" integer DEFAULT 0 NOT NULL, + "gateway_error_count" integer DEFAULT 0 NOT NULL, + "upstream_error_count" integer DEFAULT 0 NOT NULL, + "input_tokens" numeric DEFAULT '0' NOT NULL, + "output_tokens" numeric DEFAULT '0' NOT NULL, + "total_tokens" numeric DEFAULT '0' NOT NULL, + "reasoning_tokens" numeric DEFAULT '0' NOT NULL, + "cached_tokens" numeric DEFAULT '0' NOT NULL, + "cache_write_tokens" numeric DEFAULT '0' NOT NULL, + "cost" real DEFAULT 0 NOT NULL, + "input_cost" real DEFAULT 0 NOT NULL, + "output_cost" real DEFAULT 0 NOT NULL, + "request_cost" real DEFAULT 0 NOT NULL, + "data_storage_cost" real DEFAULT 0 NOT NULL, + "discount_savings" real DEFAULT 0 NOT NULL, + "image_input_cost" real DEFAULT 0 NOT NULL, + "image_output_cost" real DEFAULT 0 NOT NULL, + "video_output_cost" real DEFAULT 0 NOT NULL, + "cached_input_cost" real DEFAULT 0 NOT NULL, + "cache_write_input_cost" real DEFAULT 0 NOT NULL, + "credits_request_count" integer DEFAULT 0 NOT NULL, + "api_keys_request_count" integer DEFAULT 0 NOT NULL, + "credits_cost" real DEFAULT 0 NOT NULL, + "api_keys_cost" real DEFAULT 0 NOT NULL, + "credits_data_storage_cost" real DEFAULT 0 NOT NULL, + "api_keys_data_storage_cost" real DEFAULT 0 NOT NULL, + CONSTRAINT "global_daily_source_stats_day_timestamp_source_unique" UNIQUE("day_timestamp","source") +); +--> statement-breakpoint +CREATE INDEX "global_daily_model_stats_day_timestamp_idx" ON "global_daily_model_stats" ("day_timestamp");--> statement-breakpoint +CREATE INDEX "global_daily_model_stats_used_model_day_timestamp_idx" ON "global_daily_model_stats" ("used_model","day_timestamp");--> statement-breakpoint +CREATE INDEX "global_daily_model_stats_p_m_time_idx" ON "global_daily_model_stats" ("used_provider","used_model","day_timestamp");--> statement-breakpoint +CREATE INDEX "global_daily_source_stats_day_timestamp_idx" ON "global_daily_source_stats" ("day_timestamp");--> statement-breakpoint +CREATE INDEX "global_daily_source_stats_source_day_timestamp_idx" ON "global_daily_source_stats" ("source","day_timestamp"); \ No newline at end of file diff --git a/packages/db/migrations/meta/1778152537_snapshot.json b/packages/db/migrations/meta/1778152537_snapshot.json new file mode 100644 index 0000000000..2f74beb0d2 --- /dev/null +++ b/packages/db/migrations/meta/1778152537_snapshot.json @@ -0,0 +1,15732 @@ +{ + "version": "8", + "dialect": "postgres", + "id": "8c9912e3-e386-4b7d-b988-818a00182dc1", + "prevId": "efe567e7-e675-497d-9405-474aacdf5237", + "ddl": [ + { + "isRlsEnabled": false, + "name": "account", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "api_key", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "api_key_hourly_model_stats", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "api_key_hourly_stats", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "api_key_iam_rule", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "audit_log", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "chat", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "chat_support_conversation", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "chat_support_message", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "chat_support_read_status", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "discount", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "enterprise_contact_submission", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "follow_up_email", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "global_daily_model_stats", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "global_daily_source_stats", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "guardrail_config", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "guardrail_rule", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "guardrail_violation", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "installation", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "lock", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "log", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "message", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "model", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "model_history", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "model_provider_mapping", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "model_provider_mapping_history", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "organization", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "organization_action", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "passkey", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "payment_failure", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "payment_method", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "project", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "project_hourly_model_stats", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "project_hourly_stats", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "provider", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "provider_key", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "rate_limit", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "referral", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "session", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "transaction", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "user", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "user_organization", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "verification", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "video_job", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "webhook_delivery_log", + "entityType": "tables", + "schema": "public" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "account" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "account_id", + "entityType": "columns", + "schema": "public", + "table": "account" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "provider_id", + "entityType": "columns", + "schema": "public", + "table": "account" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "entityType": "columns", + "schema": "public", + "table": "account" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "access_token", + "entityType": "columns", + "schema": "public", + "table": "account" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "refresh_token", + "entityType": "columns", + "schema": "public", + "table": "account" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id_token", + "entityType": "columns", + "schema": "public", + "table": "account" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "access_token_expires_at", + "entityType": "columns", + "schema": "public", + "table": "account" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "refresh_token_expires_at", + "entityType": "columns", + "schema": "public", + "table": "account" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "scope", + "entityType": "columns", + "schema": "public", + "table": "account" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "password", + "entityType": "columns", + "schema": "public", + "table": "account" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "public", + "table": "account" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "public", + "table": "account" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "api_key" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "public", + "table": "api_key" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "public", + "table": "api_key" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "token", + "entityType": "columns", + "schema": "public", + "table": "api_key" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "description", + "entityType": "columns", + "schema": "public", + "table": "api_key" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": { + "value": "'active'", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "status", + "entityType": "columns", + "schema": "public", + "table": "api_key" + }, + { + "type": "numeric", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "usage_limit", + "entityType": "columns", + "schema": "public", + "table": "api_key" + }, + { + "type": "numeric", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "'0'", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "usage", + "entityType": "columns", + "schema": "public", + "table": "api_key" + }, + { + "type": "numeric", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "period_usage_limit", + "entityType": "columns", + "schema": "public", + "table": "api_key" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "period_usage_duration_value", + "entityType": "columns", + "schema": "public", + "table": "api_key" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "period_usage_duration_unit", + "entityType": "columns", + "schema": "public", + "table": "api_key" + }, + { + "type": "numeric", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "'0'", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "current_period_usage", + "entityType": "columns", + "schema": "public", + "table": "api_key" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "current_period_started_at", + "entityType": "columns", + "schema": "public", + "table": "api_key" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "project_id", + "entityType": "columns", + "schema": "public", + "table": "api_key" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "created_by", + "entityType": "columns", + "schema": "public", + "table": "api_key" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_model_stats" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_model_stats" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_model_stats" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "api_key_id", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_model_stats" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "project_id", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_model_stats" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "hour_timestamp", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_model_stats" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "used_model", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_model_stats" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "used_provider", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_model_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "request_count", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_model_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "error_count", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_model_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "cache_count", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_model_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "streamed_count", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_model_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "non_streamed_count", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_model_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "completed_count", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_model_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "length_limit_count", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_model_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "content_filter_count", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_model_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "tool_calls_count", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_model_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "canceled_count", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_model_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "unknown_finish_count", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_model_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "client_error_count", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_model_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "gateway_error_count", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_model_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "upstream_error_count", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_model_stats" + }, + { + "type": "numeric", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "'0'", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "input_tokens", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_model_stats" + }, + { + "type": "numeric", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "'0'", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "output_tokens", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_model_stats" + }, + { + "type": "numeric", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "'0'", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "total_tokens", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_model_stats" + }, + { + "type": "numeric", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "'0'", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "reasoning_tokens", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_model_stats" + }, + { + "type": "numeric", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "'0'", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "cached_tokens", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_model_stats" + }, + { + "type": "numeric", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "'0'", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "cache_write_tokens", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_model_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "cost", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_model_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "input_cost", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_model_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "output_cost", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_model_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "request_cost", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_model_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "data_storage_cost", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_model_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "discount_savings", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_model_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "image_input_cost", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_model_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "image_output_cost", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_model_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "video_output_cost", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_model_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "cached_input_cost", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_model_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "cache_write_input_cost", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_model_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "credits_request_count", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_model_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "api_keys_request_count", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_model_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "credits_cost", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_model_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "api_keys_cost", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_model_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "credits_data_storage_cost", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_model_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "api_keys_data_storage_cost", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_model_stats" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_stats" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_stats" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_stats" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "api_key_id", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_stats" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "project_id", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_stats" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "hour_timestamp", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "request_count", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "error_count", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "cache_count", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "streamed_count", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "non_streamed_count", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "completed_count", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "length_limit_count", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "content_filter_count", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "tool_calls_count", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "canceled_count", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "unknown_finish_count", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "client_error_count", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "gateway_error_count", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "upstream_error_count", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_stats" + }, + { + "type": "numeric", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "'0'", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "input_tokens", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_stats" + }, + { + "type": "numeric", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "'0'", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "output_tokens", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_stats" + }, + { + "type": "numeric", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "'0'", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "total_tokens", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_stats" + }, + { + "type": "numeric", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "'0'", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "reasoning_tokens", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_stats" + }, + { + "type": "numeric", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "'0'", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "cached_tokens", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_stats" + }, + { + "type": "numeric", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "'0'", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "cache_write_tokens", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "cost", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "input_cost", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "output_cost", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "request_cost", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "data_storage_cost", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "discount_savings", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "image_input_cost", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "image_output_cost", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "video_output_cost", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "cached_input_cost", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "cache_write_input_cost", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "credits_request_count", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "api_keys_request_count", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "credits_cost", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "api_keys_cost", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "credits_data_storage_cost", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "api_keys_data_storage_cost", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_stats" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "api_key_iam_rule" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "public", + "table": "api_key_iam_rule" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "public", + "table": "api_key_iam_rule" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "api_key_id", + "entityType": "columns", + "schema": "public", + "table": "api_key_iam_rule" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "rule_type", + "entityType": "columns", + "schema": "public", + "table": "api_key_iam_rule" + }, + { + "type": "json", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "rule_value", + "entityType": "columns", + "schema": "public", + "table": "api_key_iam_rule" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "'active'", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "status", + "entityType": "columns", + "schema": "public", + "table": "api_key_iam_rule" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "audit_log" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "public", + "table": "audit_log" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "organization_id", + "entityType": "columns", + "schema": "public", + "table": "audit_log" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "entityType": "columns", + "schema": "public", + "table": "audit_log" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "action", + "entityType": "columns", + "schema": "public", + "table": "audit_log" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "resource_type", + "entityType": "columns", + "schema": "public", + "table": "audit_log" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "resource_id", + "entityType": "columns", + "schema": "public", + "table": "audit_log" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "metadata", + "entityType": "columns", + "schema": "public", + "table": "audit_log" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "chat" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "public", + "table": "chat" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "public", + "table": "chat" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "title", + "entityType": "columns", + "schema": "public", + "table": "chat" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "entityType": "columns", + "schema": "public", + "table": "chat" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "model", + "entityType": "columns", + "schema": "public", + "table": "chat" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": { + "value": "'active'", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "status", + "entityType": "columns", + "schema": "public", + "table": "chat" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": { + "value": "false", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "web_search", + "entityType": "columns", + "schema": "public", + "table": "chat" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "chat_support_conversation" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "public", + "table": "chat_support_conversation" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "public", + "table": "chat_support_conversation" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "public", + "table": "chat_support_conversation" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "email", + "entityType": "columns", + "schema": "public", + "table": "chat_support_conversation" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "ip_address", + "entityType": "columns", + "schema": "public", + "table": "chat_support_conversation" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_agent", + "entityType": "columns", + "schema": "public", + "table": "chat_support_conversation" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "message_count", + "entityType": "columns", + "schema": "public", + "table": "chat_support_conversation" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "escalated_at", + "entityType": "columns", + "schema": "public", + "table": "chat_support_conversation" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "archived_at", + "entityType": "columns", + "schema": "public", + "table": "chat_support_conversation" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "chat_support_message" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "public", + "table": "chat_support_message" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "conversation_id", + "entityType": "columns", + "schema": "public", + "table": "chat_support_message" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "role", + "entityType": "columns", + "schema": "public", + "table": "chat_support_message" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "content", + "entityType": "columns", + "schema": "public", + "table": "chat_support_message" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sequence", + "entityType": "columns", + "schema": "public", + "table": "chat_support_message" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "chat_support_read_status" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "conversation_id", + "entityType": "columns", + "schema": "public", + "table": "chat_support_read_status" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "admin_user_id", + "entityType": "columns", + "schema": "public", + "table": "chat_support_read_status" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "last_read_message_count", + "entityType": "columns", + "schema": "public", + "table": "chat_support_read_status" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "read_at", + "entityType": "columns", + "schema": "public", + "table": "chat_support_read_status" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "discount" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "public", + "table": "discount" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "public", + "table": "discount" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "organization_id", + "entityType": "columns", + "schema": "public", + "table": "discount" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "provider", + "entityType": "columns", + "schema": "public", + "table": "discount" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "model", + "entityType": "columns", + "schema": "public", + "table": "discount" + }, + { + "type": "numeric", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "discount_percent", + "entityType": "columns", + "schema": "public", + "table": "discount" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "reason", + "entityType": "columns", + "schema": "public", + "table": "discount" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "entityType": "columns", + "schema": "public", + "table": "discount" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "enterprise_contact_submission" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "public", + "table": "enterprise_contact_submission" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "public", + "table": "enterprise_contact_submission" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "public", + "table": "enterprise_contact_submission" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "email", + "entityType": "columns", + "schema": "public", + "table": "enterprise_contact_submission" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "country", + "entityType": "columns", + "schema": "public", + "table": "enterprise_contact_submission" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "size", + "entityType": "columns", + "schema": "public", + "table": "enterprise_contact_submission" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "message", + "entityType": "columns", + "schema": "public", + "table": "enterprise_contact_submission" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "honeypot", + "entityType": "columns", + "schema": "public", + "table": "enterprise_contact_submission" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "client_timestamp_ms", + "entityType": "columns", + "schema": "public", + "table": "enterprise_contact_submission" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "ip_address", + "entityType": "columns", + "schema": "public", + "table": "enterprise_contact_submission" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_agent", + "entityType": "columns", + "schema": "public", + "table": "enterprise_contact_submission" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "'pending'", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "spam_filter_status", + "entityType": "columns", + "schema": "public", + "table": "enterprise_contact_submission" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "rejection_reason", + "entityType": "columns", + "schema": "public", + "table": "enterprise_contact_submission" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "archived_at", + "entityType": "columns", + "schema": "public", + "table": "enterprise_contact_submission" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "follow_up_email" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "public", + "table": "follow_up_email" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "organization_id", + "entityType": "columns", + "schema": "public", + "table": "follow_up_email" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "email_type", + "entityType": "columns", + "schema": "public", + "table": "follow_up_email" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sent_to", + "entityType": "columns", + "schema": "public", + "table": "follow_up_email" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "global_daily_model_stats" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "public", + "table": "global_daily_model_stats" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "public", + "table": "global_daily_model_stats" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "day_timestamp", + "entityType": "columns", + "schema": "public", + "table": "global_daily_model_stats" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "used_model", + "entityType": "columns", + "schema": "public", + "table": "global_daily_model_stats" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "used_provider", + "entityType": "columns", + "schema": "public", + "table": "global_daily_model_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "request_count", + "entityType": "columns", + "schema": "public", + "table": "global_daily_model_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "error_count", + "entityType": "columns", + "schema": "public", + "table": "global_daily_model_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "cache_count", + "entityType": "columns", + "schema": "public", + "table": "global_daily_model_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "streamed_count", + "entityType": "columns", + "schema": "public", + "table": "global_daily_model_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "non_streamed_count", + "entityType": "columns", + "schema": "public", + "table": "global_daily_model_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "completed_count", + "entityType": "columns", + "schema": "public", + "table": "global_daily_model_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "length_limit_count", + "entityType": "columns", + "schema": "public", + "table": "global_daily_model_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "content_filter_count", + "entityType": "columns", + "schema": "public", + "table": "global_daily_model_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "tool_calls_count", + "entityType": "columns", + "schema": "public", + "table": "global_daily_model_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "canceled_count", + "entityType": "columns", + "schema": "public", + "table": "global_daily_model_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "unknown_finish_count", + "entityType": "columns", + "schema": "public", + "table": "global_daily_model_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "client_error_count", + "entityType": "columns", + "schema": "public", + "table": "global_daily_model_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "gateway_error_count", + "entityType": "columns", + "schema": "public", + "table": "global_daily_model_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "upstream_error_count", + "entityType": "columns", + "schema": "public", + "table": "global_daily_model_stats" + }, + { + "type": "numeric", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "'0'", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "input_tokens", + "entityType": "columns", + "schema": "public", + "table": "global_daily_model_stats" + }, + { + "type": "numeric", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "'0'", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "output_tokens", + "entityType": "columns", + "schema": "public", + "table": "global_daily_model_stats" + }, + { + "type": "numeric", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "'0'", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "total_tokens", + "entityType": "columns", + "schema": "public", + "table": "global_daily_model_stats" + }, + { + "type": "numeric", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "'0'", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "reasoning_tokens", + "entityType": "columns", + "schema": "public", + "table": "global_daily_model_stats" + }, + { + "type": "numeric", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "'0'", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "cached_tokens", + "entityType": "columns", + "schema": "public", + "table": "global_daily_model_stats" + }, + { + "type": "numeric", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "'0'", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "cache_write_tokens", + "entityType": "columns", + "schema": "public", + "table": "global_daily_model_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "cost", + "entityType": "columns", + "schema": "public", + "table": "global_daily_model_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "input_cost", + "entityType": "columns", + "schema": "public", + "table": "global_daily_model_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "output_cost", + "entityType": "columns", + "schema": "public", + "table": "global_daily_model_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "request_cost", + "entityType": "columns", + "schema": "public", + "table": "global_daily_model_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "data_storage_cost", + "entityType": "columns", + "schema": "public", + "table": "global_daily_model_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "discount_savings", + "entityType": "columns", + "schema": "public", + "table": "global_daily_model_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "image_input_cost", + "entityType": "columns", + "schema": "public", + "table": "global_daily_model_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "image_output_cost", + "entityType": "columns", + "schema": "public", + "table": "global_daily_model_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "video_output_cost", + "entityType": "columns", + "schema": "public", + "table": "global_daily_model_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "cached_input_cost", + "entityType": "columns", + "schema": "public", + "table": "global_daily_model_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "cache_write_input_cost", + "entityType": "columns", + "schema": "public", + "table": "global_daily_model_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "credits_request_count", + "entityType": "columns", + "schema": "public", + "table": "global_daily_model_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "api_keys_request_count", + "entityType": "columns", + "schema": "public", + "table": "global_daily_model_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "credits_cost", + "entityType": "columns", + "schema": "public", + "table": "global_daily_model_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "api_keys_cost", + "entityType": "columns", + "schema": "public", + "table": "global_daily_model_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "credits_data_storage_cost", + "entityType": "columns", + "schema": "public", + "table": "global_daily_model_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "api_keys_data_storage_cost", + "entityType": "columns", + "schema": "public", + "table": "global_daily_model_stats" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "global_daily_source_stats" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "public", + "table": "global_daily_source_stats" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "public", + "table": "global_daily_source_stats" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "day_timestamp", + "entityType": "columns", + "schema": "public", + "table": "global_daily_source_stats" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "source", + "entityType": "columns", + "schema": "public", + "table": "global_daily_source_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "request_count", + "entityType": "columns", + "schema": "public", + "table": "global_daily_source_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "error_count", + "entityType": "columns", + "schema": "public", + "table": "global_daily_source_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "cache_count", + "entityType": "columns", + "schema": "public", + "table": "global_daily_source_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "streamed_count", + "entityType": "columns", + "schema": "public", + "table": "global_daily_source_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "non_streamed_count", + "entityType": "columns", + "schema": "public", + "table": "global_daily_source_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "completed_count", + "entityType": "columns", + "schema": "public", + "table": "global_daily_source_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "length_limit_count", + "entityType": "columns", + "schema": "public", + "table": "global_daily_source_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "content_filter_count", + "entityType": "columns", + "schema": "public", + "table": "global_daily_source_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "tool_calls_count", + "entityType": "columns", + "schema": "public", + "table": "global_daily_source_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "canceled_count", + "entityType": "columns", + "schema": "public", + "table": "global_daily_source_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "unknown_finish_count", + "entityType": "columns", + "schema": "public", + "table": "global_daily_source_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "client_error_count", + "entityType": "columns", + "schema": "public", + "table": "global_daily_source_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "gateway_error_count", + "entityType": "columns", + "schema": "public", + "table": "global_daily_source_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "upstream_error_count", + "entityType": "columns", + "schema": "public", + "table": "global_daily_source_stats" + }, + { + "type": "numeric", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "'0'", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "input_tokens", + "entityType": "columns", + "schema": "public", + "table": "global_daily_source_stats" + }, + { + "type": "numeric", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "'0'", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "output_tokens", + "entityType": "columns", + "schema": "public", + "table": "global_daily_source_stats" + }, + { + "type": "numeric", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "'0'", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "total_tokens", + "entityType": "columns", + "schema": "public", + "table": "global_daily_source_stats" + }, + { + "type": "numeric", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "'0'", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "reasoning_tokens", + "entityType": "columns", + "schema": "public", + "table": "global_daily_source_stats" + }, + { + "type": "numeric", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "'0'", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "cached_tokens", + "entityType": "columns", + "schema": "public", + "table": "global_daily_source_stats" + }, + { + "type": "numeric", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "'0'", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "cache_write_tokens", + "entityType": "columns", + "schema": "public", + "table": "global_daily_source_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "cost", + "entityType": "columns", + "schema": "public", + "table": "global_daily_source_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "input_cost", + "entityType": "columns", + "schema": "public", + "table": "global_daily_source_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "output_cost", + "entityType": "columns", + "schema": "public", + "table": "global_daily_source_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "request_cost", + "entityType": "columns", + "schema": "public", + "table": "global_daily_source_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "data_storage_cost", + "entityType": "columns", + "schema": "public", + "table": "global_daily_source_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "discount_savings", + "entityType": "columns", + "schema": "public", + "table": "global_daily_source_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "image_input_cost", + "entityType": "columns", + "schema": "public", + "table": "global_daily_source_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "image_output_cost", + "entityType": "columns", + "schema": "public", + "table": "global_daily_source_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "video_output_cost", + "entityType": "columns", + "schema": "public", + "table": "global_daily_source_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "cached_input_cost", + "entityType": "columns", + "schema": "public", + "table": "global_daily_source_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "cache_write_input_cost", + "entityType": "columns", + "schema": "public", + "table": "global_daily_source_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "credits_request_count", + "entityType": "columns", + "schema": "public", + "table": "global_daily_source_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "api_keys_request_count", + "entityType": "columns", + "schema": "public", + "table": "global_daily_source_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "credits_cost", + "entityType": "columns", + "schema": "public", + "table": "global_daily_source_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "api_keys_cost", + "entityType": "columns", + "schema": "public", + "table": "global_daily_source_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "credits_data_storage_cost", + "entityType": "columns", + "schema": "public", + "table": "global_daily_source_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "api_keys_data_storage_cost", + "entityType": "columns", + "schema": "public", + "table": "global_daily_source_stats" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "guardrail_config" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "organization_id", + "entityType": "columns", + "schema": "public", + "table": "guardrail_config" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "true", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "enabled", + "entityType": "columns", + "schema": "public", + "table": "guardrail_config" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": { + "type": "unknown", + "value": "'{\"prompt_injection\":{\"enabled\":true,\"action\":\"block\"},\"jailbreak\":{\"enabled\":true,\"action\":\"block\"},\"pii_detection\":{\"enabled\":true,\"action\":\"redact\"},\"secrets\":{\"enabled\":true,\"action\":\"block\"},\"file_types\":{\"enabled\":true,\"action\":\"block\"},\"document_leakage\":{\"enabled\":false,\"action\":\"warn\"}}'" + }, + "generated": null, + "identity": null, + "name": "system_rules", + "entityType": "columns", + "schema": "public", + "table": "guardrail_config" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "10", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "max_file_size_mb", + "entityType": "columns", + "schema": "public", + "table": "guardrail_config" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 1, + "default": { + "value": "'{image/jpeg,image/png,image/gif,image/webp}'", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "allowed_file_types", + "entityType": "columns", + "schema": "public", + "table": "guardrail_config" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": { + "value": "'redact'", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "pii_action", + "entityType": "columns", + "schema": "public", + "table": "guardrail_config" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "public", + "table": "guardrail_config" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "public", + "table": "guardrail_config" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "guardrail_rule" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "organization_id", + "entityType": "columns", + "schema": "public", + "table": "guardrail_rule" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "public", + "table": "guardrail_rule" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "type", + "entityType": "columns", + "schema": "public", + "table": "guardrail_rule" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "config", + "entityType": "columns", + "schema": "public", + "table": "guardrail_rule" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "100", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "priority", + "entityType": "columns", + "schema": "public", + "table": "guardrail_rule" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "true", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "enabled", + "entityType": "columns", + "schema": "public", + "table": "guardrail_rule" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "'block'", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "action", + "entityType": "columns", + "schema": "public", + "table": "guardrail_rule" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "public", + "table": "guardrail_rule" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "public", + "table": "guardrail_rule" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "guardrail_violation" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "organization_id", + "entityType": "columns", + "schema": "public", + "table": "guardrail_violation" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "log_id", + "entityType": "columns", + "schema": "public", + "table": "guardrail_violation" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "rule_id", + "entityType": "columns", + "schema": "public", + "table": "guardrail_violation" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "rule_name", + "entityType": "columns", + "schema": "public", + "table": "guardrail_violation" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "category", + "entityType": "columns", + "schema": "public", + "table": "guardrail_violation" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "action_taken", + "entityType": "columns", + "schema": "public", + "table": "guardrail_violation" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "matched_pattern", + "entityType": "columns", + "schema": "public", + "table": "guardrail_violation" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "matched_content", + "entityType": "columns", + "schema": "public", + "table": "guardrail_violation" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "content_hash", + "entityType": "columns", + "schema": "public", + "table": "guardrail_violation" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "api_key_id", + "entityType": "columns", + "schema": "public", + "table": "guardrail_violation" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "model", + "entityType": "columns", + "schema": "public", + "table": "guardrail_violation" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "public", + "table": "guardrail_violation" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "installation" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "public", + "table": "installation" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "public", + "table": "installation" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "uuid", + "entityType": "columns", + "schema": "public", + "table": "installation" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "type", + "entityType": "columns", + "schema": "public", + "table": "installation" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "lock" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "public", + "table": "lock" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "public", + "table": "lock" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "key", + "entityType": "columns", + "schema": "public", + "table": "lock" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "request_id", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "organization_id", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "project_id", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "api_key_id", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "duration", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "time_to_first_token", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "time_to_first_reasoning_token", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "requested_model", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "requested_provider", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "used_model", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "used_model_mapping", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "used_provider", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "response_size", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "content", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "reasoning_content", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "json", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "tools", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "json", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "tool_choice", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "json", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "tool_results", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "finish_reason", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "unified_finish_reason", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "numeric", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "prompt_tokens", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "numeric", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "completion_tokens", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "numeric", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "total_tokens", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "numeric", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "reasoning_tokens", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "numeric", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "cached_tokens", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "numeric", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "cache_write_tokens", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "json", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "messages", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "real", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "temperature", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "max_tokens", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "real", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "top_p", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "real", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "frequency_penalty", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "real", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "presence_penalty", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "reasoning_effort", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "reasoning_max_tokens", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "effort", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "json", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "response_format", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": { + "value": "false", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "has_error", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "json", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "error_details", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "real", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "cost", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "real", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "input_cost", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "real", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "output_cost", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "real", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "cached_input_cost", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "real", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "cache_write_input_cost", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "real", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "request_cost", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "real", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "web_search_cost", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "numeric", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "image_input_tokens", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "numeric", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "image_output_tokens", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "real", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "image_input_cost", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "real", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "image_output_cost", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "real", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "video_output_cost", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "video_download_count", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "last_video_downloaded_at", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": { + "value": "false", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "estimated_cost", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "real", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "discount", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "pricing_tier", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": { + "value": "false", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "canceled", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": { + "value": "false", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "streamed", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": { + "value": "false", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "cached", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "mode", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "used_mode", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "source", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "json", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "custom_headers", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "json", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "routing_metadata", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "processed_at", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "raw_request", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "raw_response", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "upstream_request", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "upstream_response", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "trace_id", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": { + "value": "false", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "data_retention_cleaned_up", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "numeric", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "'0'", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "data_storage_cost", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "json", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "params", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_agent", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "json", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "plugins", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "json", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "plugin_results", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": { + "value": "false", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "retried", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "retried_by_log_id", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "internal_content_filter", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "gateway_content_filter_response", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "responses_api_id", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "responses_api_data", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "message" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "public", + "table": "message" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "public", + "table": "message" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "chat_id", + "entityType": "columns", + "schema": "public", + "table": "message" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "role", + "entityType": "columns", + "schema": "public", + "table": "message" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "content", + "entityType": "columns", + "schema": "public", + "table": "message" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "images", + "entityType": "columns", + "schema": "public", + "table": "message" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "reasoning", + "entityType": "columns", + "schema": "public", + "table": "message" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "tools", + "entityType": "columns", + "schema": "public", + "table": "message" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sequence", + "entityType": "columns", + "schema": "public", + "table": "message" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "model" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "public", + "table": "model" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "public", + "table": "model" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "released_at", + "entityType": "columns", + "schema": "public", + "table": "model" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "'(empty)'", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "public", + "table": "model" + }, + { + "type": "json", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "type": "unknown", + "value": "'[]'" + }, + "generated": null, + "identity": null, + "name": "aliases", + "entityType": "columns", + "schema": "public", + "table": "model" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "'(empty)'", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "description", + "entityType": "columns", + "schema": "public", + "table": "model" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "family", + "entityType": "columns", + "schema": "public", + "table": "model" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "false", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "free", + "entityType": "columns", + "schema": "public", + "table": "model" + }, + { + "type": "json", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "type": "unknown", + "value": "'[\"text\"]'" + }, + "generated": null, + "identity": null, + "name": "output", + "entityType": "columns", + "schema": "public", + "table": "model" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "false", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "image_input_required", + "entityType": "columns", + "schema": "public", + "table": "model" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "'stable'", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "stability", + "entityType": "columns", + "schema": "public", + "table": "model" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "'active'", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "status", + "entityType": "columns", + "schema": "public", + "table": "model" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "logs_count", + "entityType": "columns", + "schema": "public", + "table": "model" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "errors_count", + "entityType": "columns", + "schema": "public", + "table": "model" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "client_errors_count", + "entityType": "columns", + "schema": "public", + "table": "model" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "gateway_errors_count", + "entityType": "columns", + "schema": "public", + "table": "model" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "upstream_errors_count", + "entityType": "columns", + "schema": "public", + "table": "model" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "cached_count", + "entityType": "columns", + "schema": "public", + "table": "model" + }, + { + "type": "real", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "avg_time_to_first_token", + "entityType": "columns", + "schema": "public", + "table": "model" + }, + { + "type": "real", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "avg_time_to_first_reasoning_token", + "entityType": "columns", + "schema": "public", + "table": "model" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "stats_updated_at", + "entityType": "columns", + "schema": "public", + "table": "model" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "model_history" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "public", + "table": "model_history" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "public", + "table": "model_history" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "model_id", + "entityType": "columns", + "schema": "public", + "table": "model_history" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "minute_timestamp", + "entityType": "columns", + "schema": "public", + "table": "model_history" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "logs_count", + "entityType": "columns", + "schema": "public", + "table": "model_history" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "errors_count", + "entityType": "columns", + "schema": "public", + "table": "model_history" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "client_errors_count", + "entityType": "columns", + "schema": "public", + "table": "model_history" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "gateway_errors_count", + "entityType": "columns", + "schema": "public", + "table": "model_history" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "upstream_errors_count", + "entityType": "columns", + "schema": "public", + "table": "model_history" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "cached_count", + "entityType": "columns", + "schema": "public", + "table": "model_history" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "total_input_tokens", + "entityType": "columns", + "schema": "public", + "table": "model_history" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "total_output_tokens", + "entityType": "columns", + "schema": "public", + "table": "model_history" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "total_tokens", + "entityType": "columns", + "schema": "public", + "table": "model_history" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "total_reasoning_tokens", + "entityType": "columns", + "schema": "public", + "table": "model_history" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "total_cached_tokens", + "entityType": "columns", + "schema": "public", + "table": "model_history" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "total_duration", + "entityType": "columns", + "schema": "public", + "table": "model_history" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "total_time_to_first_token", + "entityType": "columns", + "schema": "public", + "table": "model_history" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "total_time_to_first_reasoning_token", + "entityType": "columns", + "schema": "public", + "table": "model_history" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "total_cost", + "entityType": "columns", + "schema": "public", + "table": "model_history" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "model_provider_mapping" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "public", + "table": "model_provider_mapping" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "public", + "table": "model_provider_mapping" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "model_id", + "entityType": "columns", + "schema": "public", + "table": "model_provider_mapping" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "provider_id", + "entityType": "columns", + "schema": "public", + "table": "model_provider_mapping" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "model_name", + "entityType": "columns", + "schema": "public", + "table": "model_provider_mapping" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "region", + "entityType": "columns", + "schema": "public", + "table": "model_provider_mapping" + }, + { + "type": "numeric", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "input_price", + "entityType": "columns", + "schema": "public", + "table": "model_provider_mapping" + }, + { + "type": "numeric", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "output_price", + "entityType": "columns", + "schema": "public", + "table": "model_provider_mapping" + }, + { + "type": "numeric", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "cached_input_price", + "entityType": "columns", + "schema": "public", + "table": "model_provider_mapping" + }, + { + "type": "numeric", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "cache_write_input_price", + "entityType": "columns", + "schema": "public", + "table": "model_provider_mapping" + }, + { + "type": "numeric", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "cache_write_input_price1h", + "entityType": "columns", + "schema": "public", + "table": "model_provider_mapping" + }, + { + "type": "numeric", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "image_input_price", + "entityType": "columns", + "schema": "public", + "table": "model_provider_mapping" + }, + { + "type": "numeric", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "request_price", + "entityType": "columns", + "schema": "public", + "table": "model_provider_mapping" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "context_size", + "entityType": "columns", + "schema": "public", + "table": "model_provider_mapping" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "max_output", + "entityType": "columns", + "schema": "public", + "table": "model_provider_mapping" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "false", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "streaming", + "entityType": "columns", + "schema": "public", + "table": "model_provider_mapping" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "vision", + "entityType": "columns", + "schema": "public", + "table": "model_provider_mapping" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "reasoning", + "entityType": "columns", + "schema": "public", + "table": "model_provider_mapping" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "false", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "reasoning_max_tokens", + "entityType": "columns", + "schema": "public", + "table": "model_provider_mapping" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "reasoning_output", + "entityType": "columns", + "schema": "public", + "table": "model_provider_mapping" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "tools", + "entityType": "columns", + "schema": "public", + "table": "model_provider_mapping" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "false", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "json_output", + "entityType": "columns", + "schema": "public", + "table": "model_provider_mapping" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "false", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "json_output_schema", + "entityType": "columns", + "schema": "public", + "table": "model_provider_mapping" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "false", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "web_search", + "entityType": "columns", + "schema": "public", + "table": "model_provider_mapping" + }, + { + "type": "numeric", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "web_search_price", + "entityType": "columns", + "schema": "public", + "table": "model_provider_mapping" + }, + { + "type": "numeric", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "'0'", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "discount", + "entityType": "columns", + "schema": "public", + "table": "model_provider_mapping" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "'stable'", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "stability", + "entityType": "columns", + "schema": "public", + "table": "model_provider_mapping" + }, + { + "type": "json", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "supported_parameters", + "entityType": "columns", + "schema": "public", + "table": "model_provider_mapping" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "test", + "entityType": "columns", + "schema": "public", + "table": "model_provider_mapping" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "deprecated_at", + "entityType": "columns", + "schema": "public", + "table": "model_provider_mapping" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "deactivated_at", + "entityType": "columns", + "schema": "public", + "table": "model_provider_mapping" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "'active'", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "status", + "entityType": "columns", + "schema": "public", + "table": "model_provider_mapping" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "logs_count", + "entityType": "columns", + "schema": "public", + "table": "model_provider_mapping" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "errors_count", + "entityType": "columns", + "schema": "public", + "table": "model_provider_mapping" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "client_errors_count", + "entityType": "columns", + "schema": "public", + "table": "model_provider_mapping" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "gateway_errors_count", + "entityType": "columns", + "schema": "public", + "table": "model_provider_mapping" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "upstream_errors_count", + "entityType": "columns", + "schema": "public", + "table": "model_provider_mapping" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "cached_count", + "entityType": "columns", + "schema": "public", + "table": "model_provider_mapping" + }, + { + "type": "real", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "avg_time_to_first_token", + "entityType": "columns", + "schema": "public", + "table": "model_provider_mapping" + }, + { + "type": "real", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "avg_time_to_first_reasoning_token", + "entityType": "columns", + "schema": "public", + "table": "model_provider_mapping" + }, + { + "type": "real", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "routing_uptime", + "entityType": "columns", + "schema": "public", + "table": "model_provider_mapping" + }, + { + "type": "real", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "routing_latency", + "entityType": "columns", + "schema": "public", + "table": "model_provider_mapping" + }, + { + "type": "real", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "routing_throughput", + "entityType": "columns", + "schema": "public", + "table": "model_provider_mapping" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "routing_total_requests", + "entityType": "columns", + "schema": "public", + "table": "model_provider_mapping" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "stats_updated_at", + "entityType": "columns", + "schema": "public", + "table": "model_provider_mapping" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "model_provider_mapping_history" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "public", + "table": "model_provider_mapping_history" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "public", + "table": "model_provider_mapping_history" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "model_id", + "entityType": "columns", + "schema": "public", + "table": "model_provider_mapping_history" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "provider_id", + "entityType": "columns", + "schema": "public", + "table": "model_provider_mapping_history" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "model_provider_mapping_id", + "entityType": "columns", + "schema": "public", + "table": "model_provider_mapping_history" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "minute_timestamp", + "entityType": "columns", + "schema": "public", + "table": "model_provider_mapping_history" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "logs_count", + "entityType": "columns", + "schema": "public", + "table": "model_provider_mapping_history" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "errors_count", + "entityType": "columns", + "schema": "public", + "table": "model_provider_mapping_history" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "client_errors_count", + "entityType": "columns", + "schema": "public", + "table": "model_provider_mapping_history" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "gateway_errors_count", + "entityType": "columns", + "schema": "public", + "table": "model_provider_mapping_history" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "upstream_errors_count", + "entityType": "columns", + "schema": "public", + "table": "model_provider_mapping_history" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "cached_count", + "entityType": "columns", + "schema": "public", + "table": "model_provider_mapping_history" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "total_input_tokens", + "entityType": "columns", + "schema": "public", + "table": "model_provider_mapping_history" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "total_output_tokens", + "entityType": "columns", + "schema": "public", + "table": "model_provider_mapping_history" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "total_tokens", + "entityType": "columns", + "schema": "public", + "table": "model_provider_mapping_history" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "total_reasoning_tokens", + "entityType": "columns", + "schema": "public", + "table": "model_provider_mapping_history" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "total_cached_tokens", + "entityType": "columns", + "schema": "public", + "table": "model_provider_mapping_history" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "total_duration", + "entityType": "columns", + "schema": "public", + "table": "model_provider_mapping_history" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "total_time_to_first_token", + "entityType": "columns", + "schema": "public", + "table": "model_provider_mapping_history" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "total_time_to_first_reasoning_token", + "entityType": "columns", + "schema": "public", + "table": "model_provider_mapping_history" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "total_cost", + "entityType": "columns", + "schema": "public", + "table": "model_provider_mapping_history" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "organization" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "public", + "table": "organization" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "public", + "table": "organization" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "public", + "table": "organization" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "billing_email", + "entityType": "columns", + "schema": "public", + "table": "organization" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "billing_company", + "entityType": "columns", + "schema": "public", + "table": "organization" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "billing_address", + "entityType": "columns", + "schema": "public", + "table": "organization" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "billing_tax_id", + "entityType": "columns", + "schema": "public", + "table": "organization" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "billing_notes", + "entityType": "columns", + "schema": "public", + "table": "organization" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "stripe_customer_id", + "entityType": "columns", + "schema": "public", + "table": "organization" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "stripe_subscription_id", + "entityType": "columns", + "schema": "public", + "table": "organization" + }, + { + "type": "numeric", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "'0'", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "credits", + "entityType": "columns", + "schema": "public", + "table": "organization" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "false", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "auto_top_up_enabled", + "entityType": "columns", + "schema": "public", + "table": "organization" + }, + { + "type": "numeric", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": { + "value": "'10'", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "auto_top_up_threshold", + "entityType": "columns", + "schema": "public", + "table": "organization" + }, + { + "type": "numeric", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": { + "value": "'10'", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "auto_top_up_amount", + "entityType": "columns", + "schema": "public", + "table": "organization" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "'free'", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "plan", + "entityType": "columns", + "schema": "public", + "table": "organization" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "plan_expires_at", + "entityType": "columns", + "schema": "public", + "table": "organization" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "false", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "subscription_cancelled", + "entityType": "columns", + "schema": "public", + "table": "organization" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "trial_start_date", + "entityType": "columns", + "schema": "public", + "table": "organization" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "trial_end_date", + "entityType": "columns", + "schema": "public", + "table": "organization" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "false", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "is_trial_active", + "entityType": "columns", + "schema": "public", + "table": "organization" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "'none'", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "retention_level", + "entityType": "columns", + "schema": "public", + "table": "organization" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": { + "value": "'active'", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "status", + "entityType": "columns", + "schema": "public", + "table": "organization" + }, + { + "type": "numeric", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "'0'", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "referral_earnings", + "entityType": "columns", + "schema": "public", + "table": "organization" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "payment_failure_count", + "entityType": "columns", + "schema": "public", + "table": "organization" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "last_payment_failure_at", + "entityType": "columns", + "schema": "public", + "table": "organization" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "payment_failure_started_at", + "entityType": "columns", + "schema": "public", + "table": "organization" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "false", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "is_personal", + "entityType": "columns", + "schema": "public", + "table": "organization" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "'none'", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "dev_plan", + "entityType": "columns", + "schema": "public", + "table": "organization" + }, + { + "type": "numeric", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "'0'", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "dev_plan_credits_used", + "entityType": "columns", + "schema": "public", + "table": "organization" + }, + { + "type": "numeric", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "'0'", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "dev_plan_credits_limit", + "entityType": "columns", + "schema": "public", + "table": "organization" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "dev_plan_billing_cycle_start", + "entityType": "columns", + "schema": "public", + "table": "organization" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "dev_plan_stripe_subscription_id", + "entityType": "columns", + "schema": "public", + "table": "organization" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "false", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "dev_plan_cancelled", + "entityType": "columns", + "schema": "public", + "table": "organization" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "dev_plan_expires_at", + "entityType": "columns", + "schema": "public", + "table": "organization" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "'monthly'", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "dev_plan_cycle", + "entityType": "columns", + "schema": "public", + "table": "organization" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "false", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "dev_plan_allow_all_models", + "entityType": "columns", + "schema": "public", + "table": "organization" + }, + { + "type": "numeric", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "last_top_up_amount", + "entityType": "columns", + "schema": "public", + "table": "organization" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "organization_action" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "public", + "table": "organization_action" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "public", + "table": "organization_action" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "organization_id", + "entityType": "columns", + "schema": "public", + "table": "organization_action" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "type", + "entityType": "columns", + "schema": "public", + "table": "organization_action" + }, + { + "type": "numeric", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "amount", + "entityType": "columns", + "schema": "public", + "table": "organization_action" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "description", + "entityType": "columns", + "schema": "public", + "table": "organization_action" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "passkey" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "public", + "table": "passkey" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "public", + "table": "passkey" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "public", + "table": "passkey" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "public_key", + "entityType": "columns", + "schema": "public", + "table": "passkey" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "entityType": "columns", + "schema": "public", + "table": "passkey" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "credential_id", + "entityType": "columns", + "schema": "public", + "table": "passkey" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "counter", + "entityType": "columns", + "schema": "public", + "table": "passkey" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "device_type", + "entityType": "columns", + "schema": "public", + "table": "passkey" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "backed_up", + "entityType": "columns", + "schema": "public", + "table": "passkey" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "transports", + "entityType": "columns", + "schema": "public", + "table": "passkey" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "aaguid", + "entityType": "columns", + "schema": "public", + "table": "passkey" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "payment_failure" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "public", + "table": "payment_failure" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "organization_id", + "entityType": "columns", + "schema": "public", + "table": "payment_failure" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_email", + "entityType": "columns", + "schema": "public", + "table": "payment_failure" + }, + { + "type": "numeric", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "amount", + "entityType": "columns", + "schema": "public", + "table": "payment_failure" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "'USD'", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "currency", + "entityType": "columns", + "schema": "public", + "table": "payment_failure" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "decline_code", + "entityType": "columns", + "schema": "public", + "table": "payment_failure" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "error_code", + "entityType": "columns", + "schema": "public", + "table": "payment_failure" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "failure_message", + "entityType": "columns", + "schema": "public", + "table": "payment_failure" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "stripe_payment_intent_id", + "entityType": "columns", + "schema": "public", + "table": "payment_failure" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "source", + "entityType": "columns", + "schema": "public", + "table": "payment_failure" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "payment_method" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "public", + "table": "payment_method" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "public", + "table": "payment_method" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "stripe_payment_method_id", + "entityType": "columns", + "schema": "public", + "table": "payment_method" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "organization_id", + "entityType": "columns", + "schema": "public", + "table": "payment_method" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "type", + "entityType": "columns", + "schema": "public", + "table": "payment_method" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "false", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "is_default", + "entityType": "columns", + "schema": "public", + "table": "payment_method" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "project" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "public", + "table": "project" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "public", + "table": "project" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "public", + "table": "project" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "organization_id", + "entityType": "columns", + "schema": "public", + "table": "project" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "false", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "caching_enabled", + "entityType": "columns", + "schema": "public", + "table": "project" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "60", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "cache_duration_seconds", + "entityType": "columns", + "schema": "public", + "table": "project" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "'hybrid'", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "mode", + "entityType": "columns", + "schema": "public", + "table": "project" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": { + "value": "'active'", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "status", + "entityType": "columns", + "schema": "public", + "table": "project" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_model_stats" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_model_stats" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_model_stats" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "project_id", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_model_stats" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "hour_timestamp", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_model_stats" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "used_model", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_model_stats" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "used_provider", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_model_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "request_count", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_model_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "error_count", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_model_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "cache_count", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_model_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "streamed_count", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_model_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "non_streamed_count", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_model_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "completed_count", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_model_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "length_limit_count", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_model_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "content_filter_count", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_model_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "tool_calls_count", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_model_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "canceled_count", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_model_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "unknown_finish_count", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_model_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "client_error_count", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_model_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "gateway_error_count", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_model_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "upstream_error_count", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_model_stats" + }, + { + "type": "numeric", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "'0'", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "input_tokens", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_model_stats" + }, + { + "type": "numeric", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "'0'", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "output_tokens", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_model_stats" + }, + { + "type": "numeric", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "'0'", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "total_tokens", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_model_stats" + }, + { + "type": "numeric", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "'0'", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "reasoning_tokens", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_model_stats" + }, + { + "type": "numeric", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "'0'", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "cached_tokens", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_model_stats" + }, + { + "type": "numeric", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "'0'", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "cache_write_tokens", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_model_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "cost", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_model_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "input_cost", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_model_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "output_cost", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_model_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "request_cost", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_model_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "data_storage_cost", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_model_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "discount_savings", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_model_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "image_input_cost", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_model_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "image_output_cost", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_model_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "video_output_cost", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_model_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "cached_input_cost", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_model_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "cache_write_input_cost", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_model_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "credits_request_count", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_model_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "api_keys_request_count", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_model_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "credits_cost", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_model_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "api_keys_cost", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_model_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "credits_data_storage_cost", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_model_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "api_keys_data_storage_cost", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_model_stats" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_stats" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_stats" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_stats" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "project_id", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_stats" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "hour_timestamp", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "request_count", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "error_count", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "cache_count", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "streamed_count", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "non_streamed_count", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "completed_count", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "length_limit_count", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "content_filter_count", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "tool_calls_count", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "canceled_count", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "unknown_finish_count", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "client_error_count", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "gateway_error_count", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "upstream_error_count", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_stats" + }, + { + "type": "numeric", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "'0'", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "input_tokens", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_stats" + }, + { + "type": "numeric", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "'0'", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "output_tokens", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_stats" + }, + { + "type": "numeric", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "'0'", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "total_tokens", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_stats" + }, + { + "type": "numeric", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "'0'", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "reasoning_tokens", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_stats" + }, + { + "type": "numeric", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "'0'", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "cached_tokens", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_stats" + }, + { + "type": "numeric", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "'0'", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "cache_write_tokens", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "cost", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "input_cost", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "output_cost", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "request_cost", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "data_storage_cost", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "discount_savings", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "image_input_cost", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "image_output_cost", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "video_output_cost", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "cached_input_cost", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "cache_write_input_cost", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "credits_request_count", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "api_keys_request_count", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "credits_cost", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "api_keys_cost", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "credits_data_storage_cost", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "api_keys_data_storage_cost", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_stats" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "provider" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "public", + "table": "provider" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "public", + "table": "provider" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "public", + "table": "provider" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "description", + "entityType": "columns", + "schema": "public", + "table": "provider" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "streaming", + "entityType": "columns", + "schema": "public", + "table": "provider" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "cancellation", + "entityType": "columns", + "schema": "public", + "table": "provider" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "color", + "entityType": "columns", + "schema": "public", + "table": "provider" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "website", + "entityType": "columns", + "schema": "public", + "table": "provider" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "announcement", + "entityType": "columns", + "schema": "public", + "table": "provider" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "'active'", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "status", + "entityType": "columns", + "schema": "public", + "table": "provider" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "logs_count", + "entityType": "columns", + "schema": "public", + "table": "provider" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "errors_count", + "entityType": "columns", + "schema": "public", + "table": "provider" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "client_errors_count", + "entityType": "columns", + "schema": "public", + "table": "provider" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "gateway_errors_count", + "entityType": "columns", + "schema": "public", + "table": "provider" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "upstream_errors_count", + "entityType": "columns", + "schema": "public", + "table": "provider" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "cached_count", + "entityType": "columns", + "schema": "public", + "table": "provider" + }, + { + "type": "real", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "avg_time_to_first_token", + "entityType": "columns", + "schema": "public", + "table": "provider" + }, + { + "type": "real", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "avg_time_to_first_reasoning_token", + "entityType": "columns", + "schema": "public", + "table": "provider" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "stats_updated_at", + "entityType": "columns", + "schema": "public", + "table": "provider" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "provider_key" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "public", + "table": "provider_key" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "public", + "table": "provider_key" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "token", + "entityType": "columns", + "schema": "public", + "table": "provider_key" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "provider", + "entityType": "columns", + "schema": "public", + "table": "provider_key" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "public", + "table": "provider_key" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "base_url", + "entityType": "columns", + "schema": "public", + "table": "provider_key" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "options", + "entityType": "columns", + "schema": "public", + "table": "provider_key" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": { + "value": "'active'", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "status", + "entityType": "columns", + "schema": "public", + "table": "provider_key" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "organization_id", + "entityType": "columns", + "schema": "public", + "table": "provider_key" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "rate_limit" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "public", + "table": "rate_limit" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "public", + "table": "rate_limit" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "organization_id", + "entityType": "columns", + "schema": "public", + "table": "rate_limit" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "provider", + "entityType": "columns", + "schema": "public", + "table": "rate_limit" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "model", + "entityType": "columns", + "schema": "public", + "table": "rate_limit" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "max_rpm", + "entityType": "columns", + "schema": "public", + "table": "rate_limit" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "max_rpd", + "entityType": "columns", + "schema": "public", + "table": "rate_limit" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "reason", + "entityType": "columns", + "schema": "public", + "table": "rate_limit" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "referral" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "public", + "table": "referral" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "public", + "table": "referral" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "referrer_organization_id", + "entityType": "columns", + "schema": "public", + "table": "referral" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "referred_organization_id", + "entityType": "columns", + "schema": "public", + "table": "referral" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "session" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "expires_at", + "entityType": "columns", + "schema": "public", + "table": "session" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "token", + "entityType": "columns", + "schema": "public", + "table": "session" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "public", + "table": "session" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "public", + "table": "session" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "ip_address", + "entityType": "columns", + "schema": "public", + "table": "session" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_agent", + "entityType": "columns", + "schema": "public", + "table": "session" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "entityType": "columns", + "schema": "public", + "table": "session" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "transaction" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "public", + "table": "transaction" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "public", + "table": "transaction" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "organization_id", + "entityType": "columns", + "schema": "public", + "table": "transaction" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "type", + "entityType": "columns", + "schema": "public", + "table": "transaction" + }, + { + "type": "numeric", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "amount", + "entityType": "columns", + "schema": "public", + "table": "transaction" + }, + { + "type": "numeric", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "credit_amount", + "entityType": "columns", + "schema": "public", + "table": "transaction" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "'USD'", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "currency", + "entityType": "columns", + "schema": "public", + "table": "transaction" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "'completed'", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "status", + "entityType": "columns", + "schema": "public", + "table": "transaction" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "stripe_payment_intent_id", + "entityType": "columns", + "schema": "public", + "table": "transaction" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "stripe_invoice_id", + "entityType": "columns", + "schema": "public", + "table": "transaction" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "description", + "entityType": "columns", + "schema": "public", + "table": "transaction" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "related_transaction_id", + "entityType": "columns", + "schema": "public", + "table": "transaction" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "refund_reason", + "entityType": "columns", + "schema": "public", + "table": "transaction" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "user" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "public", + "table": "user" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "public", + "table": "user" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "public", + "table": "user" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "email", + "entityType": "columns", + "schema": "public", + "table": "user" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "false", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "email_verified", + "entityType": "columns", + "schema": "public", + "table": "user" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "image", + "entityType": "columns", + "schema": "public", + "table": "user" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "false", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "onboarding_completed", + "entityType": "columns", + "schema": "public", + "table": "user" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "false", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "newsletter_subscribed", + "entityType": "columns", + "schema": "public", + "table": "user" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "'active'", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "status", + "entityType": "columns", + "schema": "public", + "table": "user" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "user_organization" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "public", + "table": "user_organization" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "public", + "table": "user_organization" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "entityType": "columns", + "schema": "public", + "table": "user_organization" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "organization_id", + "entityType": "columns", + "schema": "public", + "table": "user_organization" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "'owner'", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "role", + "entityType": "columns", + "schema": "public", + "table": "user_organization" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "verification" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "identifier", + "entityType": "columns", + "schema": "public", + "table": "verification" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "value", + "entityType": "columns", + "schema": "public", + "table": "verification" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "expires_at", + "entityType": "columns", + "schema": "public", + "table": "verification" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "public", + "table": "verification" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "public", + "table": "verification" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "video_job" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "request_id", + "entityType": "columns", + "schema": "public", + "table": "video_job" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "public", + "table": "video_job" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "public", + "table": "video_job" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "organization_id", + "entityType": "columns", + "schema": "public", + "table": "video_job" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "project_id", + "entityType": "columns", + "schema": "public", + "table": "video_job" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "api_key_id", + "entityType": "columns", + "schema": "public", + "table": "video_job" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "mode", + "entityType": "columns", + "schema": "public", + "table": "video_job" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "used_mode", + "entityType": "columns", + "schema": "public", + "table": "video_job" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "model", + "entityType": "columns", + "schema": "public", + "table": "video_job" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "requested_provider", + "entityType": "columns", + "schema": "public", + "table": "video_job" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "used_provider", + "entityType": "columns", + "schema": "public", + "table": "video_job" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "used_model", + "entityType": "columns", + "schema": "public", + "table": "video_job" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "provider_config_index", + "entityType": "columns", + "schema": "public", + "table": "video_job" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "upstream_id", + "entityType": "columns", + "schema": "public", + "table": "video_job" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "prompt", + "entityType": "columns", + "schema": "public", + "table": "video_job" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "'queued'", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "status", + "entityType": "columns", + "schema": "public", + "table": "video_job" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "progress", + "entityType": "columns", + "schema": "public", + "table": "video_job" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "error", + "entityType": "columns", + "schema": "public", + "table": "video_job" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "content_url", + "entityType": "columns", + "schema": "public", + "table": "video_job" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "storage_provider", + "entityType": "columns", + "schema": "public", + "table": "video_job" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "storage_bucket", + "entityType": "columns", + "schema": "public", + "table": "video_job" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "storage_object_path", + "entityType": "columns", + "schema": "public", + "table": "video_job" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "storage_uri", + "entityType": "columns", + "schema": "public", + "table": "video_job" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "storage_expires_at", + "entityType": "columns", + "schema": "public", + "table": "video_job" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "content_type", + "entityType": "columns", + "schema": "public", + "table": "video_job" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "completed_at", + "entityType": "columns", + "schema": "public", + "table": "video_job" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "entityType": "columns", + "schema": "public", + "table": "video_job" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "last_polled_at", + "entityType": "columns", + "schema": "public", + "table": "video_job" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "next_poll_at", + "entityType": "columns", + "schema": "public", + "table": "video_job" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "poll_attempt_count", + "entityType": "columns", + "schema": "public", + "table": "video_job" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "callback_url", + "entityType": "columns", + "schema": "public", + "table": "video_job" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "callback_secret", + "entityType": "columns", + "schema": "public", + "table": "video_job" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "'none'", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "callback_status", + "entityType": "columns", + "schema": "public", + "table": "video_job" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "callback_event_id", + "entityType": "columns", + "schema": "public", + "table": "video_job" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "callback_event_type", + "entityType": "columns", + "schema": "public", + "table": "video_job" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "callback_delivered_at", + "entityType": "columns", + "schema": "public", + "table": "video_job" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "result_logged_at", + "entityType": "columns", + "schema": "public", + "table": "video_job" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "routing_metadata", + "entityType": "columns", + "schema": "public", + "table": "video_job" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "upstream_create_response", + "entityType": "columns", + "schema": "public", + "table": "video_job" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "upstream_status_response", + "entityType": "columns", + "schema": "public", + "table": "video_job" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "webhook_delivery_log" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "public", + "table": "webhook_delivery_log" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "public", + "table": "webhook_delivery_log" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "video_job_id", + "entityType": "columns", + "schema": "public", + "table": "webhook_delivery_log" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "event_id", + "entityType": "columns", + "schema": "public", + "table": "webhook_delivery_log" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "event_type", + "entityType": "columns", + "schema": "public", + "table": "webhook_delivery_log" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "target_url", + "entityType": "columns", + "schema": "public", + "table": "webhook_delivery_log" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "1", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "attempt", + "entityType": "columns", + "schema": "public", + "table": "webhook_delivery_log" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "'pending'", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "status", + "entityType": "columns", + "schema": "public", + "table": "webhook_delivery_log" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "last_tried_at", + "entityType": "columns", + "schema": "public", + "table": "webhook_delivery_log" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "next_retry_at", + "entityType": "columns", + "schema": "public", + "table": "webhook_delivery_log" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "delivered_at", + "entityType": "columns", + "schema": "public", + "table": "webhook_delivery_log" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "request_headers", + "entityType": "columns", + "schema": "public", + "table": "webhook_delivery_log" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "request_body", + "entityType": "columns", + "schema": "public", + "table": "webhook_delivery_log" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "response_status", + "entityType": "columns", + "schema": "public", + "table": "webhook_delivery_log" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "response_body", + "entityType": "columns", + "schema": "public", + "table": "webhook_delivery_log" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "error", + "entityType": "columns", + "schema": "public", + "table": "webhook_delivery_log" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "user_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "account_user_id_idx", + "entityType": "indexes", + "schema": "public", + "table": "account" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "project_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "api_key_project_id_idx", + "entityType": "indexes", + "schema": "public", + "table": "api_key" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "created_by", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "api_key_created_by_idx", + "entityType": "indexes", + "schema": "public", + "table": "api_key" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "api_key_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "hour_timestamp", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "api_key_hourly_model_stats_api_key_id_hour_timestamp_idx", + "entityType": "indexes", + "schema": "public", + "table": "api_key_hourly_model_stats" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "project_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "hour_timestamp", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "api_key_hourly_model_stats_project_id_hour_timestamp_idx", + "entityType": "indexes", + "schema": "public", + "table": "api_key_hourly_model_stats" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "hour_timestamp", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "api_key_hourly_model_stats_hour_timestamp_idx", + "entityType": "indexes", + "schema": "public", + "table": "api_key_hourly_model_stats" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "api_key_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "hour_timestamp", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "api_key_hourly_stats_api_key_id_hour_timestamp_idx", + "entityType": "indexes", + "schema": "public", + "table": "api_key_hourly_stats" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "project_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "hour_timestamp", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "api_key_hourly_stats_project_id_hour_timestamp_idx", + "entityType": "indexes", + "schema": "public", + "table": "api_key_hourly_stats" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "hour_timestamp", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "api_key_hourly_stats_hour_timestamp_idx", + "entityType": "indexes", + "schema": "public", + "table": "api_key_hourly_stats" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "api_key_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "api_key_iam_rule_api_key_id_idx", + "entityType": "indexes", + "schema": "public", + "table": "api_key_iam_rule" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "rule_type", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "api_key_iam_rule_rule_type_idx", + "entityType": "indexes", + "schema": "public", + "table": "api_key_iam_rule" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "api_key_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "status", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "api_key_iam_rule_api_key_id_status_idx", + "entityType": "indexes", + "schema": "public", + "table": "api_key_iam_rule" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "organization_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "created_at", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "audit_log_organization_id_created_at_idx", + "entityType": "indexes", + "schema": "public", + "table": "audit_log" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "user_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "audit_log_user_id_idx", + "entityType": "indexes", + "schema": "public", + "table": "audit_log" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "action", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "audit_log_action_idx", + "entityType": "indexes", + "schema": "public", + "table": "audit_log" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "resource_type", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "audit_log_resource_type_idx", + "entityType": "indexes", + "schema": "public", + "table": "audit_log" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "user_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "chat_user_id_idx", + "entityType": "indexes", + "schema": "public", + "table": "chat" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "created_at", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "chat_support_conversation_created_at_idx", + "entityType": "indexes", + "schema": "public", + "table": "chat_support_conversation" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "conversation_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "chat_support_message_conversation_id_idx", + "entityType": "indexes", + "schema": "public", + "table": "chat_support_message" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "conversation_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "admin_user_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "chat_support_read_status_conv_admin_idx", + "entityType": "indexes", + "schema": "public", + "table": "chat_support_read_status" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "organization_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "discount_organization_id_idx", + "entityType": "indexes", + "schema": "public", + "table": "discount" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "provider", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "discount_provider_idx", + "entityType": "indexes", + "schema": "public", + "table": "discount" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "model", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "discount_model_idx", + "entityType": "indexes", + "schema": "public", + "table": "discount" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "created_at", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "enterprise_contact_submission_created_at_idx", + "entityType": "indexes", + "schema": "public", + "table": "enterprise_contact_submission" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "email", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "enterprise_contact_submission_email_idx", + "entityType": "indexes", + "schema": "public", + "table": "enterprise_contact_submission" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "spam_filter_status", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "enterprise_contact_submission_status_idx", + "entityType": "indexes", + "schema": "public", + "table": "enterprise_contact_submission" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "organization_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "follow_up_email_organization_id_idx", + "entityType": "indexes", + "schema": "public", + "table": "follow_up_email" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "day_timestamp", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "global_daily_model_stats_day_timestamp_idx", + "entityType": "indexes", + "schema": "public", + "table": "global_daily_model_stats" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "used_model", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "day_timestamp", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "global_daily_model_stats_used_model_day_timestamp_idx", + "entityType": "indexes", + "schema": "public", + "table": "global_daily_model_stats" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "used_provider", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "used_model", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "day_timestamp", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "global_daily_model_stats_p_m_time_idx", + "entityType": "indexes", + "schema": "public", + "table": "global_daily_model_stats" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "day_timestamp", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "global_daily_source_stats_day_timestamp_idx", + "entityType": "indexes", + "schema": "public", + "table": "global_daily_source_stats" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "source", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "day_timestamp", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "global_daily_source_stats_source_day_timestamp_idx", + "entityType": "indexes", + "schema": "public", + "table": "global_daily_source_stats" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "organization_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "guardrail_config_organization_id_idx", + "entityType": "indexes", + "schema": "public", + "table": "guardrail_config" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "organization_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "guardrail_rule_organization_id_idx", + "entityType": "indexes", + "schema": "public", + "table": "guardrail_rule" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "priority", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "guardrail_rule_priority_idx", + "entityType": "indexes", + "schema": "public", + "table": "guardrail_rule" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "organization_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "created_at", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "guardrail_violation_org_created_idx", + "entityType": "indexes", + "schema": "public", + "table": "guardrail_violation" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "rule_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "created_at", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "guardrail_violation_rule_created_idx", + "entityType": "indexes", + "schema": "public", + "table": "guardrail_violation" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "project_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "created_at", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "log_project_id_created_at_idx", + "entityType": "indexes", + "schema": "public", + "table": "log" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "request_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "log_request_id_idx", + "entityType": "indexes", + "schema": "public", + "table": "log" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "created_at", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "used_model", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "used_provider", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "log_created_at_used_model_used_provider_idx", + "entityType": "indexes", + "schema": "public", + "table": "log" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "created_at", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": "data_retention_cleaned_up = false", + "with": "", + "method": "btree", + "concurrently": false, + "name": "log_data_retention_pending_idx", + "entityType": "indexes", + "schema": "public", + "table": "log" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "project_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "used_model", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "log_project_id_used_model_idx", + "entityType": "indexes", + "schema": "public", + "table": "log" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "created_at", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": "processed_at IS NULL", + "with": "", + "method": "btree", + "concurrently": false, + "name": "log_processed_at_null_idx", + "entityType": "indexes", + "schema": "public", + "table": "log" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "chat_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "message_chat_id_idx", + "entityType": "indexes", + "schema": "public", + "table": "message" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "status", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "model_status_idx", + "entityType": "indexes", + "schema": "public", + "table": "model" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "minute_timestamp", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "model_history_minute_timestamp_idx", + "entityType": "indexes", + "schema": "public", + "table": "model_history" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "model_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "minute_timestamp", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "model_history_model_id_minute_timestamp_idx", + "entityType": "indexes", + "schema": "public", + "table": "model_history" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "status", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "model_provider_mapping_status_idx", + "entityType": "indexes", + "schema": "public", + "table": "model_provider_mapping" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "minute_timestamp", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "model_provider_mapping_history_minute_timestamp_idx", + "entityType": "indexes", + "schema": "public", + "table": "model_provider_mapping_history" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "minute_timestamp", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "provider_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "model_provider_mapping_history_minute_timestamp_provider_id_idx", + "entityType": "indexes", + "schema": "public", + "table": "model_provider_mapping_history" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "minute_timestamp", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "model_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "model_provider_mapping_history_minute_timestamp_model_id_idx", + "entityType": "indexes", + "schema": "public", + "table": "model_provider_mapping_history" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "model_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "minute_timestamp", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "model_provider_mapping_history_model_id_minute_timestamp_idx", + "entityType": "indexes", + "schema": "public", + "table": "model_provider_mapping_history" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "provider_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "model_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "minute_timestamp", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "model_provider_mapping_history_id_ts_idx", + "entityType": "indexes", + "schema": "public", + "table": "model_provider_mapping_history" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "organization_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "organization_action_organization_id_idx", + "entityType": "indexes", + "schema": "public", + "table": "organization_action" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "user_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "passkey_user_id_idx", + "entityType": "indexes", + "schema": "public", + "table": "passkey" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "organization_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "payment_failure_organization_id_idx", + "entityType": "indexes", + "schema": "public", + "table": "payment_failure" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "created_at", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "payment_failure_created_at_idx", + "entityType": "indexes", + "schema": "public", + "table": "payment_failure" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "decline_code", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "payment_failure_decline_code_idx", + "entityType": "indexes", + "schema": "public", + "table": "payment_failure" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "organization_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "payment_method_organization_id_idx", + "entityType": "indexes", + "schema": "public", + "table": "payment_method" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "organization_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "project_organization_id_idx", + "entityType": "indexes", + "schema": "public", + "table": "project" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "project_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "hour_timestamp", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "project_hourly_model_stats_project_id_hour_timestamp_idx", + "entityType": "indexes", + "schema": "public", + "table": "project_hourly_model_stats" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "hour_timestamp", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "project_hourly_model_stats_hour_timestamp_idx", + "entityType": "indexes", + "schema": "public", + "table": "project_hourly_model_stats" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "used_model", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "hour_timestamp", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "project_hourly_model_stats_used_model_hour_timestamp_idx", + "entityType": "indexes", + "schema": "public", + "table": "project_hourly_model_stats" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "used_provider", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "used_model", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "hour_timestamp", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "project_hourly_model_stats_p_m_time_idx", + "entityType": "indexes", + "schema": "public", + "table": "project_hourly_model_stats" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "hour_timestamp", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "project_hourly_stats_hour_timestamp_idx", + "entityType": "indexes", + "schema": "public", + "table": "project_hourly_stats" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "status", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "provider_status_idx", + "entityType": "indexes", + "schema": "public", + "table": "provider" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "organization_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "provider_key_organization_id_idx", + "entityType": "indexes", + "schema": "public", + "table": "provider_key" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "coalesce(\"organization_id\", '__global__')", + "isExpression": true, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "coalesce(\"provider\", '__all_providers__')", + "isExpression": true, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "coalesce(\"model\", '__all_models__')", + "isExpression": true, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "rate_limit_org_provider_model_unique", + "entityType": "indexes", + "schema": "public", + "table": "rate_limit" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "organization_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "rate_limit_organization_id_idx", + "entityType": "indexes", + "schema": "public", + "table": "rate_limit" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "provider", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "rate_limit_provider_idx", + "entityType": "indexes", + "schema": "public", + "table": "rate_limit" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "model", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "rate_limit_model_idx", + "entityType": "indexes", + "schema": "public", + "table": "rate_limit" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "referrer_organization_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "referral_referrer_organization_id_idx", + "entityType": "indexes", + "schema": "public", + "table": "referral" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "referred_organization_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "referral_referred_organization_id_idx", + "entityType": "indexes", + "schema": "public", + "table": "referral" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "user_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "session_user_id_idx", + "entityType": "indexes", + "schema": "public", + "table": "session" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "organization_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "transaction_organization_id_idx", + "entityType": "indexes", + "schema": "public", + "table": "transaction" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "user_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "user_organization_user_id_idx", + "entityType": "indexes", + "schema": "public", + "table": "user_organization" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "organization_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "user_organization_organization_id_idx", + "entityType": "indexes", + "schema": "public", + "table": "user_organization" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "project_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "created_at", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "video_job_project_id_created_at_idx", + "entityType": "indexes", + "schema": "public", + "table": "video_job" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "status", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "next_poll_at", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "video_job_status_next_poll_at_idx", + "entityType": "indexes", + "schema": "public", + "table": "video_job" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "upstream_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "video_job_upstream_id_idx", + "entityType": "indexes", + "schema": "public", + "table": "video_job" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "callback_status", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "video_job_callback_status_idx", + "entityType": "indexes", + "schema": "public", + "table": "video_job" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "video_job_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "webhook_delivery_log_video_job_id_idx", + "entityType": "indexes", + "schema": "public", + "table": "webhook_delivery_log" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "status", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "next_retry_at", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "webhook_delivery_log_status_next_retry_at_idx", + "entityType": "indexes", + "schema": "public", + "table": "webhook_delivery_log" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "account_user_id_user_id_fk", + "entityType": "fks", + "schema": "public", + "table": "account" + }, + { + "nameExplicit": false, + "columns": [ + "project_id" + ], + "schemaTo": "public", + "tableTo": "project", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "api_key_project_id_project_id_fk", + "entityType": "fks", + "schema": "public", + "table": "api_key" + }, + { + "nameExplicit": false, + "columns": [ + "created_by" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "api_key_created_by_user_id_fk", + "entityType": "fks", + "schema": "public", + "table": "api_key" + }, + { + "nameExplicit": false, + "columns": [ + "api_key_id" + ], + "schemaTo": "public", + "tableTo": "api_key", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "api_key_iam_rule_api_key_id_api_key_id_fk", + "entityType": "fks", + "schema": "public", + "table": "api_key_iam_rule" + }, + { + "nameExplicit": false, + "columns": [ + "organization_id" + ], + "schemaTo": "public", + "tableTo": "organization", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "audit_log_organization_id_organization_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "audit_log" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "audit_log_user_id_user_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "audit_log" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "chat_user_id_user_id_fk", + "entityType": "fks", + "schema": "public", + "table": "chat" + }, + { + "nameExplicit": false, + "columns": [ + "conversation_id" + ], + "schemaTo": "public", + "tableTo": "chat_support_conversation", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "chat_support_message_Wd0B6G0H0z05_fkey", + "entityType": "fks", + "schema": "public", + "table": "chat_support_message" + }, + { + "nameExplicit": false, + "columns": [ + "conversation_id" + ], + "schemaTo": "public", + "tableTo": "chat_support_conversation", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "chat_support_read_status_oDVimXRR0BL9_fkey", + "entityType": "fks", + "schema": "public", + "table": "chat_support_read_status" + }, + { + "nameExplicit": false, + "columns": [ + "admin_user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "chat_support_read_status_admin_user_id_user_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "chat_support_read_status" + }, + { + "nameExplicit": false, + "columns": [ + "organization_id" + ], + "schemaTo": "public", + "tableTo": "organization", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "discount_organization_id_organization_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "discount" + }, + { + "nameExplicit": false, + "columns": [ + "organization_id" + ], + "schemaTo": "public", + "tableTo": "organization", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "follow_up_email_organization_id_organization_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "follow_up_email" + }, + { + "nameExplicit": false, + "columns": [ + "organization_id" + ], + "schemaTo": "public", + "tableTo": "organization", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "guardrail_config_organization_id_organization_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "guardrail_config" + }, + { + "nameExplicit": false, + "columns": [ + "organization_id" + ], + "schemaTo": "public", + "tableTo": "organization", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "guardrail_rule_organization_id_organization_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "guardrail_rule" + }, + { + "nameExplicit": false, + "columns": [ + "organization_id" + ], + "schemaTo": "public", + "tableTo": "organization", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "guardrail_violation_organization_id_organization_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "guardrail_violation" + }, + { + "nameExplicit": false, + "columns": [ + "chat_id" + ], + "schemaTo": "public", + "tableTo": "chat", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "message_chat_id_chat_id_fk", + "entityType": "fks", + "schema": "public", + "table": "message" + }, + { + "nameExplicit": false, + "columns": [ + "model_id" + ], + "schemaTo": "public", + "tableTo": "model", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "model_provider_mapping_model_id_model_id_fk", + "entityType": "fks", + "schema": "public", + "table": "model_provider_mapping" + }, + { + "nameExplicit": false, + "columns": [ + "provider_id" + ], + "schemaTo": "public", + "tableTo": "provider", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "model_provider_mapping_provider_id_provider_id_fk", + "entityType": "fks", + "schema": "public", + "table": "model_provider_mapping" + }, + { + "nameExplicit": false, + "columns": [ + "organization_id" + ], + "schemaTo": "public", + "tableTo": "organization", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "organization_action_organization_id_organization_id_fk", + "entityType": "fks", + "schema": "public", + "table": "organization_action" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "passkey_user_id_user_id_fk", + "entityType": "fks", + "schema": "public", + "table": "passkey" + }, + { + "nameExplicit": false, + "columns": [ + "organization_id" + ], + "schemaTo": "public", + "tableTo": "organization", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "payment_failure_organization_id_organization_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "payment_failure" + }, + { + "nameExplicit": false, + "columns": [ + "organization_id" + ], + "schemaTo": "public", + "tableTo": "organization", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "payment_method_organization_id_organization_id_fk", + "entityType": "fks", + "schema": "public", + "table": "payment_method" + }, + { + "nameExplicit": false, + "columns": [ + "organization_id" + ], + "schemaTo": "public", + "tableTo": "organization", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "project_organization_id_organization_id_fk", + "entityType": "fks", + "schema": "public", + "table": "project" + }, + { + "nameExplicit": false, + "columns": [ + "organization_id" + ], + "schemaTo": "public", + "tableTo": "organization", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "provider_key_organization_id_organization_id_fk", + "entityType": "fks", + "schema": "public", + "table": "provider_key" + }, + { + "nameExplicit": false, + "columns": [ + "organization_id" + ], + "schemaTo": "public", + "tableTo": "organization", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "rate_limit_organization_id_organization_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "rate_limit" + }, + { + "nameExplicit": false, + "columns": [ + "referrer_organization_id" + ], + "schemaTo": "public", + "tableTo": "organization", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "referral_referrer_organization_id_organization_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "referral" + }, + { + "nameExplicit": false, + "columns": [ + "referred_organization_id" + ], + "schemaTo": "public", + "tableTo": "organization", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "referral_referred_organization_id_organization_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "referral" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "session_user_id_user_id_fk", + "entityType": "fks", + "schema": "public", + "table": "session" + }, + { + "nameExplicit": false, + "columns": [ + "organization_id" + ], + "schemaTo": "public", + "tableTo": "organization", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "transaction_organization_id_organization_id_fk", + "entityType": "fks", + "schema": "public", + "table": "transaction" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "user_organization_user_id_user_id_fk", + "entityType": "fks", + "schema": "public", + "table": "user_organization" + }, + { + "nameExplicit": false, + "columns": [ + "organization_id" + ], + "schemaTo": "public", + "tableTo": "organization", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "user_organization_organization_id_organization_id_fk", + "entityType": "fks", + "schema": "public", + "table": "user_organization" + }, + { + "nameExplicit": false, + "columns": [ + "organization_id" + ], + "schemaTo": "public", + "tableTo": "organization", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "video_job_organization_id_organization_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "video_job" + }, + { + "nameExplicit": false, + "columns": [ + "project_id" + ], + "schemaTo": "public", + "tableTo": "project", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "video_job_project_id_project_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "video_job" + }, + { + "nameExplicit": false, + "columns": [ + "api_key_id" + ], + "schemaTo": "public", + "tableTo": "api_key", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "video_job_api_key_id_api_key_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "video_job" + }, + { + "nameExplicit": false, + "columns": [ + "video_job_id" + ], + "schemaTo": "public", + "tableTo": "video_job", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "webhook_delivery_log_video_job_id_video_job_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "webhook_delivery_log" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "account_pkey", + "schema": "public", + "table": "account", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "api_key_pkey", + "schema": "public", + "table": "api_key", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "api_key_hourly_model_stats_pkey", + "schema": "public", + "table": "api_key_hourly_model_stats", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "api_key_hourly_stats_pkey", + "schema": "public", + "table": "api_key_hourly_stats", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "api_key_iam_rule_pkey", + "schema": "public", + "table": "api_key_iam_rule", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "audit_log_pkey", + "schema": "public", + "table": "audit_log", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "chat_pkey", + "schema": "public", + "table": "chat", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "chat_support_conversation_pkey", + "schema": "public", + "table": "chat_support_conversation", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "chat_support_message_pkey", + "schema": "public", + "table": "chat_support_message", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "chat_support_read_status_pkey", + "schema": "public", + "table": "chat_support_read_status", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "discount_pkey", + "schema": "public", + "table": "discount", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "enterprise_contact_submission_pkey", + "schema": "public", + "table": "enterprise_contact_submission", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "follow_up_email_pkey", + "schema": "public", + "table": "follow_up_email", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "global_daily_model_stats_pkey", + "schema": "public", + "table": "global_daily_model_stats", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "global_daily_source_stats_pkey", + "schema": "public", + "table": "global_daily_source_stats", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "guardrail_config_pkey", + "schema": "public", + "table": "guardrail_config", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "guardrail_rule_pkey", + "schema": "public", + "table": "guardrail_rule", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "guardrail_violation_pkey", + "schema": "public", + "table": "guardrail_violation", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "installation_pkey", + "schema": "public", + "table": "installation", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "lock_pkey", + "schema": "public", + "table": "lock", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "log_pkey", + "schema": "public", + "table": "log", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "message_pkey", + "schema": "public", + "table": "message", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "model_pkey", + "schema": "public", + "table": "model", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "model_history_pkey", + "schema": "public", + "table": "model_history", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "model_provider_mapping_pkey", + "schema": "public", + "table": "model_provider_mapping", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "model_provider_mapping_history_pkey", + "schema": "public", + "table": "model_provider_mapping_history", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "organization_pkey", + "schema": "public", + "table": "organization", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "organization_action_pkey", + "schema": "public", + "table": "organization_action", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "passkey_pkey", + "schema": "public", + "table": "passkey", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "payment_failure_pkey", + "schema": "public", + "table": "payment_failure", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "payment_method_pkey", + "schema": "public", + "table": "payment_method", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "project_pkey", + "schema": "public", + "table": "project", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "project_hourly_model_stats_pkey", + "schema": "public", + "table": "project_hourly_model_stats", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "project_hourly_stats_pkey", + "schema": "public", + "table": "project_hourly_stats", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "provider_pkey", + "schema": "public", + "table": "provider", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "provider_key_pkey", + "schema": "public", + "table": "provider_key", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "rate_limit_pkey", + "schema": "public", + "table": "rate_limit", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "referral_pkey", + "schema": "public", + "table": "referral", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "session_pkey", + "schema": "public", + "table": "session", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "transaction_pkey", + "schema": "public", + "table": "transaction", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "user_pkey", + "schema": "public", + "table": "user", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "user_organization_pkey", + "schema": "public", + "table": "user_organization", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "verification_pkey", + "schema": "public", + "table": "verification", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "video_job_pkey", + "schema": "public", + "table": "video_job", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "webhook_delivery_log_pkey", + "schema": "public", + "table": "webhook_delivery_log", + "entityType": "pks" + }, + { + "nameExplicit": false, + "columns": [ + "api_key_id", + "hour_timestamp", + "used_model", + "used_provider" + ], + "nullsNotDistinct": false, + "name": "api_key_hourly_model_stats_api_key_id_hour_timestamp_used_model_used_provider_unique", + "entityType": "uniques", + "schema": "public", + "table": "api_key_hourly_model_stats" + }, + { + "nameExplicit": false, + "columns": [ + "api_key_id", + "hour_timestamp" + ], + "nullsNotDistinct": false, + "name": "api_key_hourly_stats_api_key_id_hour_timestamp_unique", + "entityType": "uniques", + "schema": "public", + "table": "api_key_hourly_stats" + }, + { + "nameExplicit": true, + "columns": [ + "organization_id", + "provider", + "model" + ], + "nullsNotDistinct": false, + "name": "discount_org_provider_model_unique", + "entityType": "uniques", + "schema": "public", + "table": "discount" + }, + { + "nameExplicit": false, + "columns": [ + "organization_id", + "email_type" + ], + "nullsNotDistinct": false, + "name": "follow_up_email_organization_id_email_type_unique", + "entityType": "uniques", + "schema": "public", + "table": "follow_up_email" + }, + { + "nameExplicit": false, + "columns": [ + "day_timestamp", + "used_model", + "used_provider" + ], + "nullsNotDistinct": false, + "name": "global_daily_model_stats_day_timestamp_used_model_used_provider_unique", + "entityType": "uniques", + "schema": "public", + "table": "global_daily_model_stats" + }, + { + "nameExplicit": false, + "columns": [ + "day_timestamp", + "source" + ], + "nullsNotDistinct": false, + "name": "global_daily_source_stats_day_timestamp_source_unique", + "entityType": "uniques", + "schema": "public", + "table": "global_daily_source_stats" + }, + { + "nameExplicit": false, + "columns": [ + "model_id", + "minute_timestamp" + ], + "nullsNotDistinct": false, + "name": "model_history_model_id_minute_timestamp_unique", + "entityType": "uniques", + "schema": "public", + "table": "model_history" + }, + { + "nameExplicit": false, + "columns": [ + "model_id", + "provider_id", + "region" + ], + "nullsNotDistinct": false, + "name": "model_provider_mapping_model_id_provider_id_region_unique", + "entityType": "uniques", + "schema": "public", + "table": "model_provider_mapping" + }, + { + "nameExplicit": false, + "columns": [ + "model_provider_mapping_id", + "minute_timestamp" + ], + "nullsNotDistinct": false, + "name": "model_provider_mapping_history_model_provider_mapping_id_minute_timestamp_unique", + "entityType": "uniques", + "schema": "public", + "table": "model_provider_mapping_history" + }, + { + "nameExplicit": true, + "columns": [ + "stripe_payment_intent_id" + ], + "nullsNotDistinct": false, + "name": "payment_failure_stripe_pi_idx", + "entityType": "uniques", + "schema": "public", + "table": "payment_failure" + }, + { + "nameExplicit": false, + "columns": [ + "project_id", + "hour_timestamp", + "used_model", + "used_provider" + ], + "nullsNotDistinct": false, + "name": "project_hourly_model_stats_project_id_hour_timestamp_used_model_used_provider_unique", + "entityType": "uniques", + "schema": "public", + "table": "project_hourly_model_stats" + }, + { + "nameExplicit": false, + "columns": [ + "project_id", + "hour_timestamp" + ], + "nullsNotDistinct": false, + "name": "project_hourly_stats_project_id_hour_timestamp_unique", + "entityType": "uniques", + "schema": "public", + "table": "project_hourly_stats" + }, + { + "nameExplicit": false, + "columns": [ + "organization_id", + "name" + ], + "nullsNotDistinct": false, + "name": "provider_key_organization_id_name_unique", + "entityType": "uniques", + "schema": "public", + "table": "provider_key" + }, + { + "nameExplicit": false, + "columns": [ + "token" + ], + "nullsNotDistinct": false, + "name": "api_key_token_unique", + "schema": "public", + "table": "api_key", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "organization_id" + ], + "nullsNotDistinct": false, + "name": "guardrail_config_organization_id_key", + "schema": "public", + "table": "guardrail_config", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "uuid" + ], + "nullsNotDistinct": false, + "name": "installation_uuid_unique", + "schema": "public", + "table": "installation", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "key" + ], + "nullsNotDistinct": false, + "name": "lock_key_unique", + "schema": "public", + "table": "lock", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "stripe_customer_id" + ], + "nullsNotDistinct": false, + "name": "organization_stripe_customer_id_key", + "schema": "public", + "table": "organization", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "stripe_subscription_id" + ], + "nullsNotDistinct": false, + "name": "organization_stripe_subscription_id_key", + "schema": "public", + "table": "organization", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "dev_plan_stripe_subscription_id" + ], + "nullsNotDistinct": false, + "name": "organization_dev_plan_stripe_subscription_id_key", + "schema": "public", + "table": "organization", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "referred_organization_id" + ], + "nullsNotDistinct": false, + "name": "referral_referred_organization_id_key", + "schema": "public", + "table": "referral", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "token" + ], + "nullsNotDistinct": false, + "name": "session_token_unique", + "schema": "public", + "table": "session", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "email" + ], + "nullsNotDistinct": false, + "name": "user_email_unique", + "schema": "public", + "table": "user", + "entityType": "uniques" + } + ], + "renames": [] +} \ No newline at end of file diff --git a/packages/db/migrations/meta/_journal.json b/packages/db/migrations/meta/_journal.json index ef4a69974e..85cb4d95f5 100644 --- a/packages/db/migrations/meta/_journal.json +++ b/packages/db/migrations/meta/_journal.json @@ -855,6 +855,13 @@ "when": 1778083846277, "tag": "1778083846_early_excalibur", "breakpoints": true + }, + { + "idx": 122, + "version": "8", + "when": 1778152537113, + "tag": "1778152537_sudden_blue_marvel", + "breakpoints": true } ] } \ No newline at end of file diff --git a/packages/db/src/schema.ts b/packages/db/src/schema.ts index 9b21c73833..14c03f7b67 100644 --- a/packages/db/src/schema.ts +++ b/packages/db/src/schema.ts @@ -1944,3 +1944,143 @@ export const apiKeyHourlyModelStats = pgTable( ), ], ); + +// Global daily model statistics — cross-org, cross-project aggregation by model +export const globalDailyModelStats = pgTable( + "global_daily_model_stats", + { + id: text().primaryKey().notNull().$defaultFn(shortid), + createdAt: timestamp().notNull().defaultNow(), + updatedAt: timestamp() + .notNull() + .defaultNow() + .$onUpdate(() => new Date()), + dayTimestamp: timestamp().notNull(), // Start of the UTC day bucket + usedModel: text().notNull(), + usedProvider: text().notNull(), + // Request counts + requestCount: integer().notNull().default(0), + errorCount: integer().notNull().default(0), + cacheCount: integer().notNull().default(0), + streamedCount: integer().notNull().default(0), + nonStreamedCount: integer().notNull().default(0), + // Unified finish reason counts + completedCount: integer().notNull().default(0), + lengthLimitCount: integer().notNull().default(0), + contentFilterCount: integer().notNull().default(0), + toolCallsCount: integer().notNull().default(0), + canceledCount: integer().notNull().default(0), + unknownFinishCount: integer().notNull().default(0), + // Error type counts (subset of errorCount) + clientErrorCount: integer().notNull().default(0), + gatewayErrorCount: integer().notNull().default(0), + upstreamErrorCount: integer().notNull().default(0), + // Token counts + inputTokens: decimal().notNull().default("0"), + outputTokens: decimal().notNull().default("0"), + totalTokens: decimal().notNull().default("0"), + reasoningTokens: decimal().notNull().default("0"), + cachedTokens: decimal().notNull().default("0"), + cacheWriteTokens: decimal().notNull().default("0"), + // Costs + cost: real().notNull().default(0), + inputCost: real().notNull().default(0), + outputCost: real().notNull().default(0), + requestCost: real().notNull().default(0), + dataStorageCost: real().notNull().default(0), + discountSavings: real().notNull().default(0), + imageInputCost: real().notNull().default(0), + imageOutputCost: real().notNull().default(0), + videoOutputCost: real().notNull().default(0), + cachedInputCost: real().notNull().default(0), + cacheWriteInputCost: real().notNull().default(0), + // Per-mode breakdowns + creditsRequestCount: integer().notNull().default(0), + apiKeysRequestCount: integer().notNull().default(0), + creditsCost: real().notNull().default(0), + apiKeysCost: real().notNull().default(0), + creditsDataStorageCost: real().notNull().default(0), + apiKeysDataStorageCost: real().notNull().default(0), + }, + (table) => [ + unique().on(table.dayTimestamp, table.usedModel, table.usedProvider), + index("global_daily_model_stats_day_timestamp_idx").on(table.dayTimestamp), + index("global_daily_model_stats_used_model_day_timestamp_idx").on( + table.usedModel, + table.dayTimestamp, + ), + index("global_daily_model_stats_p_m_time_idx").on( + table.usedProvider, + table.usedModel, + table.dayTimestamp, + ), + ], +); + +// Global daily source statistics — cross-org, cross-project aggregation by x-source header +export const globalDailySourceStats = pgTable( + "global_daily_source_stats", + { + id: text().primaryKey().notNull().$defaultFn(shortid), + createdAt: timestamp().notNull().defaultNow(), + updatedAt: timestamp() + .notNull() + .defaultNow() + .$onUpdate(() => new Date()), + dayTimestamp: timestamp().notNull(), // Start of the UTC day bucket + // NULL log.source rows are stored under the literal 'unknown' so the + // unique constraint and onConflictDoUpdate target stay valid. + source: text().notNull(), + // Request counts + requestCount: integer().notNull().default(0), + errorCount: integer().notNull().default(0), + cacheCount: integer().notNull().default(0), + streamedCount: integer().notNull().default(0), + nonStreamedCount: integer().notNull().default(0), + // Unified finish reason counts + completedCount: integer().notNull().default(0), + lengthLimitCount: integer().notNull().default(0), + contentFilterCount: integer().notNull().default(0), + toolCallsCount: integer().notNull().default(0), + canceledCount: integer().notNull().default(0), + unknownFinishCount: integer().notNull().default(0), + // Error type counts (subset of errorCount) + clientErrorCount: integer().notNull().default(0), + gatewayErrorCount: integer().notNull().default(0), + upstreamErrorCount: integer().notNull().default(0), + // Token counts + inputTokens: decimal().notNull().default("0"), + outputTokens: decimal().notNull().default("0"), + totalTokens: decimal().notNull().default("0"), + reasoningTokens: decimal().notNull().default("0"), + cachedTokens: decimal().notNull().default("0"), + cacheWriteTokens: decimal().notNull().default("0"), + // Costs + cost: real().notNull().default(0), + inputCost: real().notNull().default(0), + outputCost: real().notNull().default(0), + requestCost: real().notNull().default(0), + dataStorageCost: real().notNull().default(0), + discountSavings: real().notNull().default(0), + imageInputCost: real().notNull().default(0), + imageOutputCost: real().notNull().default(0), + videoOutputCost: real().notNull().default(0), + cachedInputCost: real().notNull().default(0), + cacheWriteInputCost: real().notNull().default(0), + // Per-mode breakdowns + creditsRequestCount: integer().notNull().default(0), + apiKeysRequestCount: integer().notNull().default(0), + creditsCost: real().notNull().default(0), + apiKeysCost: real().notNull().default(0), + creditsDataStorageCost: real().notNull().default(0), + apiKeysDataStorageCost: real().notNull().default(0), + }, + (table) => [ + unique().on(table.dayTimestamp, table.source), + index("global_daily_source_stats_day_timestamp_idx").on(table.dayTimestamp), + index("global_daily_source_stats_source_day_timestamp_idx").on( + table.source, + table.dayTimestamp, + ), + ], +); From 3a984381bfd17485f41446051135b1db036cab0a Mon Sep 17 00:00:00 2001 From: Luca Steeb Date: Thu, 7 May 2026 21:47:22 +0700 Subject: [PATCH 02/25] refactor: hourly incremental global daily aggregation Replaces the 5-min full-day rescan with an hourly walk over closed hours. A singleton globalDailyAggregationState row tracks the lastProcessedHour watermark; each tick aggregates one hour of log rows and ADDs the result to the day's totals via a col=col+EXCLUDED.col upsert, then advances the watermark in the same transaction. Once a day, the previous day is fully recomputed as a safety net for any late-arriving logs. Per-tick work is now O(rows-in-1-hour) regardless of where in the day we are, scaling cleanly to 200+ r/s. Co-Authored-By: Claude Opus 4.7 --- .../src/services/global-stats-aggregator.ts | 519 +- apps/worker/src/worker.ts | 12 +- .../1778164250_fresh_blazing_skull.sql | 6 + .../migrations/meta/1778164250_snapshot.json | 15806 ++++++++++++++++ packages/db/migrations/meta/_journal.json | 7 + packages/db/src/schema.ts | 17 + 6 files changed, 16090 insertions(+), 277 deletions(-) create mode 100644 packages/db/migrations/1778164250_fresh_blazing_skull.sql create mode 100644 packages/db/migrations/meta/1778164250_snapshot.json diff --git a/apps/worker/src/services/global-stats-aggregator.ts b/apps/worker/src/services/global-stats-aggregator.ts index 12a9cfc701..5c3ccf2485 100644 --- a/apps/worker/src/services/global-stats-aggregator.ts +++ b/apps/worker/src/services/global-stats-aggregator.ts @@ -1,11 +1,15 @@ +import { isStopRequested } from "@/shutdown.js"; + import { db, log, globalDailyModelStats, globalDailySourceStats, + globalDailyAggregationState, sql, and, - isNull, + eq, + getTableColumns, } from "@llmgateway/db"; import { logger } from "@llmgateway/logger"; @@ -14,61 +18,145 @@ import { getCommonAggregationFields, } from "./project-stats-aggregator.js"; -export const GLOBAL_DAILY_STATS_REFRESH_INTERVAL_SECONDS = - Number(process.env.GLOBAL_DAILY_STATS_REFRESH_INTERVAL_SECONDS) || 300; - -const STATS_BATCH_SIZE = Number(process.env.STATS_BATCH_SIZE) || 100; - -const STATS_BACKFILL_ENABLED = process.env.STATS_BACKFILL_ENABLED === "true"; -const STATS_BACKFILL_DAYS = Number(process.env.STATS_BACKFILL_DAYS) || 30; - -const STATS_STALE_ENABLED = process.env.STATS_STALE_ENABLED !== "false"; -const STATS_STALE_DAYS = Number(process.env.STATS_STALE_DAYS) || 7; +export const GLOBAL_DAILY_STATS_INTERVAL_SECONDS = + Number(process.env.GLOBAL_DAILY_STATS_INTERVAL_SECONDS) || 3600; + +// Hours that have closed within this many minutes are still considered +// "in flight" — we wait this long after an hour ends before processing it, +// so log inserts that landed slightly after their createdAt aren't missed +// by the incremental path. +const SETTLING_BUFFER_MINUTES = + Number(process.env.GLOBAL_DAILY_STATS_SETTLING_BUFFER_MINUTES) || 5; + +// On first run (no watermark yet), how far back to seed. +const INITIAL_LOOKBACK_DAYS = + Number(process.env.GLOBAL_DAILY_STATS_INITIAL_LOOKBACK_DAYS) || 30; + +// Cap per tick so a large catch-up doesn't tie up the worker. +const MAX_HOURS_PER_TICK = + Number(process.env.GLOBAL_DAILY_STATS_MAX_HOURS_PER_TICK) || 100; + +const HOUR_MS = 60 * 60 * 1000; +const DAY_MS = 24 * HOUR_MS; +const STATE_ROW_ID = "singleton"; + +// Columns the aggregator sums into the daily totals. Excludes id / createdAt +// / updatedAt / dimension columns. +const AGGREGATE_KEYS = [ + "requestCount", + "errorCount", + "cacheCount", + "streamedCount", + "nonStreamedCount", + "completedCount", + "lengthLimitCount", + "contentFilterCount", + "toolCallsCount", + "canceledCount", + "unknownFinishCount", + "clientErrorCount", + "gatewayErrorCount", + "upstreamErrorCount", + "inputTokens", + "outputTokens", + "totalTokens", + "reasoningTokens", + "cachedTokens", + "cacheWriteTokens", + "cost", + "inputCost", + "outputCost", + "requestCost", + "dataStorageCost", + "discountSavings", + "imageInputCost", + "imageOutputCost", + "videoOutputCost", + "cachedInputCost", + "cacheWriteInputCost", + "creditsRequestCount", + "apiKeysRequestCount", + "creditsCost", + "apiKeysCost", + "creditsDataStorageCost", + "apiKeysDataStorageCost", +] as const; + +type AnyTable = Parameters[0]; + +// Build the SET clause for an ADD-style upsert: each metric column becomes +// `col = "table"."col" + excluded.col`, so each hour's aggregated values +// accumulate into the daily totals. +function buildAddUpsertSet(table: AnyTable) { + const cols = getTableColumns(table) as Record< + string, + { name: string } & object + >; + const set: Record> = {}; + for (const key of AGGREGATE_KEYS) { + const col = cols[key]; + set[key] = sql`${col} + excluded.${sql.identifier(col.name)}`; + } + return set; +} -function getCurrentDayStart(): string { - const now = new Date(); - return formatUTCTimestamp( - new Date( - Date.UTC( - now.getUTCFullYear(), - now.getUTCMonth(), - now.getUTCDate(), - 0, - 0, - 0, - 0, - ), +const MODEL_ADD_SET = buildAddUpsertSet(globalDailyModelStats); +const SOURCE_ADD_SET = buildAddUpsertSet(globalDailySourceStats); + +function floorToHour(d: Date): Date { + return new Date( + Date.UTC( + d.getUTCFullYear(), + d.getUTCMonth(), + d.getUTCDate(), + d.getUTCHours(), + 0, + 0, + 0, ), ); } -async function recalculateGlobalDailyModelStats(dayTimestamp: string) { - const database = db; +function floorToDay(d: Date): Date { + return new Date( + Date.UTC(d.getUTCFullYear(), d.getUTCMonth(), d.getUTCDate(), 0, 0, 0, 0), + ); +} + +// Inferred drizzle transaction type so helpers can be called inside a tx. +type Tx = Parameters[0]>[0]; + +async function aggregateHourIntoDailyStats( + database: Tx, + hour: Date, +): Promise { + const hourTimestamp = formatUTCTimestamp(hour); + const dayTimestamp = formatUTCTimestamp(floorToDay(hour)); - const modelStats = await database + const hourWindow = and( + sql`${log.createdAt} >= ${hourTimestamp}::timestamp`, + sql`${log.createdAt} < ${hourTimestamp}::timestamp + interval '1 hour'`, + ); + + const modelRows = await database .select({ usedModel: log.usedModel, usedProvider: log.usedProvider, ...getCommonAggregationFields(), }) .from(log) - .where( - and( - sql`${log.createdAt} >= ${dayTimestamp}::timestamp`, - sql`${log.createdAt} < ${dayTimestamp}::timestamp + interval '1 day'`, - ), - ) + .where(hourWindow) .groupBy(log.usedModel, log.usedProvider); - for (const stat of modelStats) { - const { usedModel, usedProvider, ...statsFields } = stat; + for (const row of modelRows) { + const { usedModel, usedProvider, ...stats } = row; await database .insert(globalDailyModelStats) .values({ dayTimestamp: sql`${dayTimestamp}::timestamp`, usedModel, usedProvider, - ...statsFields, + ...stats, }) .onConflictDoUpdate({ target: [ @@ -77,38 +165,29 @@ async function recalculateGlobalDailyModelStats(dayTimestamp: string) { globalDailyModelStats.usedProvider, ], set: { - ...statsFields, + ...MODEL_ADD_SET, updatedAt: new Date(), }, }); } -} -async function recalculateGlobalDailySourceStats(dayTimestamp: string) { - const database = db; - - const sourceStats = await database + const sourceRows = await database .select({ source: sql`coalesce(${log.source}, 'unknown')`.as("source"), ...getCommonAggregationFields(), }) .from(log) - .where( - and( - sql`${log.createdAt} >= ${dayTimestamp}::timestamp`, - sql`${log.createdAt} < ${dayTimestamp}::timestamp + interval '1 day'`, - ), - ) + .where(hourWindow) .groupBy(sql`coalesce(${log.source}, 'unknown')`); - for (const stat of sourceStats) { - const { source, ...statsFields } = stat; + for (const row of sourceRows) { + const { source, ...stats } = row; await database .insert(globalDailySourceStats) .values({ dayTimestamp: sql`${dayTimestamp}::timestamp`, source, - ...statsFields, + ...stats, }) .onConflictDoUpdate({ target: [ @@ -116,256 +195,154 @@ async function recalculateGlobalDailySourceStats(dayTimestamp: string) { globalDailySourceStats.source, ], set: { - ...statsFields, + ...SOURCE_ADD_SET, updatedAt: new Date(), }, }); } } -async function recalculateGlobalDailyStats(dayTimestamp: string) { - await recalculateGlobalDailyModelStats(dayTimestamp); - await recalculateGlobalDailySourceStats(dayTimestamp); +async function readState() { + const [row] = await db + .select() + .from(globalDailyAggregationState) + .where(eq(globalDailyAggregationState.id, STATE_ROW_ID)) + .limit(1); + return row; } -export async function aggregateHistoricalGlobalStats() { - const database = db; - const currentDayStart = getCurrentDayStart(); - let totalBucketsProcessed = 0; - - try { - // Phase 1: Re-process stale day buckets where new logs arrived - // after the last aggregation. Days are deduped via groupBy because each - // day has many (model, provider) rows in globalDailyModelStats. - if (STATS_STALE_ENABLED) { - const staleStart = - STATS_STALE_DAYS > 0 - ? formatUTCTimestamp( - // eslint-disable-next-line no-mixed-operators - new Date(Date.now() - STATS_STALE_DAYS * 24 * 60 * 60 * 1000), - ) - : undefined; - - logger.info( - `[global-stale] Scanning for stale day buckets (lookback: ${staleStart ?? "unlimited"})`, - ); +async function setLastProcessedHour(database: Tx, hour: Date): Promise { + await database + .insert(globalDailyAggregationState) + .values({ id: STATE_ROW_ID, lastProcessedHour: hour }) + .onConflictDoUpdate({ + target: globalDailyAggregationState.id, + set: { lastProcessedHour: hour, updatedAt: new Date() }, + }); +} - const staleBuckets = await database - .select({ - dayTimestamp: - sql`to_char(${globalDailyModelStats.dayTimestamp}, 'YYYY-MM-DD HH24:MI:SS')`.as( - "dayTimestamp", - ), - }) - .from(globalDailyModelStats) - .where( - staleStart - ? sql`${globalDailyModelStats.dayTimestamp} >= ${staleStart}::timestamp` - : undefined, - ) - .groupBy(globalDailyModelStats.dayTimestamp) - .having( - sql`EXISTS ( - SELECT 1 FROM ${log} - WHERE ${log.createdAt} >= ${globalDailyModelStats.dayTimestamp} - AND ${log.createdAt} < ${globalDailyModelStats.dayTimestamp} + interval '1 day' - AND ${log.createdAt} > MIN(${globalDailyModelStats.updatedAt}) - LIMIT 1 - )`, - ) - .orderBy(globalDailyModelStats.dayTimestamp) - .limit(STATS_BATCH_SIZE); - - if (staleBuckets.length > 0) { - logger.info( - `[global-stale] Found ${staleBuckets.length} stale day buckets with new logs (oldest: ${staleBuckets[0].dayTimestamp}, newest: ${staleBuckets[staleBuckets.length - 1].dayTimestamp})`, - ); - - for (let i = 0; i < staleBuckets.length; i++) { - const bucket = staleBuckets[i]; - await recalculateGlobalDailyStats(bucket.dayTimestamp); - logger.info( - `[global-stale] Processed bucket ${i + 1}/${staleBuckets.length}: day=${bucket.dayTimestamp}`, - ); - } - - totalBucketsProcessed += staleBuckets.length; - - if (staleBuckets.length === STATS_BATCH_SIZE) { - logger.info( - `[global-stale] Batch limit reached (${STATS_BATCH_SIZE}), more stale buckets may remain — will continue in next run`, - ); - } - } else { - logger.debug("[global-stale] No stale buckets found"); - } - } +async function setLastSafetyNetDay(day: Date): Promise { + await db + .insert(globalDailyAggregationState) + .values({ id: STATE_ROW_ID, lastSafetyNetDay: day }) + .onConflictDoUpdate({ + target: globalDailyAggregationState.id, + set: { lastSafetyNetDay: day, updatedAt: new Date() }, + }); +} - // Phase 2: Backfill — find day buckets present in `log` but missing - // from globalDailyModelStats. - if (STATS_BACKFILL_ENABLED) { - const backfillStart = - STATS_BACKFILL_DAYS > 0 - ? formatUTCTimestamp( - // eslint-disable-next-line no-mixed-operators - new Date(Date.now() - STATS_BACKFILL_DAYS * 24 * 60 * 60 * 1000), - ) - : undefined; +// Recompute a closed day from scratch: wipe its rows, then re-aggregate each +// of its 24 hours into the now-empty bucket. Catches late-arriving logs that +// the incremental path missed. +async function recomputeDayFully(day: Date): Promise { + const dayStr = formatUTCTimestamp(day); + + await db.transaction(async (tx) => { + await tx + .delete(globalDailyModelStats) + .where(sql`${globalDailyModelStats.dayTimestamp} = ${dayStr}::timestamp`); + await tx + .delete(globalDailySourceStats) + .where( + sql`${globalDailySourceStats.dayTimestamp} = ${dayStr}::timestamp`, + ); + }); + for (let h = 0; h < 24; h++) { + if (isStopRequested()) { logger.info( - `[global-backfill] Scanning for unprocessed day buckets (lookback: ${backfillStart ?? "unlimited"})`, + `[global-safety-net] Stop requested mid-recompute of ${dayStr}, leaving lastSafetyNetDay unchanged so next start retries`, ); - - const backfillBuckets = await database - .select({ - dayTimestamp: - sql`to_char(date_trunc('day', ${log.createdAt}), 'YYYY-MM-DD HH24:MI:SS')`.as( - "dayTimestamp", - ), - }) - .from(log) - .leftJoin( - globalDailyModelStats, - sql`${globalDailyModelStats.dayTimestamp} = date_trunc('day', ${log.createdAt})`, - ) - .where( - and( - sql`${log.createdAt} < ${currentDayStart}::timestamp`, - isNull(globalDailyModelStats.dayTimestamp), - backfillStart - ? sql`${log.createdAt} >= ${backfillStart}::timestamp` - : undefined, - ), - ) - .groupBy(sql`date_trunc('day', ${log.createdAt})`) - .orderBy(sql`date_trunc('day', ${log.createdAt}) ASC`) - .limit(STATS_BATCH_SIZE); - - if (backfillBuckets.length > 0) { - logger.info( - `[global-backfill] Found ${backfillBuckets.length} unprocessed day buckets (oldest: ${backfillBuckets[0].dayTimestamp}, newest: ${backfillBuckets[backfillBuckets.length - 1].dayTimestamp})`, - ); - - for (let i = 0; i < backfillBuckets.length; i++) { - const bucket = backfillBuckets[i]; - await recalculateGlobalDailyStats(bucket.dayTimestamp); - logger.info( - `[global-backfill] Processed bucket ${i + 1}/${backfillBuckets.length}: day=${bucket.dayTimestamp}`, - ); - } - - totalBucketsProcessed += backfillBuckets.length; - - if (backfillBuckets.length === STATS_BATCH_SIZE) { - logger.info( - `[global-backfill] Batch limit reached (${STATS_BATCH_SIZE}), more unprocessed buckets may remain — will continue in next run`, - ); - } else { - logger.info( - `[global-backfill] Complete: ${backfillBuckets.length} buckets processed`, - ); - } - } else { - logger.debug("[global-backfill] No unprocessed buckets found"); - } + return; } - - logger.info( - `Global daily stats aggregation complete: ${totalBucketsProcessed} total buckets processed`, - ); - - return { - bucketsProcessed: totalBucketsProcessed, - }; - } catch (error) { - logger.error( - "Error processing logs for global daily stats aggregation", - error instanceof Error ? error : new Error(String(error)), - ); - throw error; + const hour = new Date(day.getTime() + h * HOUR_MS); // eslint-disable-line no-mixed-operators + await db.transaction(async (tx) => { + await aggregateHourIntoDailyStats(tx, hour); + }); } } -export async function refreshCurrentDayStats() { - const database = db; - const currentDayStart = getCurrentDayStart(); - - logger.info(`Refreshing current day global stats for ${currentDayStart}`); - - try { - // Skip the full-day rescan if nothing has changed since the last refresh. - // EXISTS+LIMIT 1 is an index-only scan on log_created_at_*_idx — sub-ms. - // Without this guard the worker rescans every row in the current day on - // every tick (288 times/day at 5-min cadence), which gets expensive once - // daily volume reaches millions. - const [watermark] = await database - .select({ - minUpdatedAt: sql`MIN(${globalDailyModelStats.updatedAt})`.as( - "minUpdatedAt", - ), - }) - .from(globalDailyModelStats) - .where( - sql`${globalDailyModelStats.dayTimestamp} = ${currentDayStart}::timestamp`, - ); +async function runSafetyNetIfNeeded(now: Date): Promise { + const todayStart = floorToDay(now); - if (watermark?.minUpdatedAt) { - const [{ hasNewLogs }] = await database - .select({ - hasNewLogs: sql`EXISTS ( - SELECT 1 FROM ${log} - WHERE ${log.createdAt} >= ${currentDayStart}::timestamp - AND ${log.createdAt} < ${currentDayStart}::timestamp + interval '1 day' - AND ${log.createdAt} > ${watermark.minUpdatedAt} - LIMIT 1 - )`.as("hasNewLogs"), - }) - .from(sql`(SELECT 1) AS dummy`); - - if (!hasNewLogs) { - logger.debug( - `No new logs since last refresh (${watermark.minUpdatedAt.toISOString()}), skipping current-day rescan`, - ); - return; - } - } + const yesterdayStart = new Date(todayStart.getTime() - DAY_MS); - await recalculateGlobalDailyStats(currentDayStart); - logger.info(`Refreshed current day global stats (${currentDayStart})`); - } catch (error) { - logger.error( - "Error refreshing current day global stats", - error instanceof Error ? error : new Error(String(error)), - ); - throw error; + const state = await readState(); + if (state?.lastSafetyNetDay && state.lastSafetyNetDay >= yesterdayStart) { + return; } + + logger.info( + `[global-safety-net] Recomputing ${formatUTCTimestamp(yesterdayStart)} from logs`, + ); + + await recomputeDayFully(yesterdayStart); + await setLastSafetyNetDay(yesterdayStart); + + logger.info( + `[global-safety-net] Recompute complete for ${formatUTCTimestamp(yesterdayStart)}`, + ); } -export async function refreshGlobalDailyStats() { +export async function processClosedHours(): Promise { const start = Date.now(); - logger.info("Starting global daily stats refresh..."); - - try { - const liveStart = Date.now(); - await refreshCurrentDayStats(); + const now = new Date(); + const settlingMs = SETTLING_BUFFER_MINUTES * 60 * 1000; + const cutoffMs = now.getTime() - HOUR_MS - settlingMs; + const latestSafeHour = floorToHour(new Date(cutoffMs)); + + const state = await readState(); + + let nextHour: Date; + if (state?.lastProcessedHour) { + nextHour = new Date(state.lastProcessedHour.getTime() + HOUR_MS); + } else { + const lookbackMs = INITIAL_LOOKBACK_DAYS * DAY_MS; + nextHour = floorToHour(new Date(now.getTime() - lookbackMs)); logger.info( - `Current day global stats refresh took ${Date.now() - liveStart}ms`, + `[global] No watermark, seeding from ${formatUTCTimestamp(nextHour)}`, ); + } + + let processed = 0; + while (nextHour <= latestSafeHour && processed < MAX_HOURS_PER_TICK) { + if (isStopRequested()) { + logger.info(`[global] Stop requested, processed ${processed} hours`); + break; + } + + const hour = nextHour; + await db.transaction(async (tx) => { + await aggregateHourIntoDailyStats(tx, hour); + await setLastProcessedHour(tx, hour); + }); + + processed++; + nextHour = new Date(hour.getTime() + HOUR_MS); + } - const recentStart = Date.now(); - await aggregateHistoricalGlobalStats(); + if (processed >= MAX_HOURS_PER_TICK && nextHour <= latestSafeHour) { logger.info( - `Global stale detection + backfill took ${Date.now() - recentStart}ms`, + `[global] Hit per-tick cap (${MAX_HOURS_PER_TICK}), more hours pending — will continue next tick`, ); + } + if (processed > 0) { logger.info( - `Global daily stats refresh complete in ${Date.now() - start}ms`, - ); - } catch (error) { - logger.error( - "Error refreshing global daily stats", - error instanceof Error ? error : new Error(String(error)), + `[global] Processed ${processed} closed hours in ${Date.now() - start}ms (watermark now ${formatUTCTimestamp(new Date(nextHour.getTime() - HOUR_MS))})`, ); - throw error; + } else { + logger.debug("[global] No new closed hours to process"); + } + + if (!isStopRequested()) { + try { + await runSafetyNetIfNeeded(now); + } catch (error) { + logger.error( + "[global-safety-net] Failed", + error instanceof Error ? error : new Error(String(error)), + ); + } } } diff --git a/apps/worker/src/worker.ts b/apps/worker/src/worker.ts index 6bee73e647..43be0626b7 100644 --- a/apps/worker/src/worker.ts +++ b/apps/worker/src/worker.ts @@ -36,8 +36,8 @@ import { sendLowBalanceEmail, } from "./services/follow-up-emails.js"; import { - GLOBAL_DAILY_STATS_REFRESH_INTERVAL_SECONDS, - refreshGlobalDailyStats, + GLOBAL_DAILY_STATS_INTERVAL_SECONDS, + processClosedHours, } from "./services/global-stats-aggregator.js"; import { PROJECT_STATS_REFRESH_INTERVAL_SECONDS, @@ -1563,15 +1563,15 @@ async function runProjectStatsLoop() { async function runGlobalDailyStatsLoop() { activeLoops++; - const interval = GLOBAL_DAILY_STATS_REFRESH_INTERVAL_SECONDS * 1000; + const interval = GLOBAL_DAILY_STATS_INTERVAL_SECONDS * 1000; logger.info( - `Starting global daily stats loop (interval: ${GLOBAL_DAILY_STATS_REFRESH_INTERVAL_SECONDS} seconds)...`, + `Starting global daily stats loop (interval: ${GLOBAL_DAILY_STATS_INTERVAL_SECONDS} seconds)...`, ); try { while (!isStopRequested()) { try { - await refreshGlobalDailyStats(); + await processClosedHours(); await interruptibleSleep(interval); } catch (error) { @@ -1686,7 +1686,7 @@ export async function startWorker() { `- Project hourly stats: runs every ${PROJECT_STATS_REFRESH_INTERVAL_SECONDS} seconds for dashboard aggregations`, ); logger.info( - `- Global daily stats: runs every ${GLOBAL_DAILY_STATS_REFRESH_INTERVAL_SECONDS} seconds for cross-org aggregations`, + `- Global daily stats: runs every ${GLOBAL_DAILY_STATS_INTERVAL_SECONDS} seconds, processes closed hours incrementally`, ); logger.info( "- Follow-up emails: runs every hour to check for lifecycle emails", diff --git a/packages/db/migrations/1778164250_fresh_blazing_skull.sql b/packages/db/migrations/1778164250_fresh_blazing_skull.sql new file mode 100644 index 0000000000..4854b6838b --- /dev/null +++ b/packages/db/migrations/1778164250_fresh_blazing_skull.sql @@ -0,0 +1,6 @@ +CREATE TABLE "global_daily_aggregation_state" ( + "id" text PRIMARY KEY DEFAULT 'singleton', + "last_processed_hour" timestamp, + "last_safety_net_day" timestamp, + "updated_at" timestamp DEFAULT now() NOT NULL +); diff --git a/packages/db/migrations/meta/1778164250_snapshot.json b/packages/db/migrations/meta/1778164250_snapshot.json new file mode 100644 index 0000000000..5f566b1f28 --- /dev/null +++ b/packages/db/migrations/meta/1778164250_snapshot.json @@ -0,0 +1,15806 @@ +{ + "version": "8", + "dialect": "postgres", + "id": "e1c54d44-38bb-4eb1-8346-d296ecdd4817", + "prevId": "8c9912e3-e386-4b7d-b988-818a00182dc1", + "ddl": [ + { + "isRlsEnabled": false, + "name": "account", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "api_key", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "api_key_hourly_model_stats", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "api_key_hourly_stats", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "api_key_iam_rule", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "audit_log", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "chat", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "chat_support_conversation", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "chat_support_message", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "chat_support_read_status", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "discount", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "enterprise_contact_submission", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "follow_up_email", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "global_daily_aggregation_state", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "global_daily_model_stats", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "global_daily_source_stats", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "guardrail_config", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "guardrail_rule", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "guardrail_violation", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "installation", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "lock", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "log", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "message", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "model", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "model_history", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "model_provider_mapping", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "model_provider_mapping_history", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "organization", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "organization_action", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "passkey", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "payment_failure", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "payment_method", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "project", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "project_hourly_model_stats", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "project_hourly_stats", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "provider", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "provider_key", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "rate_limit", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "referral", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "session", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "transaction", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "user", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "user_organization", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "verification", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "video_job", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "webhook_delivery_log", + "entityType": "tables", + "schema": "public" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "account" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "account_id", + "entityType": "columns", + "schema": "public", + "table": "account" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "provider_id", + "entityType": "columns", + "schema": "public", + "table": "account" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "entityType": "columns", + "schema": "public", + "table": "account" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "access_token", + "entityType": "columns", + "schema": "public", + "table": "account" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "refresh_token", + "entityType": "columns", + "schema": "public", + "table": "account" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id_token", + "entityType": "columns", + "schema": "public", + "table": "account" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "access_token_expires_at", + "entityType": "columns", + "schema": "public", + "table": "account" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "refresh_token_expires_at", + "entityType": "columns", + "schema": "public", + "table": "account" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "scope", + "entityType": "columns", + "schema": "public", + "table": "account" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "password", + "entityType": "columns", + "schema": "public", + "table": "account" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "public", + "table": "account" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "public", + "table": "account" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "api_key" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "public", + "table": "api_key" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "public", + "table": "api_key" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "token", + "entityType": "columns", + "schema": "public", + "table": "api_key" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "description", + "entityType": "columns", + "schema": "public", + "table": "api_key" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": { + "value": "'active'", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "status", + "entityType": "columns", + "schema": "public", + "table": "api_key" + }, + { + "type": "numeric", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "usage_limit", + "entityType": "columns", + "schema": "public", + "table": "api_key" + }, + { + "type": "numeric", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "'0'", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "usage", + "entityType": "columns", + "schema": "public", + "table": "api_key" + }, + { + "type": "numeric", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "period_usage_limit", + "entityType": "columns", + "schema": "public", + "table": "api_key" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "period_usage_duration_value", + "entityType": "columns", + "schema": "public", + "table": "api_key" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "period_usage_duration_unit", + "entityType": "columns", + "schema": "public", + "table": "api_key" + }, + { + "type": "numeric", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "'0'", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "current_period_usage", + "entityType": "columns", + "schema": "public", + "table": "api_key" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "current_period_started_at", + "entityType": "columns", + "schema": "public", + "table": "api_key" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "project_id", + "entityType": "columns", + "schema": "public", + "table": "api_key" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "created_by", + "entityType": "columns", + "schema": "public", + "table": "api_key" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_model_stats" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_model_stats" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_model_stats" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "api_key_id", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_model_stats" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "project_id", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_model_stats" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "hour_timestamp", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_model_stats" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "used_model", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_model_stats" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "used_provider", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_model_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "request_count", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_model_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "error_count", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_model_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "cache_count", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_model_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "streamed_count", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_model_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "non_streamed_count", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_model_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "completed_count", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_model_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "length_limit_count", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_model_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "content_filter_count", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_model_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "tool_calls_count", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_model_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "canceled_count", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_model_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "unknown_finish_count", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_model_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "client_error_count", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_model_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "gateway_error_count", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_model_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "upstream_error_count", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_model_stats" + }, + { + "type": "numeric", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "'0'", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "input_tokens", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_model_stats" + }, + { + "type": "numeric", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "'0'", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "output_tokens", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_model_stats" + }, + { + "type": "numeric", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "'0'", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "total_tokens", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_model_stats" + }, + { + "type": "numeric", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "'0'", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "reasoning_tokens", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_model_stats" + }, + { + "type": "numeric", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "'0'", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "cached_tokens", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_model_stats" + }, + { + "type": "numeric", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "'0'", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "cache_write_tokens", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_model_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "cost", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_model_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "input_cost", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_model_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "output_cost", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_model_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "request_cost", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_model_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "data_storage_cost", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_model_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "discount_savings", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_model_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "image_input_cost", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_model_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "image_output_cost", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_model_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "video_output_cost", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_model_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "cached_input_cost", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_model_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "cache_write_input_cost", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_model_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "credits_request_count", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_model_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "api_keys_request_count", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_model_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "credits_cost", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_model_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "api_keys_cost", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_model_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "credits_data_storage_cost", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_model_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "api_keys_data_storage_cost", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_model_stats" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_stats" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_stats" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_stats" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "api_key_id", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_stats" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "project_id", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_stats" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "hour_timestamp", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "request_count", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "error_count", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "cache_count", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "streamed_count", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "non_streamed_count", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "completed_count", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "length_limit_count", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "content_filter_count", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "tool_calls_count", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "canceled_count", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "unknown_finish_count", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "client_error_count", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "gateway_error_count", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "upstream_error_count", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_stats" + }, + { + "type": "numeric", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "'0'", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "input_tokens", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_stats" + }, + { + "type": "numeric", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "'0'", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "output_tokens", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_stats" + }, + { + "type": "numeric", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "'0'", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "total_tokens", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_stats" + }, + { + "type": "numeric", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "'0'", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "reasoning_tokens", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_stats" + }, + { + "type": "numeric", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "'0'", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "cached_tokens", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_stats" + }, + { + "type": "numeric", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "'0'", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "cache_write_tokens", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "cost", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "input_cost", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "output_cost", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "request_cost", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "data_storage_cost", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "discount_savings", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "image_input_cost", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "image_output_cost", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "video_output_cost", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "cached_input_cost", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "cache_write_input_cost", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "credits_request_count", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "api_keys_request_count", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "credits_cost", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "api_keys_cost", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "credits_data_storage_cost", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "api_keys_data_storage_cost", + "entityType": "columns", + "schema": "public", + "table": "api_key_hourly_stats" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "api_key_iam_rule" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "public", + "table": "api_key_iam_rule" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "public", + "table": "api_key_iam_rule" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "api_key_id", + "entityType": "columns", + "schema": "public", + "table": "api_key_iam_rule" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "rule_type", + "entityType": "columns", + "schema": "public", + "table": "api_key_iam_rule" + }, + { + "type": "json", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "rule_value", + "entityType": "columns", + "schema": "public", + "table": "api_key_iam_rule" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "'active'", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "status", + "entityType": "columns", + "schema": "public", + "table": "api_key_iam_rule" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "audit_log" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "public", + "table": "audit_log" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "organization_id", + "entityType": "columns", + "schema": "public", + "table": "audit_log" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "entityType": "columns", + "schema": "public", + "table": "audit_log" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "action", + "entityType": "columns", + "schema": "public", + "table": "audit_log" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "resource_type", + "entityType": "columns", + "schema": "public", + "table": "audit_log" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "resource_id", + "entityType": "columns", + "schema": "public", + "table": "audit_log" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "metadata", + "entityType": "columns", + "schema": "public", + "table": "audit_log" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "chat" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "public", + "table": "chat" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "public", + "table": "chat" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "title", + "entityType": "columns", + "schema": "public", + "table": "chat" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "entityType": "columns", + "schema": "public", + "table": "chat" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "model", + "entityType": "columns", + "schema": "public", + "table": "chat" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": { + "value": "'active'", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "status", + "entityType": "columns", + "schema": "public", + "table": "chat" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": { + "value": "false", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "web_search", + "entityType": "columns", + "schema": "public", + "table": "chat" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "chat_support_conversation" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "public", + "table": "chat_support_conversation" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "public", + "table": "chat_support_conversation" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "public", + "table": "chat_support_conversation" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "email", + "entityType": "columns", + "schema": "public", + "table": "chat_support_conversation" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "ip_address", + "entityType": "columns", + "schema": "public", + "table": "chat_support_conversation" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_agent", + "entityType": "columns", + "schema": "public", + "table": "chat_support_conversation" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "message_count", + "entityType": "columns", + "schema": "public", + "table": "chat_support_conversation" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "escalated_at", + "entityType": "columns", + "schema": "public", + "table": "chat_support_conversation" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "archived_at", + "entityType": "columns", + "schema": "public", + "table": "chat_support_conversation" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "chat_support_message" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "public", + "table": "chat_support_message" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "conversation_id", + "entityType": "columns", + "schema": "public", + "table": "chat_support_message" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "role", + "entityType": "columns", + "schema": "public", + "table": "chat_support_message" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "content", + "entityType": "columns", + "schema": "public", + "table": "chat_support_message" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sequence", + "entityType": "columns", + "schema": "public", + "table": "chat_support_message" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "chat_support_read_status" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "conversation_id", + "entityType": "columns", + "schema": "public", + "table": "chat_support_read_status" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "admin_user_id", + "entityType": "columns", + "schema": "public", + "table": "chat_support_read_status" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "last_read_message_count", + "entityType": "columns", + "schema": "public", + "table": "chat_support_read_status" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "read_at", + "entityType": "columns", + "schema": "public", + "table": "chat_support_read_status" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "discount" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "public", + "table": "discount" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "public", + "table": "discount" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "organization_id", + "entityType": "columns", + "schema": "public", + "table": "discount" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "provider", + "entityType": "columns", + "schema": "public", + "table": "discount" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "model", + "entityType": "columns", + "schema": "public", + "table": "discount" + }, + { + "type": "numeric", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "discount_percent", + "entityType": "columns", + "schema": "public", + "table": "discount" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "reason", + "entityType": "columns", + "schema": "public", + "table": "discount" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "entityType": "columns", + "schema": "public", + "table": "discount" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "enterprise_contact_submission" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "public", + "table": "enterprise_contact_submission" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "public", + "table": "enterprise_contact_submission" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "public", + "table": "enterprise_contact_submission" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "email", + "entityType": "columns", + "schema": "public", + "table": "enterprise_contact_submission" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "country", + "entityType": "columns", + "schema": "public", + "table": "enterprise_contact_submission" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "size", + "entityType": "columns", + "schema": "public", + "table": "enterprise_contact_submission" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "message", + "entityType": "columns", + "schema": "public", + "table": "enterprise_contact_submission" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "honeypot", + "entityType": "columns", + "schema": "public", + "table": "enterprise_contact_submission" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "client_timestamp_ms", + "entityType": "columns", + "schema": "public", + "table": "enterprise_contact_submission" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "ip_address", + "entityType": "columns", + "schema": "public", + "table": "enterprise_contact_submission" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_agent", + "entityType": "columns", + "schema": "public", + "table": "enterprise_contact_submission" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "'pending'", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "spam_filter_status", + "entityType": "columns", + "schema": "public", + "table": "enterprise_contact_submission" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "rejection_reason", + "entityType": "columns", + "schema": "public", + "table": "enterprise_contact_submission" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "archived_at", + "entityType": "columns", + "schema": "public", + "table": "enterprise_contact_submission" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "follow_up_email" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "public", + "table": "follow_up_email" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "organization_id", + "entityType": "columns", + "schema": "public", + "table": "follow_up_email" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "email_type", + "entityType": "columns", + "schema": "public", + "table": "follow_up_email" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sent_to", + "entityType": "columns", + "schema": "public", + "table": "follow_up_email" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "'singleton'", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "global_daily_aggregation_state" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "last_processed_hour", + "entityType": "columns", + "schema": "public", + "table": "global_daily_aggregation_state" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "last_safety_net_day", + "entityType": "columns", + "schema": "public", + "table": "global_daily_aggregation_state" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "public", + "table": "global_daily_aggregation_state" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "global_daily_model_stats" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "public", + "table": "global_daily_model_stats" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "public", + "table": "global_daily_model_stats" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "day_timestamp", + "entityType": "columns", + "schema": "public", + "table": "global_daily_model_stats" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "used_model", + "entityType": "columns", + "schema": "public", + "table": "global_daily_model_stats" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "used_provider", + "entityType": "columns", + "schema": "public", + "table": "global_daily_model_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "request_count", + "entityType": "columns", + "schema": "public", + "table": "global_daily_model_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "error_count", + "entityType": "columns", + "schema": "public", + "table": "global_daily_model_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "cache_count", + "entityType": "columns", + "schema": "public", + "table": "global_daily_model_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "streamed_count", + "entityType": "columns", + "schema": "public", + "table": "global_daily_model_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "non_streamed_count", + "entityType": "columns", + "schema": "public", + "table": "global_daily_model_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "completed_count", + "entityType": "columns", + "schema": "public", + "table": "global_daily_model_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "length_limit_count", + "entityType": "columns", + "schema": "public", + "table": "global_daily_model_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "content_filter_count", + "entityType": "columns", + "schema": "public", + "table": "global_daily_model_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "tool_calls_count", + "entityType": "columns", + "schema": "public", + "table": "global_daily_model_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "canceled_count", + "entityType": "columns", + "schema": "public", + "table": "global_daily_model_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "unknown_finish_count", + "entityType": "columns", + "schema": "public", + "table": "global_daily_model_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "client_error_count", + "entityType": "columns", + "schema": "public", + "table": "global_daily_model_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "gateway_error_count", + "entityType": "columns", + "schema": "public", + "table": "global_daily_model_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "upstream_error_count", + "entityType": "columns", + "schema": "public", + "table": "global_daily_model_stats" + }, + { + "type": "numeric", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "'0'", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "input_tokens", + "entityType": "columns", + "schema": "public", + "table": "global_daily_model_stats" + }, + { + "type": "numeric", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "'0'", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "output_tokens", + "entityType": "columns", + "schema": "public", + "table": "global_daily_model_stats" + }, + { + "type": "numeric", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "'0'", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "total_tokens", + "entityType": "columns", + "schema": "public", + "table": "global_daily_model_stats" + }, + { + "type": "numeric", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "'0'", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "reasoning_tokens", + "entityType": "columns", + "schema": "public", + "table": "global_daily_model_stats" + }, + { + "type": "numeric", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "'0'", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "cached_tokens", + "entityType": "columns", + "schema": "public", + "table": "global_daily_model_stats" + }, + { + "type": "numeric", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "'0'", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "cache_write_tokens", + "entityType": "columns", + "schema": "public", + "table": "global_daily_model_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "cost", + "entityType": "columns", + "schema": "public", + "table": "global_daily_model_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "input_cost", + "entityType": "columns", + "schema": "public", + "table": "global_daily_model_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "output_cost", + "entityType": "columns", + "schema": "public", + "table": "global_daily_model_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "request_cost", + "entityType": "columns", + "schema": "public", + "table": "global_daily_model_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "data_storage_cost", + "entityType": "columns", + "schema": "public", + "table": "global_daily_model_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "discount_savings", + "entityType": "columns", + "schema": "public", + "table": "global_daily_model_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "image_input_cost", + "entityType": "columns", + "schema": "public", + "table": "global_daily_model_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "image_output_cost", + "entityType": "columns", + "schema": "public", + "table": "global_daily_model_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "video_output_cost", + "entityType": "columns", + "schema": "public", + "table": "global_daily_model_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "cached_input_cost", + "entityType": "columns", + "schema": "public", + "table": "global_daily_model_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "cache_write_input_cost", + "entityType": "columns", + "schema": "public", + "table": "global_daily_model_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "credits_request_count", + "entityType": "columns", + "schema": "public", + "table": "global_daily_model_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "api_keys_request_count", + "entityType": "columns", + "schema": "public", + "table": "global_daily_model_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "credits_cost", + "entityType": "columns", + "schema": "public", + "table": "global_daily_model_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "api_keys_cost", + "entityType": "columns", + "schema": "public", + "table": "global_daily_model_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "credits_data_storage_cost", + "entityType": "columns", + "schema": "public", + "table": "global_daily_model_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "api_keys_data_storage_cost", + "entityType": "columns", + "schema": "public", + "table": "global_daily_model_stats" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "global_daily_source_stats" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "public", + "table": "global_daily_source_stats" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "public", + "table": "global_daily_source_stats" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "day_timestamp", + "entityType": "columns", + "schema": "public", + "table": "global_daily_source_stats" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "source", + "entityType": "columns", + "schema": "public", + "table": "global_daily_source_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "request_count", + "entityType": "columns", + "schema": "public", + "table": "global_daily_source_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "error_count", + "entityType": "columns", + "schema": "public", + "table": "global_daily_source_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "cache_count", + "entityType": "columns", + "schema": "public", + "table": "global_daily_source_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "streamed_count", + "entityType": "columns", + "schema": "public", + "table": "global_daily_source_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "non_streamed_count", + "entityType": "columns", + "schema": "public", + "table": "global_daily_source_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "completed_count", + "entityType": "columns", + "schema": "public", + "table": "global_daily_source_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "length_limit_count", + "entityType": "columns", + "schema": "public", + "table": "global_daily_source_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "content_filter_count", + "entityType": "columns", + "schema": "public", + "table": "global_daily_source_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "tool_calls_count", + "entityType": "columns", + "schema": "public", + "table": "global_daily_source_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "canceled_count", + "entityType": "columns", + "schema": "public", + "table": "global_daily_source_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "unknown_finish_count", + "entityType": "columns", + "schema": "public", + "table": "global_daily_source_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "client_error_count", + "entityType": "columns", + "schema": "public", + "table": "global_daily_source_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "gateway_error_count", + "entityType": "columns", + "schema": "public", + "table": "global_daily_source_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "upstream_error_count", + "entityType": "columns", + "schema": "public", + "table": "global_daily_source_stats" + }, + { + "type": "numeric", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "'0'", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "input_tokens", + "entityType": "columns", + "schema": "public", + "table": "global_daily_source_stats" + }, + { + "type": "numeric", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "'0'", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "output_tokens", + "entityType": "columns", + "schema": "public", + "table": "global_daily_source_stats" + }, + { + "type": "numeric", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "'0'", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "total_tokens", + "entityType": "columns", + "schema": "public", + "table": "global_daily_source_stats" + }, + { + "type": "numeric", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "'0'", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "reasoning_tokens", + "entityType": "columns", + "schema": "public", + "table": "global_daily_source_stats" + }, + { + "type": "numeric", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "'0'", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "cached_tokens", + "entityType": "columns", + "schema": "public", + "table": "global_daily_source_stats" + }, + { + "type": "numeric", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "'0'", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "cache_write_tokens", + "entityType": "columns", + "schema": "public", + "table": "global_daily_source_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "cost", + "entityType": "columns", + "schema": "public", + "table": "global_daily_source_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "input_cost", + "entityType": "columns", + "schema": "public", + "table": "global_daily_source_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "output_cost", + "entityType": "columns", + "schema": "public", + "table": "global_daily_source_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "request_cost", + "entityType": "columns", + "schema": "public", + "table": "global_daily_source_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "data_storage_cost", + "entityType": "columns", + "schema": "public", + "table": "global_daily_source_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "discount_savings", + "entityType": "columns", + "schema": "public", + "table": "global_daily_source_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "image_input_cost", + "entityType": "columns", + "schema": "public", + "table": "global_daily_source_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "image_output_cost", + "entityType": "columns", + "schema": "public", + "table": "global_daily_source_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "video_output_cost", + "entityType": "columns", + "schema": "public", + "table": "global_daily_source_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "cached_input_cost", + "entityType": "columns", + "schema": "public", + "table": "global_daily_source_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "cache_write_input_cost", + "entityType": "columns", + "schema": "public", + "table": "global_daily_source_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "credits_request_count", + "entityType": "columns", + "schema": "public", + "table": "global_daily_source_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "api_keys_request_count", + "entityType": "columns", + "schema": "public", + "table": "global_daily_source_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "credits_cost", + "entityType": "columns", + "schema": "public", + "table": "global_daily_source_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "api_keys_cost", + "entityType": "columns", + "schema": "public", + "table": "global_daily_source_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "credits_data_storage_cost", + "entityType": "columns", + "schema": "public", + "table": "global_daily_source_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "api_keys_data_storage_cost", + "entityType": "columns", + "schema": "public", + "table": "global_daily_source_stats" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "guardrail_config" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "organization_id", + "entityType": "columns", + "schema": "public", + "table": "guardrail_config" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "true", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "enabled", + "entityType": "columns", + "schema": "public", + "table": "guardrail_config" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": { + "type": "unknown", + "value": "'{\"prompt_injection\":{\"enabled\":true,\"action\":\"block\"},\"jailbreak\":{\"enabled\":true,\"action\":\"block\"},\"pii_detection\":{\"enabled\":true,\"action\":\"redact\"},\"secrets\":{\"enabled\":true,\"action\":\"block\"},\"file_types\":{\"enabled\":true,\"action\":\"block\"},\"document_leakage\":{\"enabled\":false,\"action\":\"warn\"}}'" + }, + "generated": null, + "identity": null, + "name": "system_rules", + "entityType": "columns", + "schema": "public", + "table": "guardrail_config" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "10", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "max_file_size_mb", + "entityType": "columns", + "schema": "public", + "table": "guardrail_config" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 1, + "default": { + "value": "'{image/jpeg,image/png,image/gif,image/webp}'", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "allowed_file_types", + "entityType": "columns", + "schema": "public", + "table": "guardrail_config" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": { + "value": "'redact'", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "pii_action", + "entityType": "columns", + "schema": "public", + "table": "guardrail_config" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "public", + "table": "guardrail_config" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "public", + "table": "guardrail_config" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "guardrail_rule" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "organization_id", + "entityType": "columns", + "schema": "public", + "table": "guardrail_rule" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "public", + "table": "guardrail_rule" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "type", + "entityType": "columns", + "schema": "public", + "table": "guardrail_rule" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "config", + "entityType": "columns", + "schema": "public", + "table": "guardrail_rule" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "100", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "priority", + "entityType": "columns", + "schema": "public", + "table": "guardrail_rule" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "true", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "enabled", + "entityType": "columns", + "schema": "public", + "table": "guardrail_rule" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "'block'", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "action", + "entityType": "columns", + "schema": "public", + "table": "guardrail_rule" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "public", + "table": "guardrail_rule" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "public", + "table": "guardrail_rule" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "guardrail_violation" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "organization_id", + "entityType": "columns", + "schema": "public", + "table": "guardrail_violation" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "log_id", + "entityType": "columns", + "schema": "public", + "table": "guardrail_violation" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "rule_id", + "entityType": "columns", + "schema": "public", + "table": "guardrail_violation" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "rule_name", + "entityType": "columns", + "schema": "public", + "table": "guardrail_violation" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "category", + "entityType": "columns", + "schema": "public", + "table": "guardrail_violation" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "action_taken", + "entityType": "columns", + "schema": "public", + "table": "guardrail_violation" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "matched_pattern", + "entityType": "columns", + "schema": "public", + "table": "guardrail_violation" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "matched_content", + "entityType": "columns", + "schema": "public", + "table": "guardrail_violation" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "content_hash", + "entityType": "columns", + "schema": "public", + "table": "guardrail_violation" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "api_key_id", + "entityType": "columns", + "schema": "public", + "table": "guardrail_violation" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "model", + "entityType": "columns", + "schema": "public", + "table": "guardrail_violation" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "public", + "table": "guardrail_violation" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "installation" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "public", + "table": "installation" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "public", + "table": "installation" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "uuid", + "entityType": "columns", + "schema": "public", + "table": "installation" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "type", + "entityType": "columns", + "schema": "public", + "table": "installation" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "lock" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "public", + "table": "lock" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "public", + "table": "lock" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "key", + "entityType": "columns", + "schema": "public", + "table": "lock" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "request_id", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "organization_id", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "project_id", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "api_key_id", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "duration", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "time_to_first_token", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "time_to_first_reasoning_token", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "requested_model", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "requested_provider", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "used_model", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "used_model_mapping", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "used_provider", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "response_size", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "content", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "reasoning_content", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "json", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "tools", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "json", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "tool_choice", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "json", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "tool_results", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "finish_reason", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "unified_finish_reason", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "numeric", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "prompt_tokens", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "numeric", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "completion_tokens", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "numeric", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "total_tokens", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "numeric", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "reasoning_tokens", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "numeric", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "cached_tokens", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "numeric", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "cache_write_tokens", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "json", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "messages", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "real", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "temperature", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "max_tokens", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "real", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "top_p", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "real", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "frequency_penalty", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "real", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "presence_penalty", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "reasoning_effort", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "reasoning_max_tokens", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "effort", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "json", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "response_format", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": { + "value": "false", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "has_error", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "json", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "error_details", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "real", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "cost", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "real", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "input_cost", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "real", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "output_cost", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "real", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "cached_input_cost", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "real", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "cache_write_input_cost", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "real", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "request_cost", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "real", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "web_search_cost", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "numeric", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "image_input_tokens", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "numeric", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "image_output_tokens", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "real", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "image_input_cost", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "real", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "image_output_cost", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "real", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "video_output_cost", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "video_download_count", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "last_video_downloaded_at", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": { + "value": "false", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "estimated_cost", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "real", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "discount", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "pricing_tier", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": { + "value": "false", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "canceled", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": { + "value": "false", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "streamed", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": { + "value": "false", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "cached", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "mode", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "used_mode", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "source", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "json", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "custom_headers", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "json", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "routing_metadata", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "processed_at", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "raw_request", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "raw_response", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "upstream_request", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "upstream_response", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "trace_id", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": { + "value": "false", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "data_retention_cleaned_up", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "numeric", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "'0'", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "data_storage_cost", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "json", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "params", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_agent", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "json", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "plugins", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "json", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "plugin_results", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": { + "value": "false", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "retried", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "retried_by_log_id", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "internal_content_filter", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "gateway_content_filter_response", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "responses_api_id", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "responses_api_data", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "message" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "public", + "table": "message" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "public", + "table": "message" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "chat_id", + "entityType": "columns", + "schema": "public", + "table": "message" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "role", + "entityType": "columns", + "schema": "public", + "table": "message" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "content", + "entityType": "columns", + "schema": "public", + "table": "message" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "images", + "entityType": "columns", + "schema": "public", + "table": "message" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "reasoning", + "entityType": "columns", + "schema": "public", + "table": "message" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "tools", + "entityType": "columns", + "schema": "public", + "table": "message" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sequence", + "entityType": "columns", + "schema": "public", + "table": "message" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "model" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "public", + "table": "model" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "public", + "table": "model" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "released_at", + "entityType": "columns", + "schema": "public", + "table": "model" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "'(empty)'", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "public", + "table": "model" + }, + { + "type": "json", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "type": "unknown", + "value": "'[]'" + }, + "generated": null, + "identity": null, + "name": "aliases", + "entityType": "columns", + "schema": "public", + "table": "model" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "'(empty)'", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "description", + "entityType": "columns", + "schema": "public", + "table": "model" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "family", + "entityType": "columns", + "schema": "public", + "table": "model" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "false", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "free", + "entityType": "columns", + "schema": "public", + "table": "model" + }, + { + "type": "json", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "type": "unknown", + "value": "'[\"text\"]'" + }, + "generated": null, + "identity": null, + "name": "output", + "entityType": "columns", + "schema": "public", + "table": "model" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "false", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "image_input_required", + "entityType": "columns", + "schema": "public", + "table": "model" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "'stable'", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "stability", + "entityType": "columns", + "schema": "public", + "table": "model" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "'active'", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "status", + "entityType": "columns", + "schema": "public", + "table": "model" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "logs_count", + "entityType": "columns", + "schema": "public", + "table": "model" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "errors_count", + "entityType": "columns", + "schema": "public", + "table": "model" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "client_errors_count", + "entityType": "columns", + "schema": "public", + "table": "model" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "gateway_errors_count", + "entityType": "columns", + "schema": "public", + "table": "model" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "upstream_errors_count", + "entityType": "columns", + "schema": "public", + "table": "model" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "cached_count", + "entityType": "columns", + "schema": "public", + "table": "model" + }, + { + "type": "real", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "avg_time_to_first_token", + "entityType": "columns", + "schema": "public", + "table": "model" + }, + { + "type": "real", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "avg_time_to_first_reasoning_token", + "entityType": "columns", + "schema": "public", + "table": "model" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "stats_updated_at", + "entityType": "columns", + "schema": "public", + "table": "model" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "model_history" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "public", + "table": "model_history" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "public", + "table": "model_history" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "model_id", + "entityType": "columns", + "schema": "public", + "table": "model_history" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "minute_timestamp", + "entityType": "columns", + "schema": "public", + "table": "model_history" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "logs_count", + "entityType": "columns", + "schema": "public", + "table": "model_history" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "errors_count", + "entityType": "columns", + "schema": "public", + "table": "model_history" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "client_errors_count", + "entityType": "columns", + "schema": "public", + "table": "model_history" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "gateway_errors_count", + "entityType": "columns", + "schema": "public", + "table": "model_history" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "upstream_errors_count", + "entityType": "columns", + "schema": "public", + "table": "model_history" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "cached_count", + "entityType": "columns", + "schema": "public", + "table": "model_history" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "total_input_tokens", + "entityType": "columns", + "schema": "public", + "table": "model_history" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "total_output_tokens", + "entityType": "columns", + "schema": "public", + "table": "model_history" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "total_tokens", + "entityType": "columns", + "schema": "public", + "table": "model_history" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "total_reasoning_tokens", + "entityType": "columns", + "schema": "public", + "table": "model_history" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "total_cached_tokens", + "entityType": "columns", + "schema": "public", + "table": "model_history" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "total_duration", + "entityType": "columns", + "schema": "public", + "table": "model_history" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "total_time_to_first_token", + "entityType": "columns", + "schema": "public", + "table": "model_history" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "total_time_to_first_reasoning_token", + "entityType": "columns", + "schema": "public", + "table": "model_history" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "total_cost", + "entityType": "columns", + "schema": "public", + "table": "model_history" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "model_provider_mapping" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "public", + "table": "model_provider_mapping" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "public", + "table": "model_provider_mapping" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "model_id", + "entityType": "columns", + "schema": "public", + "table": "model_provider_mapping" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "provider_id", + "entityType": "columns", + "schema": "public", + "table": "model_provider_mapping" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "model_name", + "entityType": "columns", + "schema": "public", + "table": "model_provider_mapping" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "region", + "entityType": "columns", + "schema": "public", + "table": "model_provider_mapping" + }, + { + "type": "numeric", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "input_price", + "entityType": "columns", + "schema": "public", + "table": "model_provider_mapping" + }, + { + "type": "numeric", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "output_price", + "entityType": "columns", + "schema": "public", + "table": "model_provider_mapping" + }, + { + "type": "numeric", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "cached_input_price", + "entityType": "columns", + "schema": "public", + "table": "model_provider_mapping" + }, + { + "type": "numeric", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "cache_write_input_price", + "entityType": "columns", + "schema": "public", + "table": "model_provider_mapping" + }, + { + "type": "numeric", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "cache_write_input_price1h", + "entityType": "columns", + "schema": "public", + "table": "model_provider_mapping" + }, + { + "type": "numeric", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "image_input_price", + "entityType": "columns", + "schema": "public", + "table": "model_provider_mapping" + }, + { + "type": "numeric", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "request_price", + "entityType": "columns", + "schema": "public", + "table": "model_provider_mapping" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "context_size", + "entityType": "columns", + "schema": "public", + "table": "model_provider_mapping" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "max_output", + "entityType": "columns", + "schema": "public", + "table": "model_provider_mapping" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "false", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "streaming", + "entityType": "columns", + "schema": "public", + "table": "model_provider_mapping" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "vision", + "entityType": "columns", + "schema": "public", + "table": "model_provider_mapping" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "reasoning", + "entityType": "columns", + "schema": "public", + "table": "model_provider_mapping" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "false", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "reasoning_max_tokens", + "entityType": "columns", + "schema": "public", + "table": "model_provider_mapping" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "reasoning_output", + "entityType": "columns", + "schema": "public", + "table": "model_provider_mapping" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "tools", + "entityType": "columns", + "schema": "public", + "table": "model_provider_mapping" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "false", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "json_output", + "entityType": "columns", + "schema": "public", + "table": "model_provider_mapping" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "false", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "json_output_schema", + "entityType": "columns", + "schema": "public", + "table": "model_provider_mapping" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "false", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "web_search", + "entityType": "columns", + "schema": "public", + "table": "model_provider_mapping" + }, + { + "type": "numeric", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "web_search_price", + "entityType": "columns", + "schema": "public", + "table": "model_provider_mapping" + }, + { + "type": "numeric", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "'0'", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "discount", + "entityType": "columns", + "schema": "public", + "table": "model_provider_mapping" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "'stable'", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "stability", + "entityType": "columns", + "schema": "public", + "table": "model_provider_mapping" + }, + { + "type": "json", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "supported_parameters", + "entityType": "columns", + "schema": "public", + "table": "model_provider_mapping" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "test", + "entityType": "columns", + "schema": "public", + "table": "model_provider_mapping" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "deprecated_at", + "entityType": "columns", + "schema": "public", + "table": "model_provider_mapping" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "deactivated_at", + "entityType": "columns", + "schema": "public", + "table": "model_provider_mapping" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "'active'", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "status", + "entityType": "columns", + "schema": "public", + "table": "model_provider_mapping" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "logs_count", + "entityType": "columns", + "schema": "public", + "table": "model_provider_mapping" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "errors_count", + "entityType": "columns", + "schema": "public", + "table": "model_provider_mapping" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "client_errors_count", + "entityType": "columns", + "schema": "public", + "table": "model_provider_mapping" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "gateway_errors_count", + "entityType": "columns", + "schema": "public", + "table": "model_provider_mapping" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "upstream_errors_count", + "entityType": "columns", + "schema": "public", + "table": "model_provider_mapping" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "cached_count", + "entityType": "columns", + "schema": "public", + "table": "model_provider_mapping" + }, + { + "type": "real", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "avg_time_to_first_token", + "entityType": "columns", + "schema": "public", + "table": "model_provider_mapping" + }, + { + "type": "real", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "avg_time_to_first_reasoning_token", + "entityType": "columns", + "schema": "public", + "table": "model_provider_mapping" + }, + { + "type": "real", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "routing_uptime", + "entityType": "columns", + "schema": "public", + "table": "model_provider_mapping" + }, + { + "type": "real", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "routing_latency", + "entityType": "columns", + "schema": "public", + "table": "model_provider_mapping" + }, + { + "type": "real", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "routing_throughput", + "entityType": "columns", + "schema": "public", + "table": "model_provider_mapping" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "routing_total_requests", + "entityType": "columns", + "schema": "public", + "table": "model_provider_mapping" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "stats_updated_at", + "entityType": "columns", + "schema": "public", + "table": "model_provider_mapping" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "model_provider_mapping_history" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "public", + "table": "model_provider_mapping_history" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "public", + "table": "model_provider_mapping_history" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "model_id", + "entityType": "columns", + "schema": "public", + "table": "model_provider_mapping_history" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "provider_id", + "entityType": "columns", + "schema": "public", + "table": "model_provider_mapping_history" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "model_provider_mapping_id", + "entityType": "columns", + "schema": "public", + "table": "model_provider_mapping_history" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "minute_timestamp", + "entityType": "columns", + "schema": "public", + "table": "model_provider_mapping_history" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "logs_count", + "entityType": "columns", + "schema": "public", + "table": "model_provider_mapping_history" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "errors_count", + "entityType": "columns", + "schema": "public", + "table": "model_provider_mapping_history" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "client_errors_count", + "entityType": "columns", + "schema": "public", + "table": "model_provider_mapping_history" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "gateway_errors_count", + "entityType": "columns", + "schema": "public", + "table": "model_provider_mapping_history" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "upstream_errors_count", + "entityType": "columns", + "schema": "public", + "table": "model_provider_mapping_history" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "cached_count", + "entityType": "columns", + "schema": "public", + "table": "model_provider_mapping_history" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "total_input_tokens", + "entityType": "columns", + "schema": "public", + "table": "model_provider_mapping_history" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "total_output_tokens", + "entityType": "columns", + "schema": "public", + "table": "model_provider_mapping_history" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "total_tokens", + "entityType": "columns", + "schema": "public", + "table": "model_provider_mapping_history" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "total_reasoning_tokens", + "entityType": "columns", + "schema": "public", + "table": "model_provider_mapping_history" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "total_cached_tokens", + "entityType": "columns", + "schema": "public", + "table": "model_provider_mapping_history" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "total_duration", + "entityType": "columns", + "schema": "public", + "table": "model_provider_mapping_history" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "total_time_to_first_token", + "entityType": "columns", + "schema": "public", + "table": "model_provider_mapping_history" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "total_time_to_first_reasoning_token", + "entityType": "columns", + "schema": "public", + "table": "model_provider_mapping_history" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "total_cost", + "entityType": "columns", + "schema": "public", + "table": "model_provider_mapping_history" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "organization" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "public", + "table": "organization" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "public", + "table": "organization" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "public", + "table": "organization" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "billing_email", + "entityType": "columns", + "schema": "public", + "table": "organization" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "billing_company", + "entityType": "columns", + "schema": "public", + "table": "organization" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "billing_address", + "entityType": "columns", + "schema": "public", + "table": "organization" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "billing_tax_id", + "entityType": "columns", + "schema": "public", + "table": "organization" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "billing_notes", + "entityType": "columns", + "schema": "public", + "table": "organization" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "stripe_customer_id", + "entityType": "columns", + "schema": "public", + "table": "organization" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "stripe_subscription_id", + "entityType": "columns", + "schema": "public", + "table": "organization" + }, + { + "type": "numeric", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "'0'", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "credits", + "entityType": "columns", + "schema": "public", + "table": "organization" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "false", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "auto_top_up_enabled", + "entityType": "columns", + "schema": "public", + "table": "organization" + }, + { + "type": "numeric", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": { + "value": "'10'", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "auto_top_up_threshold", + "entityType": "columns", + "schema": "public", + "table": "organization" + }, + { + "type": "numeric", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": { + "value": "'10'", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "auto_top_up_amount", + "entityType": "columns", + "schema": "public", + "table": "organization" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "'free'", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "plan", + "entityType": "columns", + "schema": "public", + "table": "organization" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "plan_expires_at", + "entityType": "columns", + "schema": "public", + "table": "organization" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "false", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "subscription_cancelled", + "entityType": "columns", + "schema": "public", + "table": "organization" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "trial_start_date", + "entityType": "columns", + "schema": "public", + "table": "organization" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "trial_end_date", + "entityType": "columns", + "schema": "public", + "table": "organization" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "false", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "is_trial_active", + "entityType": "columns", + "schema": "public", + "table": "organization" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "'none'", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "retention_level", + "entityType": "columns", + "schema": "public", + "table": "organization" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": { + "value": "'active'", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "status", + "entityType": "columns", + "schema": "public", + "table": "organization" + }, + { + "type": "numeric", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "'0'", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "referral_earnings", + "entityType": "columns", + "schema": "public", + "table": "organization" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "payment_failure_count", + "entityType": "columns", + "schema": "public", + "table": "organization" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "last_payment_failure_at", + "entityType": "columns", + "schema": "public", + "table": "organization" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "payment_failure_started_at", + "entityType": "columns", + "schema": "public", + "table": "organization" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "false", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "is_personal", + "entityType": "columns", + "schema": "public", + "table": "organization" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "'none'", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "dev_plan", + "entityType": "columns", + "schema": "public", + "table": "organization" + }, + { + "type": "numeric", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "'0'", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "dev_plan_credits_used", + "entityType": "columns", + "schema": "public", + "table": "organization" + }, + { + "type": "numeric", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "'0'", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "dev_plan_credits_limit", + "entityType": "columns", + "schema": "public", + "table": "organization" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "dev_plan_billing_cycle_start", + "entityType": "columns", + "schema": "public", + "table": "organization" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "dev_plan_stripe_subscription_id", + "entityType": "columns", + "schema": "public", + "table": "organization" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "false", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "dev_plan_cancelled", + "entityType": "columns", + "schema": "public", + "table": "organization" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "dev_plan_expires_at", + "entityType": "columns", + "schema": "public", + "table": "organization" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "'monthly'", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "dev_plan_cycle", + "entityType": "columns", + "schema": "public", + "table": "organization" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "false", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "dev_plan_allow_all_models", + "entityType": "columns", + "schema": "public", + "table": "organization" + }, + { + "type": "numeric", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "last_top_up_amount", + "entityType": "columns", + "schema": "public", + "table": "organization" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "organization_action" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "public", + "table": "organization_action" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "public", + "table": "organization_action" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "organization_id", + "entityType": "columns", + "schema": "public", + "table": "organization_action" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "type", + "entityType": "columns", + "schema": "public", + "table": "organization_action" + }, + { + "type": "numeric", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "amount", + "entityType": "columns", + "schema": "public", + "table": "organization_action" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "description", + "entityType": "columns", + "schema": "public", + "table": "organization_action" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "passkey" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "public", + "table": "passkey" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "public", + "table": "passkey" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "public", + "table": "passkey" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "public_key", + "entityType": "columns", + "schema": "public", + "table": "passkey" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "entityType": "columns", + "schema": "public", + "table": "passkey" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "credential_id", + "entityType": "columns", + "schema": "public", + "table": "passkey" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "counter", + "entityType": "columns", + "schema": "public", + "table": "passkey" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "device_type", + "entityType": "columns", + "schema": "public", + "table": "passkey" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "backed_up", + "entityType": "columns", + "schema": "public", + "table": "passkey" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "transports", + "entityType": "columns", + "schema": "public", + "table": "passkey" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "aaguid", + "entityType": "columns", + "schema": "public", + "table": "passkey" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "payment_failure" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "public", + "table": "payment_failure" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "organization_id", + "entityType": "columns", + "schema": "public", + "table": "payment_failure" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_email", + "entityType": "columns", + "schema": "public", + "table": "payment_failure" + }, + { + "type": "numeric", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "amount", + "entityType": "columns", + "schema": "public", + "table": "payment_failure" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "'USD'", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "currency", + "entityType": "columns", + "schema": "public", + "table": "payment_failure" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "decline_code", + "entityType": "columns", + "schema": "public", + "table": "payment_failure" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "error_code", + "entityType": "columns", + "schema": "public", + "table": "payment_failure" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "failure_message", + "entityType": "columns", + "schema": "public", + "table": "payment_failure" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "stripe_payment_intent_id", + "entityType": "columns", + "schema": "public", + "table": "payment_failure" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "source", + "entityType": "columns", + "schema": "public", + "table": "payment_failure" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "payment_method" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "public", + "table": "payment_method" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "public", + "table": "payment_method" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "stripe_payment_method_id", + "entityType": "columns", + "schema": "public", + "table": "payment_method" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "organization_id", + "entityType": "columns", + "schema": "public", + "table": "payment_method" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "type", + "entityType": "columns", + "schema": "public", + "table": "payment_method" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "false", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "is_default", + "entityType": "columns", + "schema": "public", + "table": "payment_method" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "project" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "public", + "table": "project" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "public", + "table": "project" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "public", + "table": "project" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "organization_id", + "entityType": "columns", + "schema": "public", + "table": "project" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "false", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "caching_enabled", + "entityType": "columns", + "schema": "public", + "table": "project" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "60", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "cache_duration_seconds", + "entityType": "columns", + "schema": "public", + "table": "project" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "'hybrid'", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "mode", + "entityType": "columns", + "schema": "public", + "table": "project" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": { + "value": "'active'", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "status", + "entityType": "columns", + "schema": "public", + "table": "project" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_model_stats" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_model_stats" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_model_stats" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "project_id", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_model_stats" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "hour_timestamp", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_model_stats" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "used_model", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_model_stats" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "used_provider", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_model_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "request_count", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_model_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "error_count", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_model_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "cache_count", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_model_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "streamed_count", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_model_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "non_streamed_count", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_model_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "completed_count", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_model_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "length_limit_count", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_model_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "content_filter_count", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_model_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "tool_calls_count", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_model_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "canceled_count", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_model_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "unknown_finish_count", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_model_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "client_error_count", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_model_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "gateway_error_count", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_model_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "upstream_error_count", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_model_stats" + }, + { + "type": "numeric", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "'0'", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "input_tokens", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_model_stats" + }, + { + "type": "numeric", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "'0'", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "output_tokens", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_model_stats" + }, + { + "type": "numeric", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "'0'", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "total_tokens", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_model_stats" + }, + { + "type": "numeric", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "'0'", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "reasoning_tokens", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_model_stats" + }, + { + "type": "numeric", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "'0'", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "cached_tokens", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_model_stats" + }, + { + "type": "numeric", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "'0'", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "cache_write_tokens", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_model_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "cost", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_model_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "input_cost", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_model_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "output_cost", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_model_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "request_cost", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_model_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "data_storage_cost", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_model_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "discount_savings", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_model_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "image_input_cost", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_model_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "image_output_cost", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_model_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "video_output_cost", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_model_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "cached_input_cost", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_model_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "cache_write_input_cost", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_model_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "credits_request_count", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_model_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "api_keys_request_count", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_model_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "credits_cost", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_model_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "api_keys_cost", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_model_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "credits_data_storage_cost", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_model_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "api_keys_data_storage_cost", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_model_stats" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_stats" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_stats" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_stats" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "project_id", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_stats" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "hour_timestamp", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "request_count", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "error_count", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "cache_count", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "streamed_count", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "non_streamed_count", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "completed_count", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "length_limit_count", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "content_filter_count", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "tool_calls_count", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "canceled_count", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "unknown_finish_count", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "client_error_count", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "gateway_error_count", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "upstream_error_count", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_stats" + }, + { + "type": "numeric", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "'0'", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "input_tokens", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_stats" + }, + { + "type": "numeric", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "'0'", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "output_tokens", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_stats" + }, + { + "type": "numeric", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "'0'", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "total_tokens", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_stats" + }, + { + "type": "numeric", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "'0'", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "reasoning_tokens", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_stats" + }, + { + "type": "numeric", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "'0'", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "cached_tokens", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_stats" + }, + { + "type": "numeric", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "'0'", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "cache_write_tokens", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "cost", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "input_cost", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "output_cost", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "request_cost", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "data_storage_cost", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "discount_savings", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "image_input_cost", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "image_output_cost", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "video_output_cost", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "cached_input_cost", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "cache_write_input_cost", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "credits_request_count", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_stats" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "api_keys_request_count", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "credits_cost", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "api_keys_cost", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "credits_data_storage_cost", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "api_keys_data_storage_cost", + "entityType": "columns", + "schema": "public", + "table": "project_hourly_stats" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "provider" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "public", + "table": "provider" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "public", + "table": "provider" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "public", + "table": "provider" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "description", + "entityType": "columns", + "schema": "public", + "table": "provider" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "streaming", + "entityType": "columns", + "schema": "public", + "table": "provider" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "cancellation", + "entityType": "columns", + "schema": "public", + "table": "provider" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "color", + "entityType": "columns", + "schema": "public", + "table": "provider" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "website", + "entityType": "columns", + "schema": "public", + "table": "provider" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "announcement", + "entityType": "columns", + "schema": "public", + "table": "provider" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "'active'", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "status", + "entityType": "columns", + "schema": "public", + "table": "provider" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "logs_count", + "entityType": "columns", + "schema": "public", + "table": "provider" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "errors_count", + "entityType": "columns", + "schema": "public", + "table": "provider" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "client_errors_count", + "entityType": "columns", + "schema": "public", + "table": "provider" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "gateway_errors_count", + "entityType": "columns", + "schema": "public", + "table": "provider" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "upstream_errors_count", + "entityType": "columns", + "schema": "public", + "table": "provider" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "cached_count", + "entityType": "columns", + "schema": "public", + "table": "provider" + }, + { + "type": "real", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "avg_time_to_first_token", + "entityType": "columns", + "schema": "public", + "table": "provider" + }, + { + "type": "real", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "avg_time_to_first_reasoning_token", + "entityType": "columns", + "schema": "public", + "table": "provider" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "stats_updated_at", + "entityType": "columns", + "schema": "public", + "table": "provider" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "provider_key" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "public", + "table": "provider_key" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "public", + "table": "provider_key" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "token", + "entityType": "columns", + "schema": "public", + "table": "provider_key" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "provider", + "entityType": "columns", + "schema": "public", + "table": "provider_key" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "public", + "table": "provider_key" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "base_url", + "entityType": "columns", + "schema": "public", + "table": "provider_key" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "options", + "entityType": "columns", + "schema": "public", + "table": "provider_key" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": { + "value": "'active'", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "status", + "entityType": "columns", + "schema": "public", + "table": "provider_key" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "organization_id", + "entityType": "columns", + "schema": "public", + "table": "provider_key" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "rate_limit" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "public", + "table": "rate_limit" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "public", + "table": "rate_limit" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "organization_id", + "entityType": "columns", + "schema": "public", + "table": "rate_limit" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "provider", + "entityType": "columns", + "schema": "public", + "table": "rate_limit" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "model", + "entityType": "columns", + "schema": "public", + "table": "rate_limit" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "max_rpm", + "entityType": "columns", + "schema": "public", + "table": "rate_limit" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "max_rpd", + "entityType": "columns", + "schema": "public", + "table": "rate_limit" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "reason", + "entityType": "columns", + "schema": "public", + "table": "rate_limit" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "referral" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "public", + "table": "referral" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "public", + "table": "referral" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "referrer_organization_id", + "entityType": "columns", + "schema": "public", + "table": "referral" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "referred_organization_id", + "entityType": "columns", + "schema": "public", + "table": "referral" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "session" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "expires_at", + "entityType": "columns", + "schema": "public", + "table": "session" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "token", + "entityType": "columns", + "schema": "public", + "table": "session" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "public", + "table": "session" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "public", + "table": "session" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "ip_address", + "entityType": "columns", + "schema": "public", + "table": "session" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_agent", + "entityType": "columns", + "schema": "public", + "table": "session" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "entityType": "columns", + "schema": "public", + "table": "session" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "transaction" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "public", + "table": "transaction" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "public", + "table": "transaction" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "organization_id", + "entityType": "columns", + "schema": "public", + "table": "transaction" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "type", + "entityType": "columns", + "schema": "public", + "table": "transaction" + }, + { + "type": "numeric", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "amount", + "entityType": "columns", + "schema": "public", + "table": "transaction" + }, + { + "type": "numeric", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "credit_amount", + "entityType": "columns", + "schema": "public", + "table": "transaction" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "'USD'", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "currency", + "entityType": "columns", + "schema": "public", + "table": "transaction" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "'completed'", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "status", + "entityType": "columns", + "schema": "public", + "table": "transaction" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "stripe_payment_intent_id", + "entityType": "columns", + "schema": "public", + "table": "transaction" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "stripe_invoice_id", + "entityType": "columns", + "schema": "public", + "table": "transaction" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "description", + "entityType": "columns", + "schema": "public", + "table": "transaction" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "related_transaction_id", + "entityType": "columns", + "schema": "public", + "table": "transaction" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "refund_reason", + "entityType": "columns", + "schema": "public", + "table": "transaction" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "user" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "public", + "table": "user" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "public", + "table": "user" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "public", + "table": "user" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "email", + "entityType": "columns", + "schema": "public", + "table": "user" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "false", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "email_verified", + "entityType": "columns", + "schema": "public", + "table": "user" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "image", + "entityType": "columns", + "schema": "public", + "table": "user" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "false", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "onboarding_completed", + "entityType": "columns", + "schema": "public", + "table": "user" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "false", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "newsletter_subscribed", + "entityType": "columns", + "schema": "public", + "table": "user" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "'active'", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "status", + "entityType": "columns", + "schema": "public", + "table": "user" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "user_organization" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "public", + "table": "user_organization" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "public", + "table": "user_organization" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "entityType": "columns", + "schema": "public", + "table": "user_organization" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "organization_id", + "entityType": "columns", + "schema": "public", + "table": "user_organization" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "'owner'", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "role", + "entityType": "columns", + "schema": "public", + "table": "user_organization" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "verification" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "identifier", + "entityType": "columns", + "schema": "public", + "table": "verification" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "value", + "entityType": "columns", + "schema": "public", + "table": "verification" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "expires_at", + "entityType": "columns", + "schema": "public", + "table": "verification" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "public", + "table": "verification" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "public", + "table": "verification" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "video_job" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "request_id", + "entityType": "columns", + "schema": "public", + "table": "video_job" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "public", + "table": "video_job" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "public", + "table": "video_job" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "organization_id", + "entityType": "columns", + "schema": "public", + "table": "video_job" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "project_id", + "entityType": "columns", + "schema": "public", + "table": "video_job" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "api_key_id", + "entityType": "columns", + "schema": "public", + "table": "video_job" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "mode", + "entityType": "columns", + "schema": "public", + "table": "video_job" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "used_mode", + "entityType": "columns", + "schema": "public", + "table": "video_job" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "model", + "entityType": "columns", + "schema": "public", + "table": "video_job" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "requested_provider", + "entityType": "columns", + "schema": "public", + "table": "video_job" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "used_provider", + "entityType": "columns", + "schema": "public", + "table": "video_job" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "used_model", + "entityType": "columns", + "schema": "public", + "table": "video_job" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "provider_config_index", + "entityType": "columns", + "schema": "public", + "table": "video_job" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "upstream_id", + "entityType": "columns", + "schema": "public", + "table": "video_job" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "prompt", + "entityType": "columns", + "schema": "public", + "table": "video_job" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "'queued'", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "status", + "entityType": "columns", + "schema": "public", + "table": "video_job" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "progress", + "entityType": "columns", + "schema": "public", + "table": "video_job" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "error", + "entityType": "columns", + "schema": "public", + "table": "video_job" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "content_url", + "entityType": "columns", + "schema": "public", + "table": "video_job" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "storage_provider", + "entityType": "columns", + "schema": "public", + "table": "video_job" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "storage_bucket", + "entityType": "columns", + "schema": "public", + "table": "video_job" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "storage_object_path", + "entityType": "columns", + "schema": "public", + "table": "video_job" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "storage_uri", + "entityType": "columns", + "schema": "public", + "table": "video_job" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "storage_expires_at", + "entityType": "columns", + "schema": "public", + "table": "video_job" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "content_type", + "entityType": "columns", + "schema": "public", + "table": "video_job" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "completed_at", + "entityType": "columns", + "schema": "public", + "table": "video_job" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "entityType": "columns", + "schema": "public", + "table": "video_job" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "last_polled_at", + "entityType": "columns", + "schema": "public", + "table": "video_job" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "next_poll_at", + "entityType": "columns", + "schema": "public", + "table": "video_job" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "poll_attempt_count", + "entityType": "columns", + "schema": "public", + "table": "video_job" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "callback_url", + "entityType": "columns", + "schema": "public", + "table": "video_job" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "callback_secret", + "entityType": "columns", + "schema": "public", + "table": "video_job" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "'none'", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "callback_status", + "entityType": "columns", + "schema": "public", + "table": "video_job" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "callback_event_id", + "entityType": "columns", + "schema": "public", + "table": "video_job" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "callback_event_type", + "entityType": "columns", + "schema": "public", + "table": "video_job" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "callback_delivered_at", + "entityType": "columns", + "schema": "public", + "table": "video_job" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "result_logged_at", + "entityType": "columns", + "schema": "public", + "table": "video_job" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "routing_metadata", + "entityType": "columns", + "schema": "public", + "table": "video_job" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "upstream_create_response", + "entityType": "columns", + "schema": "public", + "table": "video_job" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "upstream_status_response", + "entityType": "columns", + "schema": "public", + "table": "video_job" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "webhook_delivery_log" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "created_at", + "entityType": "columns", + "schema": "public", + "table": "webhook_delivery_log" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "updated_at", + "entityType": "columns", + "schema": "public", + "table": "webhook_delivery_log" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "video_job_id", + "entityType": "columns", + "schema": "public", + "table": "webhook_delivery_log" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "event_id", + "entityType": "columns", + "schema": "public", + "table": "webhook_delivery_log" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "event_type", + "entityType": "columns", + "schema": "public", + "table": "webhook_delivery_log" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "target_url", + "entityType": "columns", + "schema": "public", + "table": "webhook_delivery_log" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "1", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "attempt", + "entityType": "columns", + "schema": "public", + "table": "webhook_delivery_log" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "'pending'", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "status", + "entityType": "columns", + "schema": "public", + "table": "webhook_delivery_log" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "last_tried_at", + "entityType": "columns", + "schema": "public", + "table": "webhook_delivery_log" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "now()", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "next_retry_at", + "entityType": "columns", + "schema": "public", + "table": "webhook_delivery_log" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "delivered_at", + "entityType": "columns", + "schema": "public", + "table": "webhook_delivery_log" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "request_headers", + "entityType": "columns", + "schema": "public", + "table": "webhook_delivery_log" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "request_body", + "entityType": "columns", + "schema": "public", + "table": "webhook_delivery_log" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "response_status", + "entityType": "columns", + "schema": "public", + "table": "webhook_delivery_log" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "response_body", + "entityType": "columns", + "schema": "public", + "table": "webhook_delivery_log" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "error", + "entityType": "columns", + "schema": "public", + "table": "webhook_delivery_log" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "user_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "account_user_id_idx", + "entityType": "indexes", + "schema": "public", + "table": "account" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "project_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "api_key_project_id_idx", + "entityType": "indexes", + "schema": "public", + "table": "api_key" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "created_by", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "api_key_created_by_idx", + "entityType": "indexes", + "schema": "public", + "table": "api_key" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "api_key_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "hour_timestamp", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "api_key_hourly_model_stats_api_key_id_hour_timestamp_idx", + "entityType": "indexes", + "schema": "public", + "table": "api_key_hourly_model_stats" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "project_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "hour_timestamp", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "api_key_hourly_model_stats_project_id_hour_timestamp_idx", + "entityType": "indexes", + "schema": "public", + "table": "api_key_hourly_model_stats" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "hour_timestamp", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "api_key_hourly_model_stats_hour_timestamp_idx", + "entityType": "indexes", + "schema": "public", + "table": "api_key_hourly_model_stats" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "api_key_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "hour_timestamp", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "api_key_hourly_stats_api_key_id_hour_timestamp_idx", + "entityType": "indexes", + "schema": "public", + "table": "api_key_hourly_stats" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "project_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "hour_timestamp", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "api_key_hourly_stats_project_id_hour_timestamp_idx", + "entityType": "indexes", + "schema": "public", + "table": "api_key_hourly_stats" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "hour_timestamp", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "api_key_hourly_stats_hour_timestamp_idx", + "entityType": "indexes", + "schema": "public", + "table": "api_key_hourly_stats" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "api_key_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "api_key_iam_rule_api_key_id_idx", + "entityType": "indexes", + "schema": "public", + "table": "api_key_iam_rule" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "rule_type", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "api_key_iam_rule_rule_type_idx", + "entityType": "indexes", + "schema": "public", + "table": "api_key_iam_rule" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "api_key_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "status", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "api_key_iam_rule_api_key_id_status_idx", + "entityType": "indexes", + "schema": "public", + "table": "api_key_iam_rule" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "organization_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "created_at", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "audit_log_organization_id_created_at_idx", + "entityType": "indexes", + "schema": "public", + "table": "audit_log" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "user_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "audit_log_user_id_idx", + "entityType": "indexes", + "schema": "public", + "table": "audit_log" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "action", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "audit_log_action_idx", + "entityType": "indexes", + "schema": "public", + "table": "audit_log" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "resource_type", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "audit_log_resource_type_idx", + "entityType": "indexes", + "schema": "public", + "table": "audit_log" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "user_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "chat_user_id_idx", + "entityType": "indexes", + "schema": "public", + "table": "chat" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "created_at", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "chat_support_conversation_created_at_idx", + "entityType": "indexes", + "schema": "public", + "table": "chat_support_conversation" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "conversation_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "chat_support_message_conversation_id_idx", + "entityType": "indexes", + "schema": "public", + "table": "chat_support_message" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "conversation_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "admin_user_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "chat_support_read_status_conv_admin_idx", + "entityType": "indexes", + "schema": "public", + "table": "chat_support_read_status" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "organization_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "discount_organization_id_idx", + "entityType": "indexes", + "schema": "public", + "table": "discount" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "provider", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "discount_provider_idx", + "entityType": "indexes", + "schema": "public", + "table": "discount" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "model", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "discount_model_idx", + "entityType": "indexes", + "schema": "public", + "table": "discount" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "created_at", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "enterprise_contact_submission_created_at_idx", + "entityType": "indexes", + "schema": "public", + "table": "enterprise_contact_submission" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "email", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "enterprise_contact_submission_email_idx", + "entityType": "indexes", + "schema": "public", + "table": "enterprise_contact_submission" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "spam_filter_status", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "enterprise_contact_submission_status_idx", + "entityType": "indexes", + "schema": "public", + "table": "enterprise_contact_submission" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "organization_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "follow_up_email_organization_id_idx", + "entityType": "indexes", + "schema": "public", + "table": "follow_up_email" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "day_timestamp", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "global_daily_model_stats_day_timestamp_idx", + "entityType": "indexes", + "schema": "public", + "table": "global_daily_model_stats" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "used_model", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "day_timestamp", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "global_daily_model_stats_used_model_day_timestamp_idx", + "entityType": "indexes", + "schema": "public", + "table": "global_daily_model_stats" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "used_provider", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "used_model", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "day_timestamp", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "global_daily_model_stats_p_m_time_idx", + "entityType": "indexes", + "schema": "public", + "table": "global_daily_model_stats" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "day_timestamp", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "global_daily_source_stats_day_timestamp_idx", + "entityType": "indexes", + "schema": "public", + "table": "global_daily_source_stats" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "source", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "day_timestamp", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "global_daily_source_stats_source_day_timestamp_idx", + "entityType": "indexes", + "schema": "public", + "table": "global_daily_source_stats" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "organization_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "guardrail_config_organization_id_idx", + "entityType": "indexes", + "schema": "public", + "table": "guardrail_config" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "organization_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "guardrail_rule_organization_id_idx", + "entityType": "indexes", + "schema": "public", + "table": "guardrail_rule" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "priority", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "guardrail_rule_priority_idx", + "entityType": "indexes", + "schema": "public", + "table": "guardrail_rule" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "organization_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "created_at", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "guardrail_violation_org_created_idx", + "entityType": "indexes", + "schema": "public", + "table": "guardrail_violation" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "rule_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "created_at", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "guardrail_violation_rule_created_idx", + "entityType": "indexes", + "schema": "public", + "table": "guardrail_violation" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "project_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "created_at", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "log_project_id_created_at_idx", + "entityType": "indexes", + "schema": "public", + "table": "log" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "request_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "log_request_id_idx", + "entityType": "indexes", + "schema": "public", + "table": "log" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "created_at", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "used_model", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "used_provider", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "log_created_at_used_model_used_provider_idx", + "entityType": "indexes", + "schema": "public", + "table": "log" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "created_at", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": "data_retention_cleaned_up = false", + "with": "", + "method": "btree", + "concurrently": false, + "name": "log_data_retention_pending_idx", + "entityType": "indexes", + "schema": "public", + "table": "log" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "project_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "used_model", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "log_project_id_used_model_idx", + "entityType": "indexes", + "schema": "public", + "table": "log" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "created_at", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": "processed_at IS NULL", + "with": "", + "method": "btree", + "concurrently": false, + "name": "log_processed_at_null_idx", + "entityType": "indexes", + "schema": "public", + "table": "log" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "chat_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "message_chat_id_idx", + "entityType": "indexes", + "schema": "public", + "table": "message" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "status", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "model_status_idx", + "entityType": "indexes", + "schema": "public", + "table": "model" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "minute_timestamp", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "model_history_minute_timestamp_idx", + "entityType": "indexes", + "schema": "public", + "table": "model_history" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "model_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "minute_timestamp", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "model_history_model_id_minute_timestamp_idx", + "entityType": "indexes", + "schema": "public", + "table": "model_history" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "status", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "model_provider_mapping_status_idx", + "entityType": "indexes", + "schema": "public", + "table": "model_provider_mapping" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "minute_timestamp", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "model_provider_mapping_history_minute_timestamp_idx", + "entityType": "indexes", + "schema": "public", + "table": "model_provider_mapping_history" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "minute_timestamp", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "provider_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "model_provider_mapping_history_minute_timestamp_provider_id_idx", + "entityType": "indexes", + "schema": "public", + "table": "model_provider_mapping_history" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "minute_timestamp", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "model_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "model_provider_mapping_history_minute_timestamp_model_id_idx", + "entityType": "indexes", + "schema": "public", + "table": "model_provider_mapping_history" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "model_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "minute_timestamp", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "model_provider_mapping_history_model_id_minute_timestamp_idx", + "entityType": "indexes", + "schema": "public", + "table": "model_provider_mapping_history" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "provider_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "model_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "minute_timestamp", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "model_provider_mapping_history_id_ts_idx", + "entityType": "indexes", + "schema": "public", + "table": "model_provider_mapping_history" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "organization_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "organization_action_organization_id_idx", + "entityType": "indexes", + "schema": "public", + "table": "organization_action" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "user_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "passkey_user_id_idx", + "entityType": "indexes", + "schema": "public", + "table": "passkey" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "organization_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "payment_failure_organization_id_idx", + "entityType": "indexes", + "schema": "public", + "table": "payment_failure" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "created_at", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "payment_failure_created_at_idx", + "entityType": "indexes", + "schema": "public", + "table": "payment_failure" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "decline_code", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "payment_failure_decline_code_idx", + "entityType": "indexes", + "schema": "public", + "table": "payment_failure" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "organization_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "payment_method_organization_id_idx", + "entityType": "indexes", + "schema": "public", + "table": "payment_method" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "organization_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "project_organization_id_idx", + "entityType": "indexes", + "schema": "public", + "table": "project" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "project_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "hour_timestamp", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "project_hourly_model_stats_project_id_hour_timestamp_idx", + "entityType": "indexes", + "schema": "public", + "table": "project_hourly_model_stats" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "hour_timestamp", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "project_hourly_model_stats_hour_timestamp_idx", + "entityType": "indexes", + "schema": "public", + "table": "project_hourly_model_stats" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "used_model", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "hour_timestamp", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "project_hourly_model_stats_used_model_hour_timestamp_idx", + "entityType": "indexes", + "schema": "public", + "table": "project_hourly_model_stats" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "used_provider", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "used_model", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "hour_timestamp", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "project_hourly_model_stats_p_m_time_idx", + "entityType": "indexes", + "schema": "public", + "table": "project_hourly_model_stats" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "hour_timestamp", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "project_hourly_stats_hour_timestamp_idx", + "entityType": "indexes", + "schema": "public", + "table": "project_hourly_stats" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "status", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "provider_status_idx", + "entityType": "indexes", + "schema": "public", + "table": "provider" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "organization_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "provider_key_organization_id_idx", + "entityType": "indexes", + "schema": "public", + "table": "provider_key" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "coalesce(\"organization_id\", '__global__')", + "isExpression": true, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "coalesce(\"provider\", '__all_providers__')", + "isExpression": true, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "coalesce(\"model\", '__all_models__')", + "isExpression": true, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "rate_limit_org_provider_model_unique", + "entityType": "indexes", + "schema": "public", + "table": "rate_limit" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "organization_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "rate_limit_organization_id_idx", + "entityType": "indexes", + "schema": "public", + "table": "rate_limit" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "provider", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "rate_limit_provider_idx", + "entityType": "indexes", + "schema": "public", + "table": "rate_limit" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "model", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "rate_limit_model_idx", + "entityType": "indexes", + "schema": "public", + "table": "rate_limit" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "referrer_organization_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "referral_referrer_organization_id_idx", + "entityType": "indexes", + "schema": "public", + "table": "referral" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "referred_organization_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "referral_referred_organization_id_idx", + "entityType": "indexes", + "schema": "public", + "table": "referral" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "user_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "session_user_id_idx", + "entityType": "indexes", + "schema": "public", + "table": "session" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "organization_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "transaction_organization_id_idx", + "entityType": "indexes", + "schema": "public", + "table": "transaction" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "user_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "user_organization_user_id_idx", + "entityType": "indexes", + "schema": "public", + "table": "user_organization" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "organization_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "user_organization_organization_id_idx", + "entityType": "indexes", + "schema": "public", + "table": "user_organization" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "project_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "created_at", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "video_job_project_id_created_at_idx", + "entityType": "indexes", + "schema": "public", + "table": "video_job" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "status", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "next_poll_at", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "video_job_status_next_poll_at_idx", + "entityType": "indexes", + "schema": "public", + "table": "video_job" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "upstream_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "video_job_upstream_id_idx", + "entityType": "indexes", + "schema": "public", + "table": "video_job" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "callback_status", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "video_job_callback_status_idx", + "entityType": "indexes", + "schema": "public", + "table": "video_job" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "video_job_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "webhook_delivery_log_video_job_id_idx", + "entityType": "indexes", + "schema": "public", + "table": "webhook_delivery_log" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "status", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "next_retry_at", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "webhook_delivery_log_status_next_retry_at_idx", + "entityType": "indexes", + "schema": "public", + "table": "webhook_delivery_log" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "account_user_id_user_id_fk", + "entityType": "fks", + "schema": "public", + "table": "account" + }, + { + "nameExplicit": false, + "columns": [ + "project_id" + ], + "schemaTo": "public", + "tableTo": "project", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "api_key_project_id_project_id_fk", + "entityType": "fks", + "schema": "public", + "table": "api_key" + }, + { + "nameExplicit": false, + "columns": [ + "created_by" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "api_key_created_by_user_id_fk", + "entityType": "fks", + "schema": "public", + "table": "api_key" + }, + { + "nameExplicit": false, + "columns": [ + "api_key_id" + ], + "schemaTo": "public", + "tableTo": "api_key", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "api_key_iam_rule_api_key_id_api_key_id_fk", + "entityType": "fks", + "schema": "public", + "table": "api_key_iam_rule" + }, + { + "nameExplicit": false, + "columns": [ + "organization_id" + ], + "schemaTo": "public", + "tableTo": "organization", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "audit_log_organization_id_organization_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "audit_log" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "audit_log_user_id_user_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "audit_log" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "chat_user_id_user_id_fk", + "entityType": "fks", + "schema": "public", + "table": "chat" + }, + { + "nameExplicit": false, + "columns": [ + "conversation_id" + ], + "schemaTo": "public", + "tableTo": "chat_support_conversation", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "chat_support_message_Wd0B6G0H0z05_fkey", + "entityType": "fks", + "schema": "public", + "table": "chat_support_message" + }, + { + "nameExplicit": false, + "columns": [ + "conversation_id" + ], + "schemaTo": "public", + "tableTo": "chat_support_conversation", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "chat_support_read_status_oDVimXRR0BL9_fkey", + "entityType": "fks", + "schema": "public", + "table": "chat_support_read_status" + }, + { + "nameExplicit": false, + "columns": [ + "admin_user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "chat_support_read_status_admin_user_id_user_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "chat_support_read_status" + }, + { + "nameExplicit": false, + "columns": [ + "organization_id" + ], + "schemaTo": "public", + "tableTo": "organization", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "discount_organization_id_organization_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "discount" + }, + { + "nameExplicit": false, + "columns": [ + "organization_id" + ], + "schemaTo": "public", + "tableTo": "organization", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "follow_up_email_organization_id_organization_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "follow_up_email" + }, + { + "nameExplicit": false, + "columns": [ + "organization_id" + ], + "schemaTo": "public", + "tableTo": "organization", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "guardrail_config_organization_id_organization_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "guardrail_config" + }, + { + "nameExplicit": false, + "columns": [ + "organization_id" + ], + "schemaTo": "public", + "tableTo": "organization", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "guardrail_rule_organization_id_organization_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "guardrail_rule" + }, + { + "nameExplicit": false, + "columns": [ + "organization_id" + ], + "schemaTo": "public", + "tableTo": "organization", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "guardrail_violation_organization_id_organization_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "guardrail_violation" + }, + { + "nameExplicit": false, + "columns": [ + "chat_id" + ], + "schemaTo": "public", + "tableTo": "chat", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "message_chat_id_chat_id_fk", + "entityType": "fks", + "schema": "public", + "table": "message" + }, + { + "nameExplicit": false, + "columns": [ + "model_id" + ], + "schemaTo": "public", + "tableTo": "model", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "model_provider_mapping_model_id_model_id_fk", + "entityType": "fks", + "schema": "public", + "table": "model_provider_mapping" + }, + { + "nameExplicit": false, + "columns": [ + "provider_id" + ], + "schemaTo": "public", + "tableTo": "provider", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "model_provider_mapping_provider_id_provider_id_fk", + "entityType": "fks", + "schema": "public", + "table": "model_provider_mapping" + }, + { + "nameExplicit": false, + "columns": [ + "organization_id" + ], + "schemaTo": "public", + "tableTo": "organization", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "organization_action_organization_id_organization_id_fk", + "entityType": "fks", + "schema": "public", + "table": "organization_action" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "passkey_user_id_user_id_fk", + "entityType": "fks", + "schema": "public", + "table": "passkey" + }, + { + "nameExplicit": false, + "columns": [ + "organization_id" + ], + "schemaTo": "public", + "tableTo": "organization", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "payment_failure_organization_id_organization_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "payment_failure" + }, + { + "nameExplicit": false, + "columns": [ + "organization_id" + ], + "schemaTo": "public", + "tableTo": "organization", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "payment_method_organization_id_organization_id_fk", + "entityType": "fks", + "schema": "public", + "table": "payment_method" + }, + { + "nameExplicit": false, + "columns": [ + "organization_id" + ], + "schemaTo": "public", + "tableTo": "organization", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "project_organization_id_organization_id_fk", + "entityType": "fks", + "schema": "public", + "table": "project" + }, + { + "nameExplicit": false, + "columns": [ + "organization_id" + ], + "schemaTo": "public", + "tableTo": "organization", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "provider_key_organization_id_organization_id_fk", + "entityType": "fks", + "schema": "public", + "table": "provider_key" + }, + { + "nameExplicit": false, + "columns": [ + "organization_id" + ], + "schemaTo": "public", + "tableTo": "organization", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "rate_limit_organization_id_organization_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "rate_limit" + }, + { + "nameExplicit": false, + "columns": [ + "referrer_organization_id" + ], + "schemaTo": "public", + "tableTo": "organization", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "referral_referrer_organization_id_organization_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "referral" + }, + { + "nameExplicit": false, + "columns": [ + "referred_organization_id" + ], + "schemaTo": "public", + "tableTo": "organization", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "referral_referred_organization_id_organization_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "referral" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "session_user_id_user_id_fk", + "entityType": "fks", + "schema": "public", + "table": "session" + }, + { + "nameExplicit": false, + "columns": [ + "organization_id" + ], + "schemaTo": "public", + "tableTo": "organization", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "transaction_organization_id_organization_id_fk", + "entityType": "fks", + "schema": "public", + "table": "transaction" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "user_organization_user_id_user_id_fk", + "entityType": "fks", + "schema": "public", + "table": "user_organization" + }, + { + "nameExplicit": false, + "columns": [ + "organization_id" + ], + "schemaTo": "public", + "tableTo": "organization", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "user_organization_organization_id_organization_id_fk", + "entityType": "fks", + "schema": "public", + "table": "user_organization" + }, + { + "nameExplicit": false, + "columns": [ + "organization_id" + ], + "schemaTo": "public", + "tableTo": "organization", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "video_job_organization_id_organization_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "video_job" + }, + { + "nameExplicit": false, + "columns": [ + "project_id" + ], + "schemaTo": "public", + "tableTo": "project", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "video_job_project_id_project_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "video_job" + }, + { + "nameExplicit": false, + "columns": [ + "api_key_id" + ], + "schemaTo": "public", + "tableTo": "api_key", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "video_job_api_key_id_api_key_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "video_job" + }, + { + "nameExplicit": false, + "columns": [ + "video_job_id" + ], + "schemaTo": "public", + "tableTo": "video_job", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "webhook_delivery_log_video_job_id_video_job_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "webhook_delivery_log" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "account_pkey", + "schema": "public", + "table": "account", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "api_key_pkey", + "schema": "public", + "table": "api_key", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "api_key_hourly_model_stats_pkey", + "schema": "public", + "table": "api_key_hourly_model_stats", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "api_key_hourly_stats_pkey", + "schema": "public", + "table": "api_key_hourly_stats", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "api_key_iam_rule_pkey", + "schema": "public", + "table": "api_key_iam_rule", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "audit_log_pkey", + "schema": "public", + "table": "audit_log", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "chat_pkey", + "schema": "public", + "table": "chat", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "chat_support_conversation_pkey", + "schema": "public", + "table": "chat_support_conversation", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "chat_support_message_pkey", + "schema": "public", + "table": "chat_support_message", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "chat_support_read_status_pkey", + "schema": "public", + "table": "chat_support_read_status", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "discount_pkey", + "schema": "public", + "table": "discount", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "enterprise_contact_submission_pkey", + "schema": "public", + "table": "enterprise_contact_submission", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "follow_up_email_pkey", + "schema": "public", + "table": "follow_up_email", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "global_daily_aggregation_state_pkey", + "schema": "public", + "table": "global_daily_aggregation_state", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "global_daily_model_stats_pkey", + "schema": "public", + "table": "global_daily_model_stats", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "global_daily_source_stats_pkey", + "schema": "public", + "table": "global_daily_source_stats", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "guardrail_config_pkey", + "schema": "public", + "table": "guardrail_config", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "guardrail_rule_pkey", + "schema": "public", + "table": "guardrail_rule", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "guardrail_violation_pkey", + "schema": "public", + "table": "guardrail_violation", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "installation_pkey", + "schema": "public", + "table": "installation", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "lock_pkey", + "schema": "public", + "table": "lock", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "log_pkey", + "schema": "public", + "table": "log", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "message_pkey", + "schema": "public", + "table": "message", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "model_pkey", + "schema": "public", + "table": "model", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "model_history_pkey", + "schema": "public", + "table": "model_history", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "model_provider_mapping_pkey", + "schema": "public", + "table": "model_provider_mapping", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "model_provider_mapping_history_pkey", + "schema": "public", + "table": "model_provider_mapping_history", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "organization_pkey", + "schema": "public", + "table": "organization", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "organization_action_pkey", + "schema": "public", + "table": "organization_action", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "passkey_pkey", + "schema": "public", + "table": "passkey", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "payment_failure_pkey", + "schema": "public", + "table": "payment_failure", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "payment_method_pkey", + "schema": "public", + "table": "payment_method", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "project_pkey", + "schema": "public", + "table": "project", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "project_hourly_model_stats_pkey", + "schema": "public", + "table": "project_hourly_model_stats", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "project_hourly_stats_pkey", + "schema": "public", + "table": "project_hourly_stats", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "provider_pkey", + "schema": "public", + "table": "provider", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "provider_key_pkey", + "schema": "public", + "table": "provider_key", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "rate_limit_pkey", + "schema": "public", + "table": "rate_limit", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "referral_pkey", + "schema": "public", + "table": "referral", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "session_pkey", + "schema": "public", + "table": "session", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "transaction_pkey", + "schema": "public", + "table": "transaction", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "user_pkey", + "schema": "public", + "table": "user", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "user_organization_pkey", + "schema": "public", + "table": "user_organization", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "verification_pkey", + "schema": "public", + "table": "verification", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "video_job_pkey", + "schema": "public", + "table": "video_job", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "webhook_delivery_log_pkey", + "schema": "public", + "table": "webhook_delivery_log", + "entityType": "pks" + }, + { + "nameExplicit": false, + "columns": [ + "api_key_id", + "hour_timestamp", + "used_model", + "used_provider" + ], + "nullsNotDistinct": false, + "name": "api_key_hourly_model_stats_api_key_id_hour_timestamp_used_model_used_provider_unique", + "entityType": "uniques", + "schema": "public", + "table": "api_key_hourly_model_stats" + }, + { + "nameExplicit": false, + "columns": [ + "api_key_id", + "hour_timestamp" + ], + "nullsNotDistinct": false, + "name": "api_key_hourly_stats_api_key_id_hour_timestamp_unique", + "entityType": "uniques", + "schema": "public", + "table": "api_key_hourly_stats" + }, + { + "nameExplicit": true, + "columns": [ + "organization_id", + "provider", + "model" + ], + "nullsNotDistinct": false, + "name": "discount_org_provider_model_unique", + "entityType": "uniques", + "schema": "public", + "table": "discount" + }, + { + "nameExplicit": false, + "columns": [ + "organization_id", + "email_type" + ], + "nullsNotDistinct": false, + "name": "follow_up_email_organization_id_email_type_unique", + "entityType": "uniques", + "schema": "public", + "table": "follow_up_email" + }, + { + "nameExplicit": false, + "columns": [ + "day_timestamp", + "used_model", + "used_provider" + ], + "nullsNotDistinct": false, + "name": "global_daily_model_stats_day_timestamp_used_model_used_provider_unique", + "entityType": "uniques", + "schema": "public", + "table": "global_daily_model_stats" + }, + { + "nameExplicit": false, + "columns": [ + "day_timestamp", + "source" + ], + "nullsNotDistinct": false, + "name": "global_daily_source_stats_day_timestamp_source_unique", + "entityType": "uniques", + "schema": "public", + "table": "global_daily_source_stats" + }, + { + "nameExplicit": false, + "columns": [ + "model_id", + "minute_timestamp" + ], + "nullsNotDistinct": false, + "name": "model_history_model_id_minute_timestamp_unique", + "entityType": "uniques", + "schema": "public", + "table": "model_history" + }, + { + "nameExplicit": false, + "columns": [ + "model_id", + "provider_id", + "region" + ], + "nullsNotDistinct": false, + "name": "model_provider_mapping_model_id_provider_id_region_unique", + "entityType": "uniques", + "schema": "public", + "table": "model_provider_mapping" + }, + { + "nameExplicit": false, + "columns": [ + "model_provider_mapping_id", + "minute_timestamp" + ], + "nullsNotDistinct": false, + "name": "model_provider_mapping_history_model_provider_mapping_id_minute_timestamp_unique", + "entityType": "uniques", + "schema": "public", + "table": "model_provider_mapping_history" + }, + { + "nameExplicit": true, + "columns": [ + "stripe_payment_intent_id" + ], + "nullsNotDistinct": false, + "name": "payment_failure_stripe_pi_idx", + "entityType": "uniques", + "schema": "public", + "table": "payment_failure" + }, + { + "nameExplicit": false, + "columns": [ + "project_id", + "hour_timestamp", + "used_model", + "used_provider" + ], + "nullsNotDistinct": false, + "name": "project_hourly_model_stats_project_id_hour_timestamp_used_model_used_provider_unique", + "entityType": "uniques", + "schema": "public", + "table": "project_hourly_model_stats" + }, + { + "nameExplicit": false, + "columns": [ + "project_id", + "hour_timestamp" + ], + "nullsNotDistinct": false, + "name": "project_hourly_stats_project_id_hour_timestamp_unique", + "entityType": "uniques", + "schema": "public", + "table": "project_hourly_stats" + }, + { + "nameExplicit": false, + "columns": [ + "organization_id", + "name" + ], + "nullsNotDistinct": false, + "name": "provider_key_organization_id_name_unique", + "entityType": "uniques", + "schema": "public", + "table": "provider_key" + }, + { + "nameExplicit": false, + "columns": [ + "token" + ], + "nullsNotDistinct": false, + "name": "api_key_token_unique", + "schema": "public", + "table": "api_key", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "organization_id" + ], + "nullsNotDistinct": false, + "name": "guardrail_config_organization_id_key", + "schema": "public", + "table": "guardrail_config", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "uuid" + ], + "nullsNotDistinct": false, + "name": "installation_uuid_unique", + "schema": "public", + "table": "installation", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "key" + ], + "nullsNotDistinct": false, + "name": "lock_key_unique", + "schema": "public", + "table": "lock", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "stripe_customer_id" + ], + "nullsNotDistinct": false, + "name": "organization_stripe_customer_id_key", + "schema": "public", + "table": "organization", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "stripe_subscription_id" + ], + "nullsNotDistinct": false, + "name": "organization_stripe_subscription_id_key", + "schema": "public", + "table": "organization", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "dev_plan_stripe_subscription_id" + ], + "nullsNotDistinct": false, + "name": "organization_dev_plan_stripe_subscription_id_key", + "schema": "public", + "table": "organization", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "referred_organization_id" + ], + "nullsNotDistinct": false, + "name": "referral_referred_organization_id_key", + "schema": "public", + "table": "referral", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "token" + ], + "nullsNotDistinct": false, + "name": "session_token_unique", + "schema": "public", + "table": "session", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "email" + ], + "nullsNotDistinct": false, + "name": "user_email_unique", + "schema": "public", + "table": "user", + "entityType": "uniques" + } + ], + "renames": [] +} \ No newline at end of file diff --git a/packages/db/migrations/meta/_journal.json b/packages/db/migrations/meta/_journal.json index 85cb4d95f5..43655b3ba7 100644 --- a/packages/db/migrations/meta/_journal.json +++ b/packages/db/migrations/meta/_journal.json @@ -862,6 +862,13 @@ "when": 1778152537113, "tag": "1778152537_sudden_blue_marvel", "breakpoints": true + }, + { + "idx": 123, + "version": "8", + "when": 1778164250982, + "tag": "1778164250_fresh_blazing_skull", + "breakpoints": true } ] } \ No newline at end of file diff --git a/packages/db/src/schema.ts b/packages/db/src/schema.ts index 14c03f7b67..750b6830c8 100644 --- a/packages/db/src/schema.ts +++ b/packages/db/src/schema.ts @@ -2084,3 +2084,20 @@ export const globalDailySourceStats = pgTable( ), ], ); + +// Singleton state row for the hourly incremental global-daily aggregator. +// `lastProcessedHour` is the last UTC hour that has been folded into the +// global daily stats. `lastSafetyNetDay` is the most recent UTC day that +// has been fully recomputed by the daily safety-net pass. +export const globalDailyAggregationState = pgTable( + "global_daily_aggregation_state", + { + id: text().primaryKey().notNull().default("singleton"), + lastProcessedHour: timestamp(), + lastSafetyNetDay: timestamp(), + updatedAt: timestamp() + .notNull() + .defaultNow() + .$onUpdate(() => new Date()), + }, +); From 7b5503c1217897e2a823f5f833d55bf0f974b2e0 Mon Sep 17 00:00:00 2001 From: Luca Steeb Date: Thu, 7 May 2026 22:01:49 +0700 Subject: [PATCH 03/25] feat(admin): global daily stats page Adds GET /admin/global-daily-stats with range (7d|30d|90d|365d) and groupBy (model|source) query params, returning totals + per-day timeseries + per-key breakdown summed from the new globalDailyModelStats / globalDailySourceStats tables. Adds an admin UI page at /global-daily-stats with: - range + groupBy selectors - 4 stat cards (requests, cost, tokens, distinct keys) - daily line chart with metric toggle (cost / requests / tokens) - pie chart of cost share (top 10 + Other) plus a top-25 table Co-Authored-By: Claude Opus 4.7 --- apps/api/src/routes/admin.ts | 265 +++++++++ .../src/app/global-daily-stats/client.tsx | 522 ++++++++++++++++++ ee/admin/src/app/global-daily-stats/page.tsx | 8 + ee/admin/src/components/admin-shell.tsx | 10 + ee/admin/src/lib/api/v1.d.ts | 85 +++ 5 files changed, 890 insertions(+) create mode 100644 ee/admin/src/app/global-daily-stats/client.tsx create mode 100644 ee/admin/src/app/global-daily-stats/page.tsx diff --git a/apps/api/src/routes/admin.ts b/apps/api/src/routes/admin.ts index f1a0cba8ca..32d0e702f0 100644 --- a/apps/api/src/routes/admin.ts +++ b/apps/api/src/routes/admin.ts @@ -23,6 +23,8 @@ import { tables, projectHourlyStats, projectHourlyModelStats, + globalDailyModelStats, + globalDailySourceStats, modelProviderMappingHistory, modelHistory, } from "@llmgateway/db"; @@ -805,6 +807,269 @@ admin.openapi(getTimeseries, async (c) => { }); }); +const globalDailyStatsRangeSchema = z.enum(["7d", "30d", "90d", "365d"]); +const globalDailyStatsGroupBySchema = z.enum(["model", "source"]); + +const globalDailyStatsMetricsSchema = z.object({ + requestCount: z.number(), + errorCount: z.number(), + cacheCount: z.number(), + inputTokens: z.number(), + cachedTokens: z.number(), + outputTokens: z.number(), + totalTokens: z.number(), + cost: z.number(), + inputCost: z.number(), + cachedInputCost: z.number(), + outputCost: z.number(), +}); + +const globalDailyStatsTimeseriesPointSchema = globalDailyStatsMetricsSchema + .extend({ + date: z.string(), + }) + .openapi({}); + +const globalDailyStatsBreakdownItemSchema = globalDailyStatsMetricsSchema + .extend({ + key: z.string(), + label: z.string(), + }) + .openapi({}); + +const globalDailyStatsResponseSchema = z.object({ + range: globalDailyStatsRangeSchema, + groupBy: globalDailyStatsGroupBySchema, + totals: globalDailyStatsMetricsSchema, + timeseries: z.array(globalDailyStatsTimeseriesPointSchema), + breakdown: z.array(globalDailyStatsBreakdownItemSchema), +}); + +const getGlobalDailyStats = createRoute({ + method: "get", + path: "/global-daily-stats", + request: { + query: z.object({ + range: globalDailyStatsRangeSchema.default("30d").optional(), + groupBy: globalDailyStatsGroupBySchema.default("model").optional(), + }), + }, + responses: { + 200: { + content: { + "application/json": { + schema: globalDailyStatsResponseSchema.openapi({}), + }, + }, + description: + "Global daily aggregated stats grouped by model or x-source.", + }, + }, +}); + +admin.openapi(getGlobalDailyStats, async (c) => { + const query = c.req.valid("query"); + const range = query.range ?? "30d"; + const groupBy = query.groupBy ?? "model"; + + const rangeDays: Record = { + "7d": 7, + "30d": 30, + "90d": 90, + "365d": 365, + }; + const days = rangeDays[range]; + + const dayMs = 24 * 60 * 60 * 1000; + const startDate = new Date(); + startDate.setUTCHours(0, 0, 0, 0); + const startMs = startDate.getTime() - (days - 1) * dayMs; // eslint-disable-line no-mixed-operators + startDate.setTime(startMs); + + const sourceTable = + groupBy === "model" ? globalDailyModelStats : globalDailySourceStats; + + const metricSums = { + requestCount: + sql`COALESCE(SUM(${sourceTable.requestCount}), 0)::int`.as( + "requestCount", + ), + errorCount: + sql`COALESCE(SUM(${sourceTable.errorCount}), 0)::int`.as( + "errorCount", + ), + cacheCount: + sql`COALESCE(SUM(${sourceTable.cacheCount}), 0)::int`.as( + "cacheCount", + ), + inputTokens: + sql`COALESCE(SUM(CAST(${sourceTable.inputTokens} AS NUMERIC)), 0)::float8`.as( + "inputTokens", + ), + cachedTokens: + sql`COALESCE(SUM(CAST(${sourceTable.cachedTokens} AS NUMERIC)), 0)::float8`.as( + "cachedTokens", + ), + outputTokens: + sql`COALESCE(SUM(CAST(${sourceTable.outputTokens} AS NUMERIC)), 0)::float8`.as( + "outputTokens", + ), + totalTokens: + sql`COALESCE(SUM(CAST(${sourceTable.totalTokens} AS NUMERIC)), 0)::float8`.as( + "totalTokens", + ), + cost: sql`COALESCE(SUM(${sourceTable.cost}), 0)::float8`.as("cost"), + inputCost: + sql`COALESCE(SUM(${sourceTable.inputCost}), 0)::float8`.as( + "inputCost", + ), + cachedInputCost: + sql`COALESCE(SUM(${sourceTable.cachedInputCost}), 0)::float8`.as( + "cachedInputCost", + ), + outputCost: + sql`COALESCE(SUM(${sourceTable.outputCost}), 0)::float8`.as( + "outputCost", + ), + }; + + const dateExpr = + sql`to_char(${sourceTable.dayTimestamp}, 'YYYY-MM-DD')`.as("date"); + + const timeseriesRows = await db + .select({ + date: dateExpr, + ...metricSums, + }) + .from(sourceTable) + .where(gte(sourceTable.dayTimestamp, startDate)) + .groupBy(sourceTable.dayTimestamp) + .orderBy(asc(sourceTable.dayTimestamp)); + + const timeseriesMap = new Map< + string, + z.infer + >(); + for (const row of timeseriesRows) { + timeseriesMap.set(row.date, { + date: row.date, + requestCount: Number(row.requestCount), + errorCount: Number(row.errorCount), + cacheCount: Number(row.cacheCount), + inputTokens: Number(row.inputTokens), + cachedTokens: Number(row.cachedTokens), + outputTokens: Number(row.outputTokens), + totalTokens: Number(row.totalTokens), + cost: Number(row.cost), + inputCost: Number(row.inputCost), + cachedInputCost: Number(row.cachedInputCost), + outputCost: Number(row.outputCost), + }); + } + + const totals: z.infer = { + requestCount: 0, + errorCount: 0, + cacheCount: 0, + inputTokens: 0, + cachedTokens: 0, + outputTokens: 0, + totalTokens: 0, + cost: 0, + inputCost: 0, + cachedInputCost: 0, + outputCost: 0, + }; + + const timeseries: z.infer[] = + []; + for (let i = 0; i < days; i++) { + const cur = new Date(startDate.getTime() + i * dayMs); // eslint-disable-line no-mixed-operators + const dateStr = cur.toISOString().split("T")[0]; + const point = timeseriesMap.get(dateStr) ?? { + date: dateStr, + requestCount: 0, + errorCount: 0, + cacheCount: 0, + inputTokens: 0, + cachedTokens: 0, + outputTokens: 0, + totalTokens: 0, + cost: 0, + inputCost: 0, + cachedInputCost: 0, + outputCost: 0, + }; + timeseries.push(point); + totals.requestCount += point.requestCount; + totals.errorCount += point.errorCount; + totals.cacheCount += point.cacheCount; + totals.inputTokens += point.inputTokens; + totals.cachedTokens += point.cachedTokens; + totals.outputTokens += point.outputTokens; + totals.totalTokens += point.totalTokens; + totals.cost += point.cost; + totals.inputCost += point.inputCost; + totals.cachedInputCost += point.cachedInputCost; + totals.outputCost += point.outputCost; + } + + const breakdownRows = + groupBy === "model" + ? await db + .select({ + usedModel: globalDailyModelStats.usedModel, + usedProvider: globalDailyModelStats.usedProvider, + ...metricSums, + }) + .from(globalDailyModelStats) + .where(gte(globalDailyModelStats.dayTimestamp, startDate)) + .groupBy( + globalDailyModelStats.usedModel, + globalDailyModelStats.usedProvider, + ) + .orderBy(desc(metricSums.requestCount)) + : await db + .select({ + source: globalDailySourceStats.source, + ...metricSums, + }) + .from(globalDailySourceStats) + .where(gte(globalDailySourceStats.dayTimestamp, startDate)) + .groupBy(globalDailySourceStats.source) + .orderBy(desc(metricSums.requestCount)); + + const breakdown: z.infer[] = + breakdownRows.map((row) => { + const isModel = "usedModel" in row; + const key = isModel ? `${row.usedProvider}/${row.usedModel}` : row.source; + const label = isModel ? row.usedModel : row.source; + return { + key, + label, + requestCount: Number(row.requestCount), + errorCount: Number(row.errorCount), + cacheCount: Number(row.cacheCount), + inputTokens: Number(row.inputTokens), + cachedTokens: Number(row.cachedTokens), + outputTokens: Number(row.outputTokens), + totalTokens: Number(row.totalTokens), + cost: Number(row.cost), + inputCost: Number(row.inputCost), + cachedInputCost: Number(row.cachedInputCost), + outputCost: Number(row.outputCost), + }; + }); + + return c.json({ + range, + groupBy, + totals, + timeseries, + breakdown, + }); +}); + admin.openapi(getOrganizations, async (c) => { const query = c.req.valid("query"); const limit = query.limit ?? 50; diff --git a/ee/admin/src/app/global-daily-stats/client.tsx b/ee/admin/src/app/global-daily-stats/client.tsx new file mode 100644 index 0000000000..c20b9ece6f --- /dev/null +++ b/ee/admin/src/app/global-daily-stats/client.tsx @@ -0,0 +1,522 @@ +"use client"; + +import { format, parseISO } from "date-fns"; +import { BarChart3, Coins, Cpu, Layers } from "lucide-react"; +import { useMemo, useState } from "react"; +import { + CartesianGrid, + Cell, + Legend, + Line, + LineChart, + Pie, + PieChart, + XAxis, + YAxis, +} from "recharts"; + +import { Button } from "@/components/ui/button"; +import { + Card, + CardContent, + CardDescription, + CardHeader, + CardTitle, +} from "@/components/ui/card"; +import { + ChartContainer, + ChartTooltip, + ChartTooltipContent, +} from "@/components/ui/chart"; +import { useApi } from "@/lib/fetch-client"; +import { cn } from "@/lib/utils"; + +import type { ChartConfig } from "@/components/ui/chart"; + +type Range = "7d" | "30d" | "90d" | "365d"; +type GroupBy = "model" | "source"; + +const RANGE_OPTIONS: { value: Range; label: string }[] = [ + { value: "7d", label: "Last 7 days" }, + { value: "30d", label: "Last 30 days" }, + { value: "90d", label: "Last 90 days" }, + { value: "365d", label: "Last 365 days" }, +]; + +const GROUP_OPTIONS: { value: GroupBy; label: string; icon: typeof Cpu }[] = [ + { value: "model", label: "By model", icon: Cpu }, + { value: "source", label: "By x-source", icon: Layers }, +]; + +// Distinct, color-blind-friendly hues. Repeat for >12 series. +const PIE_COLORS = [ + "hsl(221 83% 53%)", + "hsl(142 71% 45%)", + "hsl(32 95% 44%)", + "hsl(280 65% 60%)", + "hsl(0 72% 51%)", + "hsl(189 94% 43%)", + "hsl(340 75% 55%)", + "hsl(48 96% 53%)", + "hsl(160 60% 45%)", + "hsl(258 76% 58%)", + "hsl(15 86% 55%)", + "hsl(200 60% 40%)", +]; + +const currencyFormatter = new Intl.NumberFormat("en-US", { + style: "currency", + currency: "USD", + maximumFractionDigits: 4, +}); + +const compactCurrencyFormatter = new Intl.NumberFormat("en-US", { + style: "currency", + currency: "USD", + notation: "compact", + compactDisplay: "short", + maximumFractionDigits: 2, +}); + +const numberFormatter = new Intl.NumberFormat("en-US", { + maximumFractionDigits: 0, +}); + +const compactNumberFormatter = new Intl.NumberFormat("en-US", { + notation: "compact", + compactDisplay: "short", + maximumFractionDigits: 1, +}); + +const timeseriesChartConfig = { + requestCount: { label: "Requests", color: "hsl(221 83% 53%)" }, + cost: { label: "Cost", color: "hsl(142 71% 45%)" }, + totalTokens: { label: "Total tokens", color: "hsl(32 95% 44%)" }, +} satisfies ChartConfig; + +type TimeseriesMetric = keyof typeof timeseriesChartConfig; + +function StatCard({ + label, + value, + subtitle, + icon, + accent, +}: { + label: string; + value: string; + subtitle?: string; + icon?: React.ReactNode; + accent?: "green" | "blue" | "purple" | "red" | "orange"; +}) { + return ( +
+
+
+

+ {label} +

+

{value}

+ {subtitle ? ( +

{subtitle}

+ ) : null} +
+ {icon ? ( +
+ {icon} +
+ ) : null} +
+
+ ); +} + +function metricFormatter(metric: TimeseriesMetric) { + switch (metric) { + case "cost": + return (v: number) => currencyFormatter.format(v); + case "totalTokens": + return (v: number) => numberFormatter.format(v); + case "requestCount": + default: + return (v: number) => numberFormatter.format(v); + } +} + +function compactMetricFormatter(metric: TimeseriesMetric) { + switch (metric) { + case "cost": + return (v: number) => compactCurrencyFormatter.format(v); + case "totalTokens": + case "requestCount": + default: + return (v: number) => compactNumberFormatter.format(v); + } +} + +export function GlobalDailyStatsClient() { + const [range, setRange] = useState("30d"); + const [groupBy, setGroupBy] = useState("model"); + const [chartMetric, setChartMetric] = useState("cost"); + + const $api = useApi(); + const { data, isLoading, isError } = $api.useQuery( + "get", + "/admin/global-daily-stats", + { + params: { query: { range, groupBy } }, + }, + ); + + const totals = data?.totals; + const timeseries = data?.timeseries ?? []; + const breakdown = data?.breakdown ?? []; + + // Pie data: top 10 by cost, the rest collapsed into "Other". + const pieData = useMemo(() => { + if (breakdown.length === 0) { + return [] as { name: string; value: number; key: string }[]; + } + const sortedByCost = [...breakdown].sort((a, b) => b.cost - a.cost); + const top = sortedByCost.slice(0, 10); + const rest = sortedByCost.slice(10); + const items = top.map((b) => ({ + name: b.label, + value: b.cost, + key: b.key, + })); + if (rest.length > 0) { + const otherCost = rest.reduce((sum, b) => sum + b.cost, 0); + if (otherCost > 0) { + items.push({ + name: `Other (${rest.length})`, + value: otherCost, + key: "__other__", + }); + } + } + return items; + }, [breakdown]); + + const pieChartConfig = useMemo(() => { + const config: ChartConfig = {}; + pieData.forEach((slice, idx) => { + config[slice.key] = { + label: slice.name, + color: PIE_COLORS[idx % PIE_COLORS.length], + }; + }); + return config; + }, [pieData]); + + const totalPieCost = pieData.reduce((sum, p) => sum + p.value, 0); + + return ( +
+
+
+

+ Global Daily Stats +

+

+ Cross-organization usage aggregated by day, grouped by model or + x-source header. +

+
+
+
+ {GROUP_OPTIONS.map((opt) => { + const Icon = opt.icon; + return ( + + ); + })} +
+
+ {RANGE_OPTIONS.map((opt) => ( + + ))} +
+
+
+ + {isError ? ( +
+ Failed to load stats. +
+ ) : null} + +
+ } + accent="blue" + /> + } + accent="green" + /> + } + accent="orange" + /> + + ) : ( + + ) + } + accent="purple" + /> +
+ + + +
+ Daily timeseries + + Aggregate{" "} + {chartMetric === "cost" + ? "cost" + : chartMetric === "totalTokens" + ? "total tokens" + : "request count"}{" "} + per day across all {groupBy === "model" ? "models" : "sources"}. + +
+
+ {(Object.keys(timeseriesChartConfig) as TimeseriesMetric[]).map( + (m) => ( + + ), + )} +
+
+ + {timeseries.length === 0 && !isLoading ? ( +
+ No data for this range. +
+ ) : ( + + + + { + const date = parseISO(value); + return format(date, "MMM d"); + }} + /> + + { + const date = parseISO(value); + return format(date, "MMM d, yyyy"); + }} + formatter={(value) => + metricFormatter(chartMetric)(Number(value)) + } + /> + } + /> + + + + )} +
+
+ + + + + Cost share — {groupBy === "model" ? "models" : "sources"} + + + {breakdown.length > 10 + ? `Top 10 + Other across the ${range} window.` + : `All ${breakdown.length} ${groupBy === "model" ? "models" : "sources"} in the ${range} window.`} + + + +
+ {pieData.length === 0 && !isLoading ? ( +
No data.
+ ) : ( + + + ( +
+ + {(item?.payload as { name?: string })?.name ?? ""} + + + {currencyFormatter.format(Number(value))} + {totalPieCost > 0 + ? ` · ${((Number(value) / totalPieCost) * 100).toFixed(1)}%` + : ""} + +
+ )} + /> + } + /> + + {pieData.map((slice, idx) => ( + + ))} + + +
+
+ )} +
+
+ + + + + + + + + + {breakdown.length === 0 ? ( + + + + ) : ( + breakdown.slice(0, 25).map((b) => ( + + + + + + )) + )} + +
+ {groupBy === "model" ? "Model" : "Source"} + RequestsCost
+ {isLoading ? "Loading…" : "No data."} +
{b.label} + {numberFormatter.format(b.requestCount)} + + {currencyFormatter.format(b.cost)} +
+
+
+
+
+ ); +} diff --git a/ee/admin/src/app/global-daily-stats/page.tsx b/ee/admin/src/app/global-daily-stats/page.tsx new file mode 100644 index 0000000000..46b62e67a4 --- /dev/null +++ b/ee/admin/src/app/global-daily-stats/page.tsx @@ -0,0 +1,8 @@ +import { requireSession } from "@/lib/require-session"; + +import { GlobalDailyStatsClient } from "./client"; + +export default async function Page() { + await requireSession(); + return ; +} diff --git a/ee/admin/src/components/admin-shell.tsx b/ee/admin/src/components/admin-shell.tsx index 46c011cf90..d6df0957af 100644 --- a/ee/admin/src/components/admin-shell.tsx +++ b/ee/admin/src/components/admin-shell.tsx @@ -3,6 +3,7 @@ import { useQueryClient } from "@tanstack/react-query"; import { AlertTriangle, + BarChart3, Building2, Cpu, Gauge, @@ -85,6 +86,7 @@ export function AdminShell({ children }: AdminShellProps) { const isDashboard = pathname === "/" || pathname === ""; const isOrganizations = pathname.startsWith("/organizations"); const isDevpass = pathname.startsWith("/devpass"); + const isGlobalDailyStats = pathname.startsWith("/global-daily-stats"); const isDiscounts = pathname === "/discounts"; const isRateLimits = pathname === "/rate-limits"; const isProviders = pathname === "/providers"; @@ -154,6 +156,14 @@ export function AdminShell({ children }: AdminShellProps) { + + + + + Global Daily Stats + + + diff --git a/ee/admin/src/lib/api/v1.d.ts b/ee/admin/src/lib/api/v1.d.ts index 24c4ad28e4..c4e41fe794 100644 --- a/ee/admin/src/lib/api/v1.d.ts +++ b/ee/admin/src/lib/api/v1.d.ts @@ -1495,6 +1495,91 @@ export interface paths { patch?: never; trace?: never; }; + "/admin/global-daily-stats": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get: { + parameters: { + query?: { + range?: "7d" | "30d" | "90d" | "365d"; + groupBy?: "model" | "source"; + }; + header?: never; + path?: never; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Global daily aggregated stats grouped by model or x-source. */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + /** @enum {string} */ + range: "7d" | "30d" | "90d" | "365d"; + /** @enum {string} */ + groupBy: "model" | "source"; + totals: { + requestCount: number; + errorCount: number; + cacheCount: number; + inputTokens: number; + cachedTokens: number; + outputTokens: number; + totalTokens: number; + cost: number; + inputCost: number; + cachedInputCost: number; + outputCost: number; + }; + timeseries: { + requestCount: number; + errorCount: number; + cacheCount: number; + inputTokens: number; + cachedTokens: number; + outputTokens: number; + totalTokens: number; + cost: number; + inputCost: number; + cachedInputCost: number; + outputCost: number; + date: string; + }[]; + breakdown: { + requestCount: number; + errorCount: number; + cacheCount: number; + inputTokens: number; + cachedTokens: number; + outputTokens: number; + totalTokens: number; + cost: number; + inputCost: number; + cachedInputCost: number; + outputCost: number; + key: string; + label: string; + }[]; + }; + }; + }; + }; + }; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; "/admin/organizations": { parameters: { query?: never; From 300447879c95d451f00d33c0b976535174a5103c Mon Sep 17 00:00:00 2001 From: "Luca Steeb (bot)" Date: Thu, 7 May 2026 15:10:17 +0000 Subject: [PATCH 04/25] chore(autofix): apply diff --- apps/code/src/lib/api/v1.d.ts | 85 +++++++++++++++++++++++++++++ apps/playground/src/lib/api/v1.d.ts | 85 +++++++++++++++++++++++++++++ apps/ui/src/lib/api/v1.d.ts | 85 +++++++++++++++++++++++++++++ 3 files changed, 255 insertions(+) diff --git a/apps/code/src/lib/api/v1.d.ts b/apps/code/src/lib/api/v1.d.ts index 24c4ad28e4..c4e41fe794 100644 --- a/apps/code/src/lib/api/v1.d.ts +++ b/apps/code/src/lib/api/v1.d.ts @@ -1495,6 +1495,91 @@ export interface paths { patch?: never; trace?: never; }; + "/admin/global-daily-stats": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get: { + parameters: { + query?: { + range?: "7d" | "30d" | "90d" | "365d"; + groupBy?: "model" | "source"; + }; + header?: never; + path?: never; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Global daily aggregated stats grouped by model or x-source. */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + /** @enum {string} */ + range: "7d" | "30d" | "90d" | "365d"; + /** @enum {string} */ + groupBy: "model" | "source"; + totals: { + requestCount: number; + errorCount: number; + cacheCount: number; + inputTokens: number; + cachedTokens: number; + outputTokens: number; + totalTokens: number; + cost: number; + inputCost: number; + cachedInputCost: number; + outputCost: number; + }; + timeseries: { + requestCount: number; + errorCount: number; + cacheCount: number; + inputTokens: number; + cachedTokens: number; + outputTokens: number; + totalTokens: number; + cost: number; + inputCost: number; + cachedInputCost: number; + outputCost: number; + date: string; + }[]; + breakdown: { + requestCount: number; + errorCount: number; + cacheCount: number; + inputTokens: number; + cachedTokens: number; + outputTokens: number; + totalTokens: number; + cost: number; + inputCost: number; + cachedInputCost: number; + outputCost: number; + key: string; + label: string; + }[]; + }; + }; + }; + }; + }; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; "/admin/organizations": { parameters: { query?: never; diff --git a/apps/playground/src/lib/api/v1.d.ts b/apps/playground/src/lib/api/v1.d.ts index 24c4ad28e4..c4e41fe794 100644 --- a/apps/playground/src/lib/api/v1.d.ts +++ b/apps/playground/src/lib/api/v1.d.ts @@ -1495,6 +1495,91 @@ export interface paths { patch?: never; trace?: never; }; + "/admin/global-daily-stats": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get: { + parameters: { + query?: { + range?: "7d" | "30d" | "90d" | "365d"; + groupBy?: "model" | "source"; + }; + header?: never; + path?: never; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Global daily aggregated stats grouped by model or x-source. */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + /** @enum {string} */ + range: "7d" | "30d" | "90d" | "365d"; + /** @enum {string} */ + groupBy: "model" | "source"; + totals: { + requestCount: number; + errorCount: number; + cacheCount: number; + inputTokens: number; + cachedTokens: number; + outputTokens: number; + totalTokens: number; + cost: number; + inputCost: number; + cachedInputCost: number; + outputCost: number; + }; + timeseries: { + requestCount: number; + errorCount: number; + cacheCount: number; + inputTokens: number; + cachedTokens: number; + outputTokens: number; + totalTokens: number; + cost: number; + inputCost: number; + cachedInputCost: number; + outputCost: number; + date: string; + }[]; + breakdown: { + requestCount: number; + errorCount: number; + cacheCount: number; + inputTokens: number; + cachedTokens: number; + outputTokens: number; + totalTokens: number; + cost: number; + inputCost: number; + cachedInputCost: number; + outputCost: number; + key: string; + label: string; + }[]; + }; + }; + }; + }; + }; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; "/admin/organizations": { parameters: { query?: never; diff --git a/apps/ui/src/lib/api/v1.d.ts b/apps/ui/src/lib/api/v1.d.ts index 24c4ad28e4..c4e41fe794 100644 --- a/apps/ui/src/lib/api/v1.d.ts +++ b/apps/ui/src/lib/api/v1.d.ts @@ -1495,6 +1495,91 @@ export interface paths { patch?: never; trace?: never; }; + "/admin/global-daily-stats": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get: { + parameters: { + query?: { + range?: "7d" | "30d" | "90d" | "365d"; + groupBy?: "model" | "source"; + }; + header?: never; + path?: never; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Global daily aggregated stats grouped by model or x-source. */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + /** @enum {string} */ + range: "7d" | "30d" | "90d" | "365d"; + /** @enum {string} */ + groupBy: "model" | "source"; + totals: { + requestCount: number; + errorCount: number; + cacheCount: number; + inputTokens: number; + cachedTokens: number; + outputTokens: number; + totalTokens: number; + cost: number; + inputCost: number; + cachedInputCost: number; + outputCost: number; + }; + timeseries: { + requestCount: number; + errorCount: number; + cacheCount: number; + inputTokens: number; + cachedTokens: number; + outputTokens: number; + totalTokens: number; + cost: number; + inputCost: number; + cachedInputCost: number; + outputCost: number; + date: string; + }[]; + breakdown: { + requestCount: number; + errorCount: number; + cacheCount: number; + inputTokens: number; + cachedTokens: number; + outputTokens: number; + totalTokens: number; + cost: number; + inputCost: number; + cachedInputCost: number; + outputCost: number; + key: string; + label: string; + }[]; + }; + }; + }; + }; + }; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; "/admin/organizations": { parameters: { query?: never; From 5cf713bc9b981ee160f114fa26cd1c6e9f6f25c5 Mon Sep 17 00:00:00 2001 From: amelitoalcuitas Date: Thu, 7 May 2026 19:08:57 +0800 Subject: [PATCH 05/25] feat: add product hunt badge (#2181) ## Summary by CodeRabbit * **New Features** * Added a centered Product Hunt call-to-action in the landing-page hero that opens the Product Hunt listing in a new tab. * CTA includes a dedicated Product Hunt icon alongside an arrow for clearer visual emphasis and improved click-through. * **Style** * CTA is styled as an amber, button-like link to stand out in the hero area. image --------- Co-authored-by: Ismail Ghallou --- apps/code/src/app/page.tsx | 17 +++++++++++++++++ apps/code/src/components/ProductHuntIcon.tsx | 16 ++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 apps/code/src/components/ProductHuntIcon.tsx diff --git a/apps/code/src/app/page.tsx b/apps/code/src/app/page.tsx index d0f4a0abb9..c5e22089f6 100644 --- a/apps/code/src/app/page.tsx +++ b/apps/code/src/app/page.tsx @@ -10,6 +10,7 @@ import { LandingPageTracker, } from "@/components/LandingTracker"; import { PricingPlans } from "@/components/PricingPlans"; +import { ProductHuntIcon } from "@/components/ProductHuntIcon"; import { SoulForgeBoost } from "@/components/SoulForgeBoost"; import { TerminalPreview } from "@/components/TerminalPreview"; import { Button } from "@/components/ui/button"; @@ -104,6 +105,22 @@ export default function LandingPage() { + + diff --git a/apps/code/src/components/ProductHuntIcon.tsx b/apps/code/src/components/ProductHuntIcon.tsx new file mode 100644 index 0000000000..2d935eece9 --- /dev/null +++ b/apps/code/src/components/ProductHuntIcon.tsx @@ -0,0 +1,16 @@ +export function ProductHuntIcon({ className }: { className?: string }) { + return ( + + ); +} From 456a97242ae229b77cc2e93c69846f41af5f90cb Mon Sep 17 00:00:00 2001 From: AYOUB BENDARSI <137005356+RATCHAW@users.noreply.github.com> Date: Thu, 7 May 2026 12:20:45 +0100 Subject: [PATCH 06/25] feat(minimax): enable tool calling on M2.7 models (#2180) --- packages/models/src/models/minimax.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/models/src/models/minimax.ts b/packages/models/src/models/minimax.ts index 93ff9d63ab..5c9c91c8ff 100644 --- a/packages/models/src/models/minimax.ts +++ b/packages/models/src/models/minimax.ts @@ -21,7 +21,7 @@ export const minimaxModels = [ reasoning: true, splitTaggedReasoning: true, vision: false, - tools: false, + tools: true, jsonOutput: false, }, { @@ -77,7 +77,7 @@ export const minimaxModels = [ reasoning: true, splitTaggedReasoning: true, vision: false, - tools: false, + tools: true, jsonOutput: false, }, ], From a4fb0a58c15e119007198fa529cab67410114c2c Mon Sep 17 00:00:00 2001 From: Luca Steeb Date: Thu, 7 May 2026 18:32:42 +0700 Subject: [PATCH 07/25] feat: delete resend contact when banning org (#2185) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Summary - When admins ban (status=deleted) an organization via the admin dashboard, also remove each member's Resend contact via the Resend API - Errors from Resend are logged but ignored, matching the existing `createResendContact` / `updateResendContact` pattern - Only fires on the deleted transition; re-enabling an org is unchanged ## Test plan - [ ] Ban an org via the admin UI and confirm members' contacts are removed from the configured Resend audience - [ ] Ban an org with `RESEND_API_KEY` unset and confirm the request still succeeds - [ ] Ban an org whose member email was already removed from Resend and confirm no failure (warning is logged) 🤖 Generated with [Claude Code](https://claude.com/claude-code) ## Summary by CodeRabbit ## Release Notes * **Chores** * Organization deletion now automatically removes associated member email contacts from the contact system. Co-authored-by: Claude Opus 4.7 --- apps/api/src/auth/config.ts | 31 +++++++++++++++++++++++++++++++ apps/api/src/routes/admin.ts | 12 ++++++++++++ 2 files changed, 43 insertions(+) diff --git a/apps/api/src/auth/config.ts b/apps/api/src/auth/config.ts index ae298f23c1..8bbf1daa0b 100644 --- a/apps/api/src/auth/config.ts +++ b/apps/api/src/auth/config.ts @@ -390,6 +390,37 @@ async function createResendContact( } } +export async function deleteResendContact(email: string): Promise { + const client = getResendClient(); + + if (!client) { + logger.debug("RESEND_API_KEY not configured, skipping contact deletion"); + return; + } + + try { + const { error } = await client.contacts.remove({ + audienceId: resendAudienceId, + email, + }); + + if (error) { + logger.warn("Resend API error during contact deletion", { + email, + errorMessage: error.message, + }); + return; + } + + logger.info("Successfully deleted Resend contact", { email }); + } catch (error) { + logger.error("Failed to delete Resend contact", { + ...(error instanceof Error ? { err: error } : { error }), + email, + }); + } +} + export async function updateResendContact( email: string, options?: { diff --git a/apps/api/src/routes/admin.ts b/apps/api/src/routes/admin.ts index 32d0e702f0..3cd66ffb70 100644 --- a/apps/api/src/routes/admin.ts +++ b/apps/api/src/routes/admin.ts @@ -2,6 +2,7 @@ import { createRoute, OpenAPIHono } from "@hono/zod-openapi"; import { HTTPException } from "hono/http-exception"; import { z } from "zod"; +import { deleteResendContact } from "@/auth/config.js"; import { adminMiddleware } from "@/middleware/admin.js"; import { logAuditEvent } from "@llmgateway/audit"; @@ -4492,6 +4493,17 @@ admin.openapi(setOrganizationStatusRoute, async (c) => { } }); + if (status === "deleted" && memberUserIds.length > 0) { + const members = await db.query.user.findMany({ + where: { id: { in: memberUserIds } }, + columns: { email: true }, + }); + + await Promise.all( + members.map((member) => deleteResendContact(member.email)), + ); + } + await logAuditEvent({ organizationId: orgId, userId: user!.id, From d7857a53fbf09015cd7d822851070518d57a1683 Mon Sep 17 00:00:00 2001 From: Luca Steeb Date: Thu, 7 May 2026 19:46:09 +0700 Subject: [PATCH 08/25] fix: surface devpass subscribe API error message (#2187) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Summary - The devpass subscribe flow swallowed the API error in `handleSubscribe`, so users always saw a generic "Failed to start subscription" toast — even when the API returned a clear, actionable message like "Email verification required". - The catch block now extracts `error.message` from the rejected mutation and surfaces it, falling back to the generic message only when no message is present. ## Test plan - [ ] Sign up for a new devpass account and, before verifying email, click subscribe — toast should now read "Email verification required". - [ ] Verify email and subscribe — flow should still redirect to Stripe Checkout as before. 🤖 Generated with [Claude Code](https://claude.com/claude-code) ## Summary by CodeRabbit * **Bug Fixes** * Improved error messaging for dev plan subscription failures by displaying specific API error details instead of generic notifications, providing users with clearer feedback when issues occur. Co-authored-by: Claude Opus 4.7 --- apps/code/src/app/dashboard/DashboardClient.tsx | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/apps/code/src/app/dashboard/DashboardClient.tsx b/apps/code/src/app/dashboard/DashboardClient.tsx index 83810fd36d..bc34d13172 100644 --- a/apps/code/src/app/dashboard/DashboardClient.tsx +++ b/apps/code/src/app/dashboard/DashboardClient.tsx @@ -240,8 +240,16 @@ export default function DashboardClient() { posthog.capture("dev_plan_subscribe_started", { tier, cycle }); } window.location.href = result.checkoutUrl; - } catch { - toast.error("Failed to start subscription"); + } catch (error: unknown) { + const apiMessage = + error && typeof error === "object" && "message" in error + ? (error as { message?: unknown }).message + : undefined; + toast.error( + typeof apiMessage === "string" && apiMessage.length > 0 + ? apiMessage + : "Failed to start subscription", + ); } finally { setSubscribingTier(null); } From b1d51169cc83eee3bae14cda7706aff0156c544d Mon Sep 17 00:00:00 2001 From: Luca Steeb Date: Thu, 7 May 2026 20:00:44 +0700 Subject: [PATCH 09/25] fix: redirect devpass cancel to /dashboard (#2190) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Summary - Stripe checkout cancel for devpass redirected to `/dashboard/plans?canceled=true`, which 404s. Point it at `/dashboard?canceled=true` on the same host instead. ## Test plan - [ ] Start a devpass checkout, cancel, verify the browser lands on `/dashboard?canceled=true` 🤖 Generated with [Claude Code](https://claude.com/claude-code) ## Summary by CodeRabbit * **Bug Fixes** * Updated subscription checkout cancellation to redirect to the main dashboard instead of the plans page. Co-authored-by: Claude Opus 4.7 --- apps/api/src/routes/dev-plans.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/api/src/routes/dev-plans.ts b/apps/api/src/routes/dev-plans.ts index 09a73202ef..2adc9a4c74 100644 --- a/apps/api/src/routes/dev-plans.ts +++ b/apps/api/src/routes/dev-plans.ts @@ -266,7 +266,7 @@ devPlans.openapi(subscribe, async (c) => { ], allow_promotion_codes: true, success_url: `${process.env.CODE_URL ?? "http://localhost:3004"}/dashboard?success=true`, - cancel_url: `${process.env.CODE_URL ?? "http://localhost:3004"}/dashboard/plans?canceled=true`, + cancel_url: `${process.env.CODE_URL ?? "http://localhost:3004"}/dashboard?canceled=true`, metadata: { organizationId: personalOrg.id, subscriptionType: "dev_plan", From 6e07fa11aa3dd02de6643423fd5db6cd2a962c01 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 7 May 2026 20:27:54 +0700 Subject: [PATCH 10/25] chore(deps-dev): bump @semantic-release/npm in / (#2029) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [//]: # (dependabot-start) ⚠️ **Dependabot is rebasing this PR** ⚠️ Rebasing might not happen immediately, so don't worry if this takes some time. Note: if you make any changes to this PR yourself, they will take precedence over the rebase. --- [//]: # (dependabot-end) Bumps the all/@semantic-release/npm group with 1 update: [@semantic-release/npm](https://github.com/semantic-release/npm). Updates `@semantic-release/npm` from 12.0.2 to 13.1.5
Release notes

Sourced from @​semantic-release/npm's releases.

v13.1.5

13.1.5 (2026-03-01)

Bug Fixes

  • deps: update dependency normalize-url to v9 (#1095) (daec492)

v13.1.4

13.1.4 (2026-02-06)

Bug Fixes

  • deps: update dependency @​actions/core to v3 (#1085) (17abfe1)

v13.1.3

13.1.3 (2025-12-12)

Bug Fixes

  • deps: update dependency @​actions/core to v2 (#1055) (fa4a3ab)

v13.1.2

13.1.2 (2025-11-14)

Bug Fixes

v13.1.1

13.1.1 (2025-10-19)

Bug Fixes

  • publish-dry-run: temporarily remove the addition of dry-running the publish step (30bd176)

v13.1.0

13.1.0 (2025-10-19)

Features

  • trusted-publishing: verify auth, considering OIDC vs tokens from various registries (e3319f1), closes #958
  • trusted-publishing: refine the messages for related errors (316ce21), closes #958
  • trusted-publishing: make request to verify if OIDC token exchange can succeed (c80ecb0), closes #958
  • trusted-publishing: pass id-token as bearer header for github actions (d83b727), closes #958
  • trusted-publishing: pass id-token as bearer header for gitlab pipelines (6d1c3cf), closes #958

... (truncated)

Commits
Maintainer changes

This version was pushed to npm by [GitHub Actions](https://www.npmjs.com/~GitHub Actions), a new releaser for @​semantic-release/npm since your current version.


[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=@semantic-release/npm&package-manager=npm_and_yarn&previous-version=12.0.2&new-version=13.1.5)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) ---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore major version` will close this group update PR and stop Dependabot creating any more for the specific dependency's major version (unless you unignore this specific dependency's major version or upgrade to it yourself) - `@dependabot ignore minor version` will close this group update PR and stop Dependabot creating any more for the specific dependency's minor version (unless you unignore this specific dependency's minor version or upgrade to it yourself) - `@dependabot ignore ` will close this group update PR and stop Dependabot creating any more for the specific dependency (unless you unignore this specific dependency or upgrade to it yourself) - `@dependabot unignore ` will remove all of the ignore conditions of the specified dependency - `@dependabot unignore ` will remove the ignore condition of the specified dependency and ignore conditions
Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: steebchen-bot Co-authored-by: Claude Sonnet 4.6 --- package.json | 2 +- pnpm-lock.yaml | 214 ++++++++++++++++++++++++++++++++++++++++++++++--- 2 files changed, 206 insertions(+), 10 deletions(-) diff --git a/package.json b/package.json index c89e360790..ec371d528c 100644 --- a/package.json +++ b/package.json @@ -35,7 +35,7 @@ "devDependencies": { "@abinnovision/eslint-config-react": "3.1.1", "@semantic-release/exec": "^7.1.0", - "@semantic-release/npm": "^12.0.1", + "@semantic-release/npm": "^13.1.5", "@steebchen/commitlint-config": "^1.6.1", "@steebchen/eslint-config": "^1.11.1", "@steebchen/lint-base": "1.1.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 1089921614..917ae8efd7 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -41,8 +41,8 @@ importers: specifier: ^7.1.0 version: 7.1.0(semantic-release@24.2.9(typescript@5.9.2)) '@semantic-release/npm': - specifier: ^12.0.1 - version: 12.0.2(semantic-release@24.2.9(typescript@5.9.2)) + specifier: ^13.1.5 + version: 13.1.5(semantic-release@24.2.9(typescript@5.9.2)) '@steebchen/commitlint-config': specifier: ^1.6.1 version: 1.6.1 @@ -1543,6 +1543,18 @@ packages: peerDependencies: prettier: ^2.4.0 || ^3.0.0 + '@actions/core@3.0.1': + resolution: {integrity: sha512-a6d/Nwahm9fliVGRhdhofo40HjHQasUPusmc7vBfyky+7Z+P2A1J68zyFVaNcEclc/Se+eO595oAr5nwEIoIUA==} + + '@actions/exec@3.0.0': + resolution: {integrity: sha512-6xH/puSoNBXb72VPlZVm7vQ+svQpFyA96qdDBvhB8eNZOE8LtPf9L4oAsfzK/crCL8YZ+19fKYVnM63Sl+Xzlw==} + + '@actions/http-client@4.0.1': + resolution: {integrity: sha512-+Nvd1ImaOZBSoPbsUtEhv+1z99H12xzncCkz0a3RuehINE81FZSe2QTj3uvAPTcJX/SCzUQHQ0D1GrPMbrPitg==} + + '@actions/io@3.0.2': + resolution: {integrity: sha512-nRBchcMM+QK1pdjO7/idu86rbJI5YHUKCvKs0KxnSYbVe3F51UfGxuZX4Qy/fWlp6l7gWFwIkrOzN+oUK03kfw==} + '@ai-sdk/gateway@3.0.11': resolution: {integrity: sha512-gLrgNXA95wdo/zAlA0miX/SJEYKSYCHg+e0Y/uQeABLScZAMjPw3jWaeANta/Db1T4xfi8cBvY3nnV8Pa27z+w==} engines: {node: '>=18'} @@ -4341,6 +4353,12 @@ packages: peerDependencies: semantic-release: '>=20.1.0' + '@semantic-release/npm@13.1.5': + resolution: {integrity: sha512-Hq5UxzoatN3LHiq2rTsWS54nCdqJHlsssGERCo8WlvdfFA9LoN0vO+OuKVSjtNapIc/S8C2LBj206wKLHg62mg==} + engines: {node: ^22.14.0 || >= 24.10.0} + peerDependencies: + semantic-release: '>=20.1.0' + '@semantic-release/release-notes-generator@14.1.0': resolution: {integrity: sha512-CcyDRk7xq+ON/20YNR+1I/jP7BYKICr1uKd1HHpROSnnTdGqOTburi4jcRiTYz0cpfhxSloQO3cGhnoot7IEkA==} engines: {node: '>=20.8.1'} @@ -7597,6 +7615,10 @@ packages: resolution: {integrity: sha512-Rw/B2DNQaPBICNXEm8balFz9a6WpZrkCGpcWFpy7nCj+NyhSdqXipmfvtmWt9xGfp0wZnBxB+iVpLmQMYt47Tw==} engines: {node: ^18.17.0 || >=20.5.0} + hosted-git-info@9.0.3: + resolution: {integrity: sha512-Hc+ghLoSt6QaYZUv0WBiIvmMDZuZZ7oaDvdH8MbfOO4lOsxdXLEvuC6ePoGs9H1X9oCLyq6+NVN0MKqD+ydxyg==} + engines: {node: ^20.17.0 || >=22.9.0} + html-entities@2.6.0: resolution: {integrity: sha512-kig+rMn/QOVRvr7c86gQ8lWXq+Hkv6CbAH1hLu+RG338StTpE8Z0b44SDVaqVu7HGKf27frdmUYEs9hTUX/cLQ==} @@ -8879,6 +8901,10 @@ packages: resolution: {integrity: sha512-V6gygoYb/5EmNI+MEGrWkC+e6+Rr7mTmfHrxDbLzxQogBkgzo76rkok0Am6thgSF7Mv2nLOajAJj5vDJZEFn7g==} engines: {node: ^16.14.0 || >=18.0.0} + normalize-package-data@8.0.0: + resolution: {integrity: sha512-RWk+PI433eESQ7ounYxIp67CYuVsS1uYSonX3kA6ps/3LWfjVQa/ptEg6Y3T6uAMq1mWpX9PQ+qx+QaHpsc7gQ==} + engines: {node: ^20.17.0 || >=22.9.0} + normalize-path@3.0.0: resolution: {integrity: sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==} engines: {node: '>=0.10.0'} @@ -8891,6 +8917,10 @@ packages: resolution: {integrity: sha512-JYc0DPlpGWB40kH5g07gGTrYuMqV653k3uBKY6uITPWds3M0ov3GaWGp9lbE3Bzngx8+XkfzgvASb9vk9JDFXQ==} engines: {node: '>=14.16'} + normalize-url@9.0.0: + resolution: {integrity: sha512-z9nC87iaZXXySbWWtTHfCFJyFvKaUAW6lODhikG7ILSbVgmwuFjUqkgnheHvAUcGedO29e2QGBRXMUD64aurqQ==} + engines: {node: '>=20'} + npm-run-path@4.0.1: resolution: {integrity: sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==} engines: {node: '>=8'} @@ -8981,6 +9011,77 @@ packages: - which - write-file-atomic + npm@11.14.0: + resolution: {integrity: sha512-6jfZzqK8EfWGnTeZQe+bgMx4IgiEZn7k1eM4GE8SE81B3iYch52dVSMO1hC2OnNbFLIwzvwUkUxsOOcUPG2XIw==} + engines: {node: ^20.17.0 || >=22.9.0} + hasBin: true + bundledDependencies: + - '@isaacs/string-locale-compare' + - '@npmcli/arborist' + - '@npmcli/config' + - '@npmcli/fs' + - '@npmcli/map-workspaces' + - '@npmcli/metavuln-calculator' + - '@npmcli/package-json' + - '@npmcli/promise-spawn' + - '@npmcli/redact' + - '@npmcli/run-script' + - '@sigstore/tuf' + - abbrev + - archy + - cacache + - chalk + - ci-info + - fastest-levenshtein + - fs-minipass + - glob + - graceful-fs + - hosted-git-info + - ini + - init-package-json + - is-cidr + - json-parse-even-better-errors + - libnpmaccess + - libnpmdiff + - libnpmexec + - libnpmfund + - libnpmorg + - libnpmpack + - libnpmpublish + - libnpmsearch + - libnpmteam + - libnpmversion + - make-fetch-happen + - minimatch + - minipass + - minipass-pipeline + - ms + - node-gyp + - nopt + - npm-audit-report + - npm-install-checks + - npm-package-arg + - npm-pick-manifest + - npm-profile + - npm-registry-fetch + - npm-user-validate + - p-map + - pacote + - parse-conflict-json + - proc-log + - qrcode-terminal + - read + - semver + - spdx-expression-parse + - ssri + - supports-color + - tar + - text-table + - tiny-relative-date + - treeverse + - validate-npm-package-name + - which + object-assign@4.1.1: resolution: {integrity: sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==} engines: {node: '>=0.10.0'} @@ -9677,6 +9778,10 @@ packages: resolution: {integrity: sha512-MbgfoNPANMdb4oRBNg5eqLbB2t2r+o5Ua1pNt8BqGp4I0FJZhuVSOj3PaBPni4azWuSzEdNn2evevzVmEk1ohQ==} engines: {node: '>=18'} + read-pkg@10.1.0: + resolution: {integrity: sha512-I8g2lArQiP78ll51UeMZojewtYgIRCKCWqZEgOO8c/uefTI+XDXvCSXu3+YNUaTNvZzobrL5+SqHjBrByRRTdg==} + engines: {node: '>=20'} + read-pkg@5.2.0: resolution: {integrity: sha512-Ug69mNOpfvKDAc2Q8DRpMjjzdtrnv9HcSMX+4VsZxD1aZ6ZzrIE7rlzXBtWTyhULSMKg076AW6WR5iZpD0JiOg==} engines: {node: '>=8'} @@ -10442,6 +10547,10 @@ packages: resolution: {integrity: sha512-Bh7QjT8/SuKUIfObSXNHNSK6WHo6J1tHCqJsuaFDP7gP0fkzSfTxI8y85JrppZ0h8l0maIgc2tfuZQ6/t3GtnQ==} engines: {node: ^14.18.0 || >=16.0.0} + tagged-tag@1.0.0: + resolution: {integrity: sha512-yEFYrVhod+hdNyx7g5Bnkkb0G6si8HJurOoOEgC8B/O0uXLHlaey/65KRv6cuWBNhBgHKAROVpc7QyYqE5gFng==} + engines: {node: '>=20'} + tailwind-csstree@0.3.1: resolution: {integrity: sha512-v147gLOR+E+9H4dNaP9rBeS/S/CTQJMRItlX9jLOXjdBGfSRauLwiz7LBCViaQmn6URXIlOdN6iMzSzOaeoUUw==} engines: {node: '>=18.18'} @@ -10681,6 +10790,10 @@ packages: tunnel-agent@0.6.0: resolution: {integrity: sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w==} + tunnel@0.0.6: + resolution: {integrity: sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg==} + engines: {node: '>=0.6.11 <=0.7.0 || >=0.7.3'} + turbo-darwin-64@2.7.2: resolution: {integrity: sha512-dxY3X6ezcT5vm3coK6VGixbrhplbQMwgNsCsvZamS/+/6JiebqW9DKt4NwpgYXhDY2HdH00I7FWs3wkVuan4rA==} cpu: [x64] @@ -10742,6 +10855,10 @@ packages: resolution: {integrity: sha512-TeTSQ6H5YHvpqVwBRcnLDCBnDOHWYu7IvGbHT6N8AOymcr9PJGjc1GTtiWZTYg0NCgYwvnYWEkVChQAr9bjfwA==} engines: {node: '>=16'} + type-fest@5.6.0: + resolution: {integrity: sha512-8ZiHFm91orbSAe2PSAiSVBVko18pbhbiB3U9GglSzF/zCGkR+rxpHx6sEMCUm4kxY4LjDIUGgCfUMtwfZfjfUA==} + engines: {node: '>=20'} + type-is@2.0.1: resolution: {integrity: sha512-OZs6gsjF4vMp32qrCbiVSkrFmXtG/AZhY3t0iAMrMBiAZyV9oALtXO8hsrHbMXF9x6L3grlFuwW2oAz7cav+Gw==} engines: {node: '>= 0.6'} @@ -10810,6 +10927,10 @@ packages: undici-types@7.19.2: resolution: {integrity: sha512-qYVnV5OEm2AW8cJMCpdV20CDyaN3g0AjDlOGf1OW4iaDEx8MwdtChUp4zu4H0VP3nDRF/8RKWH+IPp9uW0YGZg==} + undici@6.25.0: + resolution: {integrity: sha512-ZgpWDC5gmNiuY9CnLVXEH8rl50xhRCuLNA97fAUnKi8RRuV4E6KG31pDTsLVUKnohJE0I3XDrTeEydAXRw47xg==} + engines: {node: '>=18.17'} + unicode-emoji-modifier-base@1.0.0: resolution: {integrity: sha512-yLSH4py7oFH3oG/9K+XWrz1pSi3dfUrWEnInbxMfArOfc1+33BlGPQtLsOYwvdMy11AwUBetYuaRxSPqgkq+8g==} engines: {node: '>=4'} @@ -10822,6 +10943,10 @@ packages: resolution: {integrity: sha512-+QBBXBCvifc56fsbuxZQ6Sic3wqqc3WWaqxs58gvJrcOuN83HGTCwz3oS5phzU9LthRNE9VrJCFCLUgHeeFnfA==} engines: {node: '>=18'} + unicorn-magic@0.4.0: + resolution: {integrity: sha512-wH590V9VNgYH9g3lH9wWjTrUoKsjLF6sGLjhR4sH1LWpLmCOH0Zf7PukhDA8BiS7KHe4oPNkcTHqYkj7SOGUOw==} + engines: {node: '>=20'} + unified@11.0.5: resolution: {integrity: sha512-xKvGhPWw3k84Qjh8bI3ZeJjqnyadK+GEFtazSfZv/rKeTkTjOJho6mFqh2SM96iIcZokxiOpg78GazTSg8+KHA==} @@ -11277,6 +11402,22 @@ snapshots: dependencies: prettier: 3.6.2 + '@actions/core@3.0.1': + dependencies: + '@actions/exec': 3.0.0 + '@actions/http-client': 4.0.1 + + '@actions/exec@3.0.0': + dependencies: + '@actions/io': 3.0.2 + + '@actions/http-client@4.0.1': + dependencies: + tunnel: 0.0.6 + undici: 6.25.0 + + '@actions/io@3.0.2': {} + '@ai-sdk/gateway@3.0.11(zod@3.25.75)': dependencies: '@ai-sdk/provider': 3.0.2 @@ -15010,7 +15151,26 @@ snapshots: read-pkg: 9.0.1 registry-auth-token: 5.1.1 semantic-release: 24.2.9(typescript@5.9.2) - semver: 7.7.3 + semver: 7.7.4 + tempy: 3.1.1 + + '@semantic-release/npm@13.1.5(semantic-release@24.2.9(typescript@5.9.2))': + dependencies: + '@actions/core': 3.0.1 + '@semantic-release/error': 4.0.0 + aggregate-error: 5.0.0 + env-ci: 11.2.0 + execa: 9.6.1 + fs-extra: 11.3.3 + lodash-es: 4.18.1 + nerf-dart: 1.0.0 + normalize-url: 9.0.0 + npm: 11.14.0 + rc: 1.2.8 + read-pkg: 10.1.0 + registry-auth-token: 5.1.1 + semantic-release: 24.2.9(typescript@5.9.2) + semver: 7.7.4 tempy: 3.1.1 '@semantic-release/release-notes-generator@14.1.0(semantic-release@24.2.9(typescript@5.9.2))': @@ -15358,7 +15518,7 @@ snapshots: '@types/better-sqlite3@7.6.13': dependencies: - '@types/node': 25.6.0 + '@types/node': 25.3.0 optional: true '@types/bunyan@1.8.11': @@ -15537,7 +15697,7 @@ snapshots: '@types/mssql@9.1.8(@azure/core-client@1.10.1)': dependencies: - '@types/node': 25.6.0 + '@types/node': 25.3.0 tarn: 3.0.2 tedious: 19.2.1(@azure/core-client@1.10.1) transitivePeerDependencies: @@ -15564,6 +15724,7 @@ snapshots: '@types/node@25.6.0': dependencies: undici-types: 7.19.2 + optional: true '@types/normalize-package-data@2.4.4': {} @@ -15602,7 +15763,7 @@ snapshots: '@types/readable-stream@4.0.23': dependencies: - '@types/node': 25.6.0 + '@types/node': 25.3.0 '@types/request@2.48.13': dependencies: @@ -18827,6 +18988,10 @@ snapshots: dependencies: lru-cache: 10.4.3 + hosted-git-info@9.0.3: + dependencies: + lru-cache: 11.2.2 + html-entities@2.6.0: {} html-to-image@1.11.13: {} @@ -20328,12 +20493,20 @@ snapshots: semver: 7.7.4 validate-npm-package-license: 3.0.4 + normalize-package-data@8.0.0: + dependencies: + hosted-git-info: 9.0.3 + semver: 7.7.4 + validate-npm-package-license: 3.0.4 + normalize-path@3.0.0: {} normalize-range@0.1.2: {} normalize-url@8.1.1: {} + normalize-url@9.0.0: {} + npm-run-path@4.0.1: dependencies: path-key: 3.1.1 @@ -20351,6 +20524,8 @@ snapshots: npm@10.9.4: {} + npm@11.14.0: {} + object-assign@4.1.1: {} object-inspect@1.13.4: {} @@ -21118,6 +21293,14 @@ snapshots: read-pkg: 9.0.1 type-fest: 4.41.0 + read-pkg@10.1.0: + dependencies: + '@types/normalize-package-data': 2.4.4 + normalize-package-data: 8.0.0 + parse-json: 8.3.0 + type-fest: 5.6.0 + unicorn-magic: 0.4.0 + read-pkg@5.2.0: dependencies: '@types/normalize-package-data': 2.4.4 @@ -22154,6 +22337,8 @@ snapshots: dependencies: '@pkgr/core': 0.2.9 + tagged-tag@1.0.0: {} + tailwind-csstree@0.3.1: {} tailwind-merge@3.3.1: {} @@ -22201,7 +22386,7 @@ snapshots: '@azure/identity': 4.13.1 '@azure/keyvault-keys': 4.10.0(@azure/core-client@1.10.1) '@js-joda/core': 5.7.0 - '@types/node': 25.6.0 + '@types/node': 25.3.0 bl: 6.1.6 iconv-lite: 0.6.3 js-md4: 0.3.2 @@ -22217,7 +22402,7 @@ snapshots: '@azure/identity': 4.13.1 '@azure/keyvault-keys': 4.10.0(@azure/core-client@1.10.1) '@js-joda/core': 5.7.0 - '@types/node': 25.6.0 + '@types/node': 25.3.0 bl: 6.1.6 iconv-lite: 0.7.2 js-md4: 0.3.2 @@ -22411,6 +22596,8 @@ snapshots: safe-buffer: 5.2.1 optional: true + tunnel@0.0.6: {} + turbo-darwin-64@2.7.2: optional: true @@ -22454,6 +22641,10 @@ snapshots: type-fest@4.41.0: {} + type-fest@5.6.0: + dependencies: + tagged-tag: 1.0.0 + type-is@2.0.1: dependencies: content-type: 1.0.5 @@ -22537,7 +22728,10 @@ snapshots: undici-types@7.18.2: {} - undici-types@7.19.2: {} + undici-types@7.19.2: + optional: true + + undici@6.25.0: {} unicode-emoji-modifier-base@1.0.0: {} @@ -22545,6 +22739,8 @@ snapshots: unicorn-magic@0.3.0: {} + unicorn-magic@0.4.0: {} + unified@11.0.5: dependencies: '@types/unist': 3.0.3 From f10636a8b8f6130d2b4c3766788fd60e9dcce808 Mon Sep 17 00:00:00 2001 From: Luca Steeb Date: Thu, 7 May 2026 20:38:18 +0700 Subject: [PATCH 11/25] feat: email verification banner on devpass dashboard (#2188) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Summary - Add `EmailVerificationBanner` to the devpass dashboard (`apps/code`), mirroring the existing UI banner in `apps/ui` - Reuses the same `/auth/send-verification-email` endpoint, so the existing exponential backoff rate limit (60s base, capped at 24h) applies automatically - Adapted to the code app's stack: `sonner` for toasts and the local shadcn `Button` ## Test plan - [ ] Sign in to devpass dashboard with an unverified email — banner appears above main content - [ ] Click "Resend Email" — toast confirms send, email arrives - [ ] Verify email — banner disappears - [ ] Resend repeatedly — backend rate limit returns an error and toast surfaces it 🤖 Generated with [Claude Code](https://claude.com/claude-code) ## Summary by CodeRabbit * **New Features** * Email verification banner added to the dashboard for users with unverified emails. * Users can resend verification emails from the banner; button shows "Sending…" while processing. * **Improvements** * Verification emails now return users to the correct dashboard URL after verification. * Resend flow shows clearer success/error notifications. * **Bug Fixes** * Subscription error handling now surfaces specific error messages in toasts. * **Behavior** * Cancelling a subscription checkout now redirects to the dashboard cancel state. --------- Co-authored-by: Claude Opus 4.7 --- apps/api/src/auth/config.ts | 41 +++++++++--- .../src/app/dashboard/DashboardClient.tsx | 3 + .../components/EmailVerificationBanner.tsx | 65 +++++++++++++++++++ apps/code/src/lib/auth-client.ts | 1 + .../components/email-verification-banner.tsx | 46 +++++-------- apps/ui/src/lib/auth-client.ts | 1 + 6 files changed, 116 insertions(+), 41 deletions(-) create mode 100644 apps/code/src/components/EmailVerificationBanner.tsx diff --git a/apps/api/src/auth/config.ts b/apps/api/src/auth/config.ts index 8bbf1daa0b..73be47ec88 100644 --- a/apps/api/src/auth/config.ts +++ b/apps/api/src/auth/config.ts @@ -16,11 +16,29 @@ import { getResendClient, resendAudienceId } from "@llmgateway/shared/email"; const apiUrl = process.env.API_URL ?? "http://localhost:4002"; const cookieDomain = process.env.COOKIE_DOMAIN ?? "localhost"; const uiUrl = process.env.UI_URL ?? "http://localhost:3002"; +const codeUrl = process.env.CODE_URL ?? "http://localhost:3004"; const originUrls = process.env.ORIGIN_URLS ?? "http://localhost:3002,http://localhost:3003,http://localhost:3004,http://localhost:4002,http://localhost:3006"; const isHosted = process.env.HOSTED === "true"; +function resolveCallbackBaseUrl(request?: Request): string { + const originHeader = + request?.headers.get("origin") ?? request?.headers.get("referer"); + if (!originHeader) { + return uiUrl; + } + try { + const requestOrigin = new URL(originHeader).origin; + if (requestOrigin === new URL(codeUrl).origin) { + return codeUrl; + } + } catch { + // fall through to default + } + return uiUrl; +} + export const redisClient = new Redis({ host: process.env.REDIS_HOST ?? "localhost", port: Number(process.env.REDIS_PORT) || 6379, @@ -502,8 +520,7 @@ export const apiAuth: ReturnType = }, session: { cookieCache: { - enabled: true, - maxAge: 5 * 60, + enabled: false, }, expiresIn: 60 * 60 * 24 * 30, // 30 days updateAge: 60 * 60 * 24, // 1 day (every 1 day the session expiration is updated) @@ -625,14 +642,18 @@ If you didn't request this, you can safely ignore this email. Your password won' // Send Discord notification for new verified signup await notifyUserSignup(user.email, user.name, "Email"); }, - sendVerificationEmail: async ({ - user, - token, - }: { - user: { email: string; name?: string | null }; - token: string; - }) => { - const url = `${apiUrl}/auth/verify-email?token=${token}&callbackURL=${encodeURIComponent(`${uiUrl}/dashboard?emailVerified=true`)}`; + sendVerificationEmail: async ( + { + user, + token, + }: { + user: { email: string; name?: string | null }; + token: string; + }, + request?: Request, + ) => { + const callbackBase = resolveCallbackBaseUrl(request); + const url = `${apiUrl}/auth/verify-email?token=${token}&callbackURL=${encodeURIComponent(`${callbackBase}/dashboard?emailVerified=true`)}`; const text = `Hey${user.name ? ` ${user.name}` : ""}! diff --git a/apps/code/src/app/dashboard/DashboardClient.tsx b/apps/code/src/app/dashboard/DashboardClient.tsx index bc34d13172..8c95019743 100644 --- a/apps/code/src/app/dashboard/DashboardClient.tsx +++ b/apps/code/src/app/dashboard/DashboardClient.tsx @@ -20,6 +20,7 @@ import { useState } from "react"; import { toast } from "sonner"; import { CodingModelsShowcase } from "@/components/CodingModelsShowcase"; +import { EmailVerificationBanner } from "@/components/EmailVerificationBanner"; import { Button } from "@/components/ui/button"; import { Input } from "@/components/ui/input"; import { useUser } from "@/hooks/useUser"; @@ -383,6 +384,8 @@ export default function DashboardClient() { + +
{hasActivePlan ? (
diff --git a/apps/code/src/components/EmailVerificationBanner.tsx b/apps/code/src/components/EmailVerificationBanner.tsx new file mode 100644 index 0000000000..e83b10c36c --- /dev/null +++ b/apps/code/src/components/EmailVerificationBanner.tsx @@ -0,0 +1,65 @@ +"use client"; + +import { useState } from "react"; +import { toast } from "sonner"; + +import { Button } from "@/components/ui/button"; +import { useUser } from "@/hooks/useUser"; +import { useAuth } from "@/lib/auth-client"; + +export function EmailVerificationBanner() { + const { user } = useUser(); + const { sendVerificationEmail } = useAuth(); + const [isResending, setIsResending] = useState(false); + + if (!user || user.emailVerified) { + return null; + } + + const handleResendVerification = async () => { + setIsResending(true); + + const { error } = await sendVerificationEmail({ + email: user.email, + callbackURL: `${window.location.origin}/dashboard?emailVerified=true`, + }); + + if (error) { + toast.error("Error", { + description: error.message ?? "Failed to send verification email", + }); + } else { + toast.success("Verification email sent", { + description: "Please check your inbox for the verification email.", + }); + } + + setIsResending(false); + }; + + return ( +
+
+
+
+

+ Your email is unverified. Please check your inbox + and click the verification link to access all features. +

+
+
+
+ +
+
+
+ ); +} diff --git a/apps/code/src/lib/auth-client.ts b/apps/code/src/lib/auth-client.ts index 4d90c2a358..67b1c4da5f 100644 --- a/apps/code/src/lib/auth-client.ts +++ b/apps/code/src/lib/auth-client.ts @@ -25,6 +25,7 @@ export function useAuth() { signOut: authClient.signOut, useSession: authClient.useSession, getSession: authClient.getSession, + sendVerificationEmail: authClient.sendVerificationEmail, }), [authClient], ); diff --git a/apps/ui/src/components/email-verification-banner.tsx b/apps/ui/src/components/email-verification-banner.tsx index 670a5870d4..ccc54ee3ef 100644 --- a/apps/ui/src/components/email-verification-banner.tsx +++ b/apps/ui/src/components/email-verification-banner.tsx @@ -3,13 +3,13 @@ import { useState } from "react"; import { useUser } from "@/hooks/useUser"; +import { useAuth } from "@/lib/auth-client"; import { Button } from "@/lib/components/button"; import { toast } from "@/lib/components/use-toast"; -import { useAppConfig } from "@/lib/config"; export function EmailVerificationBanner() { const { user } = useUser(); - const config = useAppConfig(); + const { sendVerificationEmail } = useAuth(); const [isResending, setIsResending] = useState(false); if (!user || user.emailVerified) { @@ -19,41 +19,25 @@ export function EmailVerificationBanner() { const handleResendVerification = async () => { setIsResending(true); - try { - const response = await fetch( - `${config.apiUrl}/auth/send-verification-email`, - { - method: "POST", - headers: { - "Content-Type": "application/json", - }, - body: JSON.stringify({ - email: user.email, - callbackURL: `${window.location.origin}/dashboard?emailVerified=true`, - }), - }, - ); + const { error } = await sendVerificationEmail({ + email: user.email, + callbackURL: `${window.location.origin}/dashboard?emailVerified=true`, + }); - if (!response.ok) { - throw new Error("Failed to send verification email"); - } - - toast({ - title: "Verification email sent", - description: "Please check your inbox for the verification email.", - }); - } catch (error) { + if (error) { toast({ title: "Error", - description: - error instanceof Error - ? error.message - : "Failed to send verification email", + description: error.message ?? "Failed to send verification email", variant: "destructive", }); - } finally { - setIsResending(false); + } else { + toast({ + title: "Verification email sent", + description: "Please check your inbox for the verification email.", + }); } + + setIsResending(false); }; return ( diff --git a/apps/ui/src/lib/auth-client.ts b/apps/ui/src/lib/auth-client.ts index 10f3445a0d..7c33ca2daa 100644 --- a/apps/ui/src/lib/auth-client.ts +++ b/apps/ui/src/lib/auth-client.ts @@ -27,6 +27,7 @@ export function useAuth() { signOut: authClient.signOut, useSession: authClient.useSession, getSession: authClient.getSession, + sendVerificationEmail: authClient.sendVerificationEmail, }), [authClient], ); From b357d44409a7a4d41881add331e590b48edfb00f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 7 May 2026 13:56:40 +0000 Subject: [PATCH 12/25] chore(deps): bump hono from 4.12.7 to 4.12.16 (#2191) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bumps [hono](https://github.com/honojs/hono) from 4.12.7 to 4.12.16.
Release notes

Sourced from hono's releases.

v4.12.16

Security fixes

This release includes fixes for the following security issues:

Unvalidated JSX Tag Names in hono/jsx May Allow HTML Injection

Affects: hono/jsx. Fixes missing validation of JSX tag names when using jsx() or createElement(), which could allow HTML injection if untrusted input is used as the tag name. GHSA-69xw-7hcm-h432

bodyLimit() can be bypassed for chunked / unknown-length requests

Affects: Body Limit Middleware. Fixes late enforcement for request bodies without a reliable Content-Length (e.g. chunked requests), where oversized requests could reach handlers and return successful responses before being rejected. GHSA-9vqf-7f2p-gf9v

v4.12.15

What's Changed

New Contributors

Full Changelog: https://github.com/honojs/hono/compare/v4.12.14...v4.12.15

v4.12.14

Security fixes

This release includes fixes for the following security issues:

Improper handling of JSX attribute names in hono/jsx SSR

Affects: hono/jsx. Fixes missing validation of JSX attribute names during server-side rendering, which could allow malformed attribute keys to corrupt the generated HTML output and inject unintended attributes or elements. GHSA-458j-xx4x-4375

Other changes

  • fix(aws-lambda): handle invalid header names in request processing (#4883) fa2c74fe

v4.12.13

What's Changed

New Contributors

Full Changelog: https://github.com/honojs/hono/compare/v4.12.12...v4.12.13

v4.12.12

Security fixes

This release includes fixes for the following security issues:

... (truncated)

Commits

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=hono&package-manager=npm_and_yarn&previous-version=4.12.7&new-version=4.12.16)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) ---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) You can disable automated security fix PRs for this repo from the [Security Alerts page](https://github.com/theopenco/llmgateway/network/alerts).
Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Luca Steeb --- apps/api/package.json | 2 +- apps/gateway/package.json | 2 +- packages/instrumentation/package.json | 2 +- pnpm-lock.yaml | 194 +++++++++++--------------- 4 files changed, 82 insertions(+), 118 deletions(-) diff --git a/apps/api/package.json b/apps/api/package.json index 8e8248666a..ae40310a06 100644 --- a/apps/api/package.json +++ b/apps/api/package.json @@ -40,7 +40,7 @@ "dotenv": "16.5.0", "drizzle-zod": "0.8.3", "gateway": "workspace:*", - "hono": "^4.12.7", + "hono": "^4.12.16", "hono-openapi": "^1.1.1", "ioredis": "5.7.0", "jspdf": "4.2.1", diff --git a/apps/gateway/package.json b/apps/gateway/package.json index eb9ef258a5..bdbf8faa8b 100644 --- a/apps/gateway/package.json +++ b/apps/gateway/package.json @@ -40,7 +40,7 @@ "@opentelemetry/sdk-node": "0.205.0", "decimal.js": "10.5.0", "dotenv": "16.5.0", - "hono": "^4.12.7", + "hono": "^4.12.16", "hono-openapi": "^1.1.1", "ioredis": "5.7.0", "redis": "5.9.0", diff --git a/packages/instrumentation/package.json b/packages/instrumentation/package.json index e4a7e3e0f8..6d0cc0ac47 100644 --- a/packages/instrumentation/package.json +++ b/packages/instrumentation/package.json @@ -31,7 +31,7 @@ "@opentelemetry/resources": "2.1.0", "@opentelemetry/sdk-node": "0.205.0", "@opentelemetry/sdk-trace-base": "2.2.0", - "hono": "^4.12.7", + "hono": "^4.12.16", "prom-client": "15.1.3" } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 917ae8efd7..321003e879 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -141,16 +141,16 @@ importers: version: 1.6.9(@better-auth/core@1.6.9(@better-auth/utils@0.4.0)(@better-fetch/fetch@1.1.21)(@opentelemetry/api@1.9.0)(better-call@1.3.5(zod@3.25.75))(jose@6.1.3)(kysely@0.28.16)(nanostores@1.2.0))(@better-auth/utils@0.4.0)(@better-fetch/fetch@1.1.21)(better-auth@1.6.9(@opentelemetry/api@1.9.0)(better-sqlite3@12.6.0)(mongodb@7.1.0)(next@16.2.3(@opentelemetry/api@1.9.0)(babel-plugin-react-compiler@1.0.0)(react-dom@19.2.5(react@19.2.5))(react@19.2.5))(pg@8.16.3)(react-dom@19.2.5(react@19.2.5))(react@19.2.5)(vitest@4.0.5(@types/debug@4.1.12)(@types/node@25.6.0)(jiti@2.6.1)(lightningcss@1.30.2)(terser@5.40.0)(tsx@4.20.6)(yaml@2.8.3)))(better-call@1.3.5(zod@3.25.75))(nanostores@1.2.0) '@hono/node-server': specifier: ^1.19.13 - version: 1.19.13(hono@4.12.7) + version: 1.19.13(hono@4.12.16) '@hono/swagger-ui': specifier: ^0.5.2 - version: 0.5.2(hono@4.12.7) + version: 0.5.2(hono@4.12.16) '@hono/zod-openapi': specifier: ^0.19.6 - version: 0.19.8(hono@4.12.7)(zod@3.25.75) + version: 0.19.8(hono@4.12.16)(zod@3.25.75) '@hono/zod-validator': specifier: ^0.7.2 - version: 0.7.2(hono@4.12.7)(zod@3.25.75) + version: 0.7.2(hono@4.12.16)(zod@3.25.75) '@kubiks/otel-better-auth': specifier: 2.0.2 version: 2.0.2(@opentelemetry/api@1.9.0)(better-auth@1.6.9(@opentelemetry/api@1.9.0)(better-sqlite3@12.6.0)(drizzle-orm@1.0.0-beta.1-fd5d1e8(@opentelemetry/api@1.9.0)(@types/better-sqlite3@7.6.13)(@types/pg@8.15.5)(better-sqlite3@12.6.0)(gel@2.1.0)(kysely@0.28.16)(pg@8.16.3)(sql.js@1.13.0))(mongodb@7.1.0)(next@16.2.3(@opentelemetry/api@1.9.0)(babel-plugin-react-compiler@1.0.0)(react-dom@19.2.5(react@19.2.5))(react@19.2.5))(pg@8.16.3)(react-dom@19.2.5(react@19.2.5))(react@19.2.5)(vitest@4.0.5(@types/debug@4.1.12)(@types/node@25.6.0)(jiti@2.6.1)(lightningcss@1.30.2)(terser@5.40.0)(tsx@4.20.6)(yaml@2.8.3))) @@ -209,11 +209,11 @@ importers: specifier: workspace:* version: link:../gateway hono: - specifier: ^4.12.7 - version: 4.12.7 + specifier: ^4.12.16 + version: 4.12.16 hono-openapi: specifier: ^1.1.1 - version: 1.1.1(@standard-community/standard-json@0.3.5(@standard-schema/spec@1.1.0)(@types/json-schema@7.0.15)(@valibot/to-json-schema@1.6.0(valibot@1.3.1(typescript@5.9.3)))(quansync@0.2.11)(valibot@1.3.1(typescript@5.9.3))(zod-to-json-schema@3.25.1(zod@3.25.75))(zod@3.25.75))(@standard-community/standard-openapi@0.2.9(@standard-community/standard-json@0.3.5(@standard-schema/spec@1.1.0)(@types/json-schema@7.0.15)(@valibot/to-json-schema@1.6.0(valibot@1.3.1(typescript@5.9.3)))(quansync@0.2.11)(valibot@1.3.1(typescript@5.9.3))(zod-to-json-schema@3.25.1(zod@3.25.75))(zod@3.25.75))(@standard-schema/spec@1.1.0)(openapi-types@12.1.3)(valibot@1.3.1(typescript@5.9.3))(zod-openapi@5.4.3(zod@3.25.75))(zod@3.25.75))(@types/json-schema@7.0.15)(hono@4.12.7)(openapi-types@12.1.3) + version: 1.1.1(@standard-community/standard-json@0.3.5(@standard-schema/spec@1.1.0)(@types/json-schema@7.0.15)(@valibot/to-json-schema@1.6.0(valibot@1.3.1(typescript@5.9.3)))(quansync@0.2.11)(valibot@1.3.1(typescript@5.9.3))(zod-to-json-schema@3.25.1(zod@3.25.75))(zod@3.25.75))(@standard-community/standard-openapi@0.2.9(@standard-community/standard-json@0.3.5(@standard-schema/spec@1.1.0)(@types/json-schema@7.0.15)(@valibot/to-json-schema@1.6.0(valibot@1.3.1(typescript@5.9.3)))(quansync@0.2.11)(valibot@1.3.1(typescript@5.9.3))(zod-to-json-schema@3.25.1(zod@3.25.75))(zod@3.25.75))(@standard-schema/spec@1.1.0)(openapi-types@12.1.3)(valibot@1.3.1(typescript@5.9.3))(zod-openapi@5.4.3(zod@3.25.75))(zod@3.25.75))(@types/json-schema@7.0.15)(hono@4.12.16)(openapi-types@12.1.3) ioredis: specifier: 5.7.0 version: 5.7.0 @@ -476,16 +476,16 @@ importers: dependencies: '@hono/node-server': specifier: ^1.19.13 - version: 1.19.13(hono@4.12.7) + version: 1.19.13(hono@4.12.16) '@hono/swagger-ui': specifier: ^0.5.2 - version: 0.5.2(hono@4.12.7) + version: 0.5.2(hono@4.12.16) '@hono/zod-openapi': specifier: ^0.19.6 - version: 0.19.8(hono@4.12.7)(zod@3.25.75) + version: 0.19.8(hono@4.12.16)(zod@3.25.75) '@hono/zod-validator': specifier: ^0.7.2 - version: 0.7.2(hono@4.12.7)(zod@3.25.75) + version: 0.7.2(hono@4.12.16)(zod@3.25.75) '@llmgateway/actions': specifier: workspace:* version: link:../../packages/actions @@ -526,11 +526,11 @@ importers: specifier: 16.5.0 version: 16.5.0 hono: - specifier: ^4.12.7 - version: 4.12.7 + specifier: ^4.12.16 + version: 4.12.16 hono-openapi: specifier: ^1.1.1 - version: 1.1.1(@standard-community/standard-json@0.3.5(@standard-schema/spec@1.1.0)(@types/json-schema@7.0.15)(@valibot/to-json-schema@1.6.0(valibot@1.3.1(typescript@5.9.3)))(quansync@0.2.11)(valibot@1.3.1(typescript@5.9.3))(zod-to-json-schema@3.25.1(zod@3.25.75))(zod@3.25.75))(@standard-community/standard-openapi@0.2.9(@standard-community/standard-json@0.3.5(@standard-schema/spec@1.1.0)(@types/json-schema@7.0.15)(@valibot/to-json-schema@1.6.0(valibot@1.3.1(typescript@5.9.3)))(quansync@0.2.11)(valibot@1.3.1(typescript@5.9.3))(zod-to-json-schema@3.25.1(zod@3.25.75))(zod@3.25.75))(@standard-schema/spec@1.1.0)(openapi-types@12.1.3)(valibot@1.3.1(typescript@5.9.3))(zod-openapi@5.4.3(zod@3.25.75))(zod@3.25.75))(@types/json-schema@7.0.15)(hono@4.12.7)(openapi-types@12.1.3) + version: 1.1.1(@standard-community/standard-json@0.3.5(@standard-schema/spec@1.1.0)(@types/json-schema@7.0.15)(@valibot/to-json-schema@1.6.0(valibot@1.3.1(typescript@5.9.3)))(quansync@0.2.11)(valibot@1.3.1(typescript@5.9.3))(zod-to-json-schema@3.25.1(zod@3.25.75))(zod@3.25.75))(@standard-community/standard-openapi@0.2.9(@standard-community/standard-json@0.3.5(@standard-schema/spec@1.1.0)(@types/json-schema@7.0.15)(@valibot/to-json-schema@1.6.0(valibot@1.3.1(typescript@5.9.3)))(quansync@0.2.11)(valibot@1.3.1(typescript@5.9.3))(zod-to-json-schema@3.25.1(zod@3.25.75))(zod@3.25.75))(@standard-schema/spec@1.1.0)(openapi-types@12.1.3)(valibot@1.3.1(typescript@5.9.3))(zod-openapi@5.4.3(zod@3.25.75))(zod@3.25.75))(@types/json-schema@7.0.15)(hono@4.12.16)(openapi-types@12.1.3) ioredis: specifier: 5.7.0 version: 5.7.0 @@ -792,10 +792,10 @@ importers: version: 1.6.9(@better-auth/core@1.6.9(@better-auth/utils@0.4.0)(@better-fetch/fetch@1.1.21)(@opentelemetry/api@1.9.0)(better-call@1.3.5(zod@3.25.75))(jose@6.1.3)(kysely@0.28.16)(nanostores@1.2.0))(@better-auth/utils@0.4.0)(@better-fetch/fetch@1.1.21)(better-auth@1.6.9(@opentelemetry/api@1.9.0)(better-sqlite3@12.6.0)(mongodb@7.1.0)(next@16.2.3(@opentelemetry/api@1.9.0)(babel-plugin-react-compiler@1.0.0)(react-dom@19.2.5(react@19.2.5))(react@19.2.5))(pg@8.16.3)(react-dom@19.2.5(react@19.2.5))(react@19.2.5)(vitest@4.0.5(@types/debug@4.1.12)(@types/node@25.6.0)(jiti@2.6.1)(lightningcss@1.30.2)(terser@5.40.0)(tsx@4.20.6)(yaml@2.8.3)))(better-call@1.3.5(zod@3.25.75))(nanostores@1.2.0) '@content-collections/core': specifier: 0.15.0 - version: 0.15.0(typescript@5.9.3) + version: 0.15.0(typescript@5.9.2) '@content-collections/next': specifier: 0.2.11 - version: 0.2.11(@content-collections/core@0.15.0(typescript@5.9.3))(next@16.2.3(@opentelemetry/api@1.9.0)(babel-plugin-react-compiler@1.0.0)(react-dom@19.2.5(react@19.2.5))(react@19.2.5)) + version: 0.2.11(@content-collections/core@0.15.0(typescript@5.9.2))(next@16.2.3(@opentelemetry/api@1.9.0)(babel-plugin-react-compiler@1.0.0)(react-dom@19.2.5(react@19.2.5))(react@19.2.5)) '@hookform/resolvers': specifier: 5.2.2 version: 5.2.2(react-hook-form@7.65.0(react@19.2.5))(zod@3.25.75) @@ -1015,7 +1015,7 @@ importers: version: 10.4.21(postcss@8.5.10) openapi-typescript: specifier: 7.10.1 - version: 7.10.1(typescript@5.9.3) + version: 7.10.1(typescript@5.9.2) postcss: specifier: ^8.5.10 version: 8.5.10 @@ -1356,8 +1356,8 @@ importers: specifier: 2.2.0 version: 2.2.0(@opentelemetry/api@1.9.0) hono: - specifier: ^4.12.7 - version: 4.12.7 + specifier: ^4.12.16 + version: 4.12.16 prom-client: specifier: 15.1.3 version: 15.1.3 @@ -1670,16 +1670,16 @@ packages: resolution: {integrity: sha512-fCqPIfOcLE+CGqGPd66c8bZpwAji98tZ4JI9i/mlTNTlsIWslCfpg48s/ypyLxZTump5sypjrKn2/kY7q8oAbA==} engines: {node: '>=20.0.0'} - '@azure/msal-browser@5.8.0': - resolution: {integrity: sha512-X7IZV77bN56l7sbLjkcbQJX1t3U4tgxqztDr/XFbUcUfKk+z2FavcLgKP+OYUNj0wl/pEEtV9lldW9siY8BuHQ==} + '@azure/msal-browser@5.9.0': + resolution: {integrity: sha512-CzE+4PefDSJWj26zU7G1bKchlGRRHMBFreG4tAlGuzyI8hAPiYGobaJvZBgZBf6L63iphX7VH+ityL8VgEQz9Q==} engines: {node: '>=0.8.0'} - '@azure/msal-common@16.5.1': - resolution: {integrity: sha512-WS9w9SfI8SEYO7mTnxGeZ3UwQfhAVYCWglYF2/7GNx3ioHiAs2gPkl9eSwVs8cPrmiGh+zi9ai/OOKoq4cyzDw==} + '@azure/msal-common@16.5.2': + resolution: {integrity: sha512-GkDEL6TYo3HgT3UuqakdgE9PZfc1hMki6+Hwgy1uddb/EauvAKfu85vVhuofRSo22D1xTnWt8Ucwfg4vSCVwvA==} engines: {node: '>=0.8.0'} - '@azure/msal-node@5.1.4': - resolution: {integrity: sha512-G4LXGGggok1QC48uKu64/SV2DPRDlddmV8EieK8pflsNYMj9/Zz+Y9OHoEBhT15h+zpdwXXLYA/7PJCR/yZ8aw==} + '@azure/msal-node@5.1.5': + resolution: {integrity: sha512-ObTeMoNPmq19X3z40et9Xvs4ZoWVeJg43PZMRLG5iwVL+2nCtAerG3YTDItqPp1CfXNwmCXBbg8jn1DOx65c3g==} engines: {node: '>=20'} '@babel/code-frame@7.27.1': @@ -2564,105 +2564,89 @@ packages: resolution: {integrity: sha512-excjX8DfsIcJ10x1Kzr4RcWe1edC9PquDRRPx3YVCvQv+U5p7Yin2s32ftzikXojb1PIFc/9Mt28/y+iRklkrw==} cpu: [arm64] os: [linux] - libc: [glibc] '@img/sharp-libvips-linux-arm@1.2.4': resolution: {integrity: sha512-bFI7xcKFELdiNCVov8e44Ia4u2byA+l3XtsAj+Q8tfCwO6BQ8iDojYdvoPMqsKDkuoOo+X6HZA0s0q11ANMQ8A==} cpu: [arm] os: [linux] - libc: [glibc] '@img/sharp-libvips-linux-ppc64@1.2.4': resolution: {integrity: sha512-FMuvGijLDYG6lW+b/UvyilUWu5Ayu+3r2d1S8notiGCIyYU/76eig1UfMmkZ7vwgOrzKzlQbFSuQfgm7GYUPpA==} cpu: [ppc64] os: [linux] - libc: [glibc] '@img/sharp-libvips-linux-riscv64@1.2.4': resolution: {integrity: sha512-oVDbcR4zUC0ce82teubSm+x6ETixtKZBh/qbREIOcI3cULzDyb18Sr/Wcyx7NRQeQzOiHTNbZFF1UwPS2scyGA==} cpu: [riscv64] os: [linux] - libc: [glibc] '@img/sharp-libvips-linux-s390x@1.2.4': resolution: {integrity: sha512-qmp9VrzgPgMoGZyPvrQHqk02uyjA0/QrTO26Tqk6l4ZV0MPWIW6LTkqOIov+J1yEu7MbFQaDpwdwJKhbJvuRxQ==} cpu: [s390x] os: [linux] - libc: [glibc] '@img/sharp-libvips-linux-x64@1.2.4': resolution: {integrity: sha512-tJxiiLsmHc9Ax1bz3oaOYBURTXGIRDODBqhveVHonrHJ9/+k89qbLl0bcJns+e4t4rvaNBxaEZsFtSfAdquPrw==} cpu: [x64] os: [linux] - libc: [glibc] '@img/sharp-libvips-linuxmusl-arm64@1.2.4': resolution: {integrity: sha512-FVQHuwx1IIuNow9QAbYUzJ+En8KcVm9Lk5+uGUQJHaZmMECZmOlix9HnH7n1TRkXMS0pGxIJokIVB9SuqZGGXw==} cpu: [arm64] os: [linux] - libc: [musl] '@img/sharp-libvips-linuxmusl-x64@1.2.4': resolution: {integrity: sha512-+LpyBk7L44ZIXwz/VYfglaX/okxezESc6UxDSoyo2Ks6Jxc4Y7sGjpgU9s4PMgqgjj1gZCylTieNamqA1MF7Dg==} cpu: [x64] os: [linux] - libc: [musl] '@img/sharp-linux-arm64@0.34.5': resolution: {integrity: sha512-bKQzaJRY/bkPOXyKx5EVup7qkaojECG6NLYswgktOZjaXecSAeCWiZwwiFf3/Y+O1HrauiE3FVsGxFg8c24rZg==} engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} cpu: [arm64] os: [linux] - libc: [glibc] '@img/sharp-linux-arm@0.34.5': resolution: {integrity: sha512-9dLqsvwtg1uuXBGZKsxem9595+ujv0sJ6Vi8wcTANSFpwV/GONat5eCkzQo/1O6zRIkh0m/8+5BjrRr7jDUSZw==} engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} cpu: [arm] os: [linux] - libc: [glibc] '@img/sharp-linux-ppc64@0.34.5': resolution: {integrity: sha512-7zznwNaqW6YtsfrGGDA6BRkISKAAE1Jo0QdpNYXNMHu2+0dTrPflTLNkpc8l7MUP5M16ZJcUvysVWWrMefZquA==} engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} cpu: [ppc64] os: [linux] - libc: [glibc] '@img/sharp-linux-riscv64@0.34.5': resolution: {integrity: sha512-51gJuLPTKa7piYPaVs8GmByo7/U7/7TZOq+cnXJIHZKavIRHAP77e3N2HEl3dgiqdD/w0yUfiJnII77PuDDFdw==} engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} cpu: [riscv64] os: [linux] - libc: [glibc] '@img/sharp-linux-s390x@0.34.5': resolution: {integrity: sha512-nQtCk0PdKfho3eC5MrbQoigJ2gd1CgddUMkabUj+rBevs8tZ2cULOx46E7oyX+04WGfABgIwmMC0VqieTiR4jg==} engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} cpu: [s390x] os: [linux] - libc: [glibc] '@img/sharp-linux-x64@0.34.5': resolution: {integrity: sha512-MEzd8HPKxVxVenwAa+JRPwEC7QFjoPWuS5NZnBt6B3pu7EG2Ge0id1oLHZpPJdn3OQK+BQDiw9zStiHBTJQQQQ==} engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} cpu: [x64] os: [linux] - libc: [glibc] '@img/sharp-linuxmusl-arm64@0.34.5': resolution: {integrity: sha512-fprJR6GtRsMt6Kyfq44IsChVZeGN97gTD331weR1ex1c1rypDEABN6Tm2xa1wE6lYb5DdEnk03NZPqA7Id21yg==} engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} cpu: [arm64] os: [linux] - libc: [musl] '@img/sharp-linuxmusl-x64@0.34.5': resolution: {integrity: sha512-Jg8wNT1MUzIvhBFxViqrEhWDGzqymo3sV7z7ZsaWbZNDLXRJZoRGrjulp60YYtV4wfY8VIKcWidjojlLcWrd8Q==} engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} cpu: [x64] os: [linux] - libc: [musl] '@img/sharp-wasm32@0.34.5': resolution: {integrity: sha512-OdWTEiVkY2PHwqkbBI8frFxQQFekHaSSkUIJkwzclWZe64O1X4UlUjqqqLaPbUpMOQk6FBu/HtlGXNblIs0huw==} @@ -2762,8 +2746,8 @@ packages: '@cfworker/json-schema': optional: true - '@mongodb-js/saslprep@1.4.9': - resolution: {integrity: sha512-RXSxsokhAF/4nWys8An8npsqOI33Ex1Hlzqjw2pZOO+GKtMAR2noGnUdsFiGwsaO/xXI+56mtjTmDA3JXJsvmA==} + '@mongodb-js/saslprep@1.4.11': + resolution: {integrity: sha512-o9rAHc0IpIjuPSxRutWpE1F62x7n+4mVS4rCNHkzhIUMQcc18bb6xEq5wd2NdN0WjepIyXIppRshYI2kQDOZVA==} '@napi-rs/wasm-runtime@0.2.12': resolution: {integrity: sha512-ZVWUcfwY4E/yPitQJl481FjFo3K22D6qF0DuFH6Y/nbnE11GY5uguDxZMGXPQ8WQ0128MXQD7TnfHyK4oWoIJQ==} @@ -2791,28 +2775,24 @@ packages: engines: {node: '>= 10'} cpu: [arm64] os: [linux] - libc: [glibc] '@next/swc-linux-arm64-musl@16.2.3': resolution: {integrity: sha512-/YV0LgjHUmfhQpn9bVoGc4x4nan64pkhWR5wyEV8yCOfwwrH630KpvRg86olQHTwHIn1z59uh6JwKvHq1h4QEw==} engines: {node: '>= 10'} cpu: [arm64] os: [linux] - libc: [musl] '@next/swc-linux-x64-gnu@16.2.3': resolution: {integrity: sha512-/HiWEcp+WMZ7VajuiMEFGZ6cg0+aYZPqCJD3YJEfpVWQsKYSjXQG06vJP6F1rdA03COD9Fef4aODs3YxKx+RDQ==} engines: {node: '>= 10'} cpu: [x64] os: [linux] - libc: [glibc] '@next/swc-linux-x64-musl@16.2.3': resolution: {integrity: sha512-Kt44hGJfZSefebhk/7nIdivoDr3Ugp5+oNz9VvF3GUtfxutucUIHfIO0ZYO8QlOPDQloUVQn4NVC/9JvHRk9hw==} engines: {node: '>= 10'} cpu: [x64] os: [linux] - libc: [musl] '@next/swc-win32-arm64-msvc@16.2.3': resolution: {integrity: sha512-O2NZ9ie3Tq6xj5Z5CSwBT3+aWAMW2PIZ4egUi9MaWLkwaehgtB7YZjPm+UpcNpKOme0IQuqDcor7BsW6QBiQBw==} @@ -4196,79 +4176,66 @@ packages: resolution: {integrity: sha512-t4ONHboXi/3E0rT6OZl1pKbl2Vgxf9vJfWgmUoCEVQVxhW6Cw/c8I6hbbu7DAvgp82RKiH7TpLwxnJeKv2pbsw==} cpu: [arm] os: [linux] - libc: [glibc] '@rollup/rollup-linux-arm-musleabihf@4.59.0': resolution: {integrity: sha512-CikFT7aYPA2ufMD086cVORBYGHffBo4K8MQ4uPS/ZnY54GKj36i196u8U+aDVT2LX4eSMbyHtyOh7D7Zvk2VvA==} cpu: [arm] os: [linux] - libc: [musl] '@rollup/rollup-linux-arm64-gnu@4.59.0': resolution: {integrity: sha512-jYgUGk5aLd1nUb1CtQ8E+t5JhLc9x5WdBKew9ZgAXg7DBk0ZHErLHdXM24rfX+bKrFe+Xp5YuJo54I5HFjGDAA==} cpu: [arm64] os: [linux] - libc: [glibc] '@rollup/rollup-linux-arm64-musl@4.59.0': resolution: {integrity: sha512-peZRVEdnFWZ5Bh2KeumKG9ty7aCXzzEsHShOZEFiCQlDEepP1dpUl/SrUNXNg13UmZl+gzVDPsiCwnV1uI0RUA==} cpu: [arm64] os: [linux] - libc: [musl] '@rollup/rollup-linux-loong64-gnu@4.59.0': resolution: {integrity: sha512-gbUSW/97f7+r4gHy3Jlup8zDG190AuodsWnNiXErp9mT90iCy9NKKU0Xwx5k8VlRAIV2uU9CsMnEFg/xXaOfXg==} cpu: [loong64] os: [linux] - libc: [glibc] '@rollup/rollup-linux-loong64-musl@4.59.0': resolution: {integrity: sha512-yTRONe79E+o0FWFijasoTjtzG9EBedFXJMl888NBEDCDV9I2wGbFFfJQQe63OijbFCUZqxpHz1GzpbtSFikJ4Q==} cpu: [loong64] os: [linux] - libc: [musl] '@rollup/rollup-linux-ppc64-gnu@4.59.0': resolution: {integrity: sha512-sw1o3tfyk12k3OEpRddF68a1unZ5VCN7zoTNtSn2KndUE+ea3m3ROOKRCZxEpmT9nsGnogpFP9x6mnLTCaoLkA==} cpu: [ppc64] os: [linux] - libc: [glibc] '@rollup/rollup-linux-ppc64-musl@4.59.0': resolution: {integrity: sha512-+2kLtQ4xT3AiIxkzFVFXfsmlZiG5FXYW7ZyIIvGA7Bdeuh9Z0aN4hVyXS/G1E9bTP/vqszNIN/pUKCk/BTHsKA==} cpu: [ppc64] os: [linux] - libc: [musl] '@rollup/rollup-linux-riscv64-gnu@4.59.0': resolution: {integrity: sha512-NDYMpsXYJJaj+I7UdwIuHHNxXZ/b/N2hR15NyH3m2qAtb/hHPA4g4SuuvrdxetTdndfj9b1WOmy73kcPRoERUg==} cpu: [riscv64] os: [linux] - libc: [glibc] '@rollup/rollup-linux-riscv64-musl@4.59.0': resolution: {integrity: sha512-nLckB8WOqHIf1bhymk+oHxvM9D3tyPndZH8i8+35p/1YiVoVswPid2yLzgX7ZJP0KQvnkhM4H6QZ5m0LzbyIAg==} cpu: [riscv64] os: [linux] - libc: [musl] '@rollup/rollup-linux-s390x-gnu@4.59.0': resolution: {integrity: sha512-oF87Ie3uAIvORFBpwnCvUzdeYUqi2wY6jRFWJAy1qus/udHFYIkplYRW+wo+GRUP4sKzYdmE1Y3+rY5Gc4ZO+w==} cpu: [s390x] os: [linux] - libc: [glibc] '@rollup/rollup-linux-x64-gnu@4.59.0': resolution: {integrity: sha512-3AHmtQq/ppNuUspKAlvA8HtLybkDflkMuLK4DPo77DfthRb71V84/c4MlWJXixZz4uruIH4uaa07IqoAkG64fg==} cpu: [x64] os: [linux] - libc: [glibc] '@rollup/rollup-linux-x64-musl@4.59.0': resolution: {integrity: sha512-2UdiwS/9cTAx7qIUZB/fWtToJwvt0Vbo0zmnYt7ED35KPg13Q0ym1g442THLC7VyI6JfYTP4PiSOWyoMdV2/xg==} cpu: [x64] os: [linux] - libc: [musl] '@rollup/rollup-openbsd-x64@4.59.0': resolution: {integrity: sha512-M3bLRAVk6GOwFlPTIxVBSYKUaqfLrn8l0psKinkCFxl4lQvOSz8ZrKDz2gxcBwHFpci0B6rttydI4IpS4IS/jQ==} @@ -4595,28 +4562,24 @@ packages: engines: {node: '>= 10'} cpu: [arm64] os: [linux] - libc: [glibc] '@tailwindcss/oxide-linux-arm64-musl@4.1.16': resolution: {integrity: sha512-H81UXMa9hJhWhaAUca6bU2wm5RRFpuHImrwXBUvPbYb+3jo32I9VIwpOX6hms0fPmA6f2pGVlybO6qU8pF4fzQ==} engines: {node: '>= 10'} cpu: [arm64] os: [linux] - libc: [musl] '@tailwindcss/oxide-linux-x64-gnu@4.1.16': resolution: {integrity: sha512-ZGHQxDtFC2/ruo7t99Qo2TTIvOERULPl5l0K1g0oK6b5PGqjYMga+FcY1wIUnrUxY56h28FxybtDEla+ICOyew==} engines: {node: '>= 10'} cpu: [x64] os: [linux] - libc: [glibc] '@tailwindcss/oxide-linux-x64-musl@4.1.16': resolution: {integrity: sha512-Oi1tAaa0rcKf1Og9MzKeINZzMLPbhxvm7rno5/zuP1WYmpiG0bEHq4AcRUiG2165/WUzvxkW4XDYCscZWbTLZw==} engines: {node: '>= 10'} cpu: [x64] os: [linux] - libc: [musl] '@tailwindcss/oxide-wasm32-wasi@4.1.16': resolution: {integrity: sha512-B01u/b8LteGRwucIBmCQ07FVXLzImWESAIMcUU6nvFt/tYsQ6IHz8DmZ5KtvmwxD+iTYBtM1xwoGXswnlu9v0Q==} @@ -5061,6 +5024,7 @@ packages: '@ungap/structured-clone@1.3.0': resolution: {integrity: sha512-WmoN8qaIAo7WTYWbAZuG8PYEhn5fkz7dZrqTBZ7dtt//lL2Gwms1IcnQ5yHqjDfX8Ft5j4YzDM23f87zBfDe9g==} + deprecated: Potential CWE-502 - Update to 1.3.1 or higher '@unrs/resolver-binding-android-arm-eabi@1.11.1': resolution: {integrity: sha512-ppLRUgHVaGRWUx0R0Ut06Mjo9gBaBkg3v/8AxusGLhsIotbBLuRk51rAzqLC8gq6NyyAojEXglNjzf6R948DNw==} @@ -5101,49 +5065,41 @@ packages: resolution: {integrity: sha512-34gw7PjDGB9JgePJEmhEqBhWvCiiWCuXsL9hYphDF7crW7UgI05gyBAi6MF58uGcMOiOqSJ2ybEeCvHcq0BCmQ==} cpu: [arm64] os: [linux] - libc: [glibc] '@unrs/resolver-binding-linux-arm64-musl@1.11.1': resolution: {integrity: sha512-RyMIx6Uf53hhOtJDIamSbTskA99sPHS96wxVE/bJtePJJtpdKGXO1wY90oRdXuYOGOTuqjT8ACccMc4K6QmT3w==} cpu: [arm64] os: [linux] - libc: [musl] '@unrs/resolver-binding-linux-ppc64-gnu@1.11.1': resolution: {integrity: sha512-D8Vae74A4/a+mZH0FbOkFJL9DSK2R6TFPC9M+jCWYia/q2einCubX10pecpDiTmkJVUH+y8K3BZClycD8nCShA==} cpu: [ppc64] os: [linux] - libc: [glibc] '@unrs/resolver-binding-linux-riscv64-gnu@1.11.1': resolution: {integrity: sha512-frxL4OrzOWVVsOc96+V3aqTIQl1O2TjgExV4EKgRY09AJ9leZpEg8Ak9phadbuX0BA4k8U5qtvMSQQGGmaJqcQ==} cpu: [riscv64] os: [linux] - libc: [glibc] '@unrs/resolver-binding-linux-riscv64-musl@1.11.1': resolution: {integrity: sha512-mJ5vuDaIZ+l/acv01sHoXfpnyrNKOk/3aDoEdLO/Xtn9HuZlDD6jKxHlkN8ZhWyLJsRBxfv9GYM2utQ1SChKew==} cpu: [riscv64] os: [linux] - libc: [musl] '@unrs/resolver-binding-linux-s390x-gnu@1.11.1': resolution: {integrity: sha512-kELo8ebBVtb9sA7rMe1Cph4QHreByhaZ2QEADd9NzIQsYNQpt9UkM9iqr2lhGr5afh885d/cB5QeTXSbZHTYPg==} cpu: [s390x] os: [linux] - libc: [glibc] '@unrs/resolver-binding-linux-x64-gnu@1.11.1': resolution: {integrity: sha512-C3ZAHugKgovV5YvAMsxhq0gtXuwESUKc5MhEtjBpLoHPLYM+iuwSj3lflFwK3DPm68660rZ7G8BMcwSro7hD5w==} cpu: [x64] os: [linux] - libc: [glibc] '@unrs/resolver-binding-linux-x64-musl@1.11.1': resolution: {integrity: sha512-rV0YSoyhK2nZ4vEswT/QwqzqQXw5I6CjoaYMOX0TqBlWhojUf8P94mvI7nuJTeaCkkds3QE4+zS8Ko+GdXuZtA==} cpu: [x64] os: [linux] - libc: [musl] '@unrs/resolver-binding-wasm32-wasi@1.11.1': resolution: {integrity: sha512-5u4RkfxJm+Ng7IWgkzi3qrFOvLvQYnPBmjmZQ8+szTK/b31fQCnleNl1GgEt7nIsZRIf5PLhPwT0WM+q45x/UQ==} @@ -7596,8 +7552,8 @@ packages: hono: optional: true - hono@4.12.7: - resolution: {integrity: sha512-jq9l1DM0zVIvsm3lv9Nw9nlJnMNPOcAtsbsgiUhWcFzPE99Gvo6yRTlszSLLYacMeQ6quHD6hMfId8crVHvexw==} + hono@4.12.16: + resolution: {integrity: sha512-jN0ZewiNAWSe5khM3EyCmBb250+b40wWbwNILNfEvq84VREWwOIkuUsFONk/3i3nqkz7Oe1PcpM2mwQEK2L9Kg==} engines: {node: '>=16.9.0'} hook-std@4.0.0: @@ -8184,28 +8140,24 @@ packages: engines: {node: '>= 12.0.0'} cpu: [arm64] os: [linux] - libc: [glibc] lightningcss-linux-arm64-musl@1.30.2: resolution: {integrity: sha512-5Vh9dGeblpTxWHpOx8iauV02popZDsCYMPIgiuw97OJ5uaDsL86cnqSFs5LZkG3ghHoX5isLgWzMs+eD1YzrnA==} engines: {node: '>= 12.0.0'} cpu: [arm64] os: [linux] - libc: [musl] lightningcss-linux-x64-gnu@1.30.2: resolution: {integrity: sha512-Cfd46gdmj1vQ+lR6VRTTadNHu6ALuw2pKR9lYq4FnhvgBc4zWY1EtZcAc6EffShbb1MFrIPfLDXD6Xprbnni4w==} engines: {node: '>= 12.0.0'} cpu: [x64] os: [linux] - libc: [glibc] lightningcss-linux-x64-musl@1.30.2: resolution: {integrity: sha512-XJaLUUFXb6/QG2lGIW6aIk6jKdtjtcffUT0NKvIqhSBY3hh9Ch+1LCeH80dR9q9LBjG3ewbDjnumefsLsP6aiA==} engines: {node: '>= 12.0.0'} cpu: [x64] os: [linux] - libc: [musl] lightningcss-win32-arm64-msvc@1.30.2: resolution: {integrity: sha512-FZn+vaj7zLv//D/192WFFVA0RgHawIcHqLX9xuWiQt7P0PtdFEVaxgF9rjM/IRYHQXNnk61/H/gb2Ei+kUQ4xQ==} @@ -8861,8 +8813,8 @@ packages: sass: optional: true - node-abi@3.89.0: - resolution: {integrity: sha512-6u9UwL0HlAl21+agMN3YAMXcKByMqwGx+pq+P76vii5f7hTPtKDp08/H9py6DY+cfDw7kQNTGEj/rly3IgbNQA==} + node-abi@3.92.0: + resolution: {integrity: sha512-KdHvFWZjEKDf0cakgFjebl371GPsISX2oZHcuyKqM7DtogIsHrqKeLTo8wBHxaXRAQlY2PsPlZmfo+9ZCxEREQ==} engines: {node: '>=10'} node-cleanup@2.1.2: @@ -11053,6 +11005,7 @@ packages: uuid@10.0.0: resolution: {integrity: sha512-8XkAphELsDnEGrDxUOHB3RGvXz6TeuYSGEZBOjtTtPm2lwhGBjLgOzLHB63IUWfBpNucQjND6d3AOudO+H3RWQ==} + deprecated: uuid@10 and below is no longer supported. For ESM codebases, update to uuid@latest. For CommonJS codebases, use uuid@11 (but be aware this version will likely be deprecated in 2028). hasBin: true uuid@11.1.0: @@ -11061,10 +11014,12 @@ packages: uuid@8.3.2: resolution: {integrity: sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==} + deprecated: uuid@10 and below is no longer supported. For ESM codebases, update to uuid@latest. For CommonJS codebases, use uuid@11 (but be aware this version will likely be deprecated in 2028). hasBin: true uuid@9.0.1: resolution: {integrity: sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==} + deprecated: uuid@10 and below is no longer supported. For ESM codebases, update to uuid@latest. For CommonJS codebases, use uuid@11 (but be aware this version will likely be deprecated in 2028). hasBin: true valibot@1.3.1: @@ -11593,8 +11548,8 @@ snapshots: '@azure/core-tracing': 1.3.1 '@azure/core-util': 1.13.1 '@azure/logger': 1.3.0 - '@azure/msal-browser': 5.8.0 - '@azure/msal-node': 5.1.4 + '@azure/msal-browser': 5.9.0 + '@azure/msal-node': 5.1.5 open: 10.2.0 tslib: 2.8.1 transitivePeerDependencies: @@ -11638,17 +11593,16 @@ snapshots: transitivePeerDependencies: - supports-color - '@azure/msal-browser@5.8.0': + '@azure/msal-browser@5.9.0': dependencies: - '@azure/msal-common': 16.5.1 + '@azure/msal-common': 16.5.2 - '@azure/msal-common@16.5.1': {} + '@azure/msal-common@16.5.2': {} - '@azure/msal-node@5.1.4': + '@azure/msal-node@5.1.5': dependencies: - '@azure/msal-common': 16.5.1 + '@azure/msal-common': 16.5.2 jsonwebtoken: 9.0.3 - uuid: 8.3.2 '@babel/code-frame@7.27.1': dependencies: @@ -12020,7 +11974,7 @@ snapshots: conventional-commits-parser: 6.3.0 picocolors: 1.1.1 - '@content-collections/core@0.15.0(typescript@5.9.3)': + '@content-collections/core@0.15.0(typescript@5.9.2)': dependencies: '@standard-schema/spec': 1.1.0 camelcase: 8.0.0 @@ -12032,17 +11986,17 @@ snapshots: pluralize: 8.0.0 serialize-javascript: 7.0.5 tinyglobby: 0.2.15 - typescript: 5.9.3 + typescript: 5.9.2 yaml: 2.8.1 - '@content-collections/integrations@0.5.0(@content-collections/core@0.15.0(typescript@5.9.3))': + '@content-collections/integrations@0.5.0(@content-collections/core@0.15.0(typescript@5.9.2))': dependencies: - '@content-collections/core': 0.15.0(typescript@5.9.3) + '@content-collections/core': 0.15.0(typescript@5.9.2) - '@content-collections/next@0.2.11(@content-collections/core@0.15.0(typescript@5.9.3))(next@16.2.3(@opentelemetry/api@1.9.0)(babel-plugin-react-compiler@1.0.0)(react-dom@19.2.5(react@19.2.5))(react@19.2.5))': + '@content-collections/next@0.2.11(@content-collections/core@0.15.0(typescript@5.9.2))(next@16.2.3(@opentelemetry/api@1.9.0)(babel-plugin-react-compiler@1.0.0)(react-dom@19.2.5(react@19.2.5))(react@19.2.5))': dependencies: - '@content-collections/core': 0.15.0(typescript@5.9.3) - '@content-collections/integrations': 0.5.0(@content-collections/core@0.15.0(typescript@5.9.3)) + '@content-collections/core': 0.15.0(typescript@5.9.2) + '@content-collections/integrations': 0.5.0(@content-collections/core@0.15.0(typescript@5.9.2)) next: 16.2.3(@babel/core@7.28.5)(@opentelemetry/api@1.9.0)(babel-plugin-react-compiler@1.0.0)(react-dom@19.2.5(react@19.2.5))(react@19.2.5) '@date-fns/tz@1.4.1': {} @@ -12484,24 +12438,24 @@ snapshots: '@hexagon/base64@1.1.28': {} - '@hono/node-server@1.19.13(hono@4.12.7)': + '@hono/node-server@1.19.13(hono@4.12.16)': dependencies: - hono: 4.12.7 + hono: 4.12.16 - '@hono/swagger-ui@0.5.2(hono@4.12.7)': + '@hono/swagger-ui@0.5.2(hono@4.12.16)': dependencies: - hono: 4.12.7 + hono: 4.12.16 - '@hono/zod-openapi@0.19.8(hono@4.12.7)(zod@3.25.75)': + '@hono/zod-openapi@0.19.8(hono@4.12.16)(zod@3.25.75)': dependencies: '@asteasolutions/zod-to-openapi': 7.3.0(zod@3.25.75) - '@hono/zod-validator': 0.7.2(hono@4.12.7)(zod@3.25.75) - hono: 4.12.7 + '@hono/zod-validator': 0.7.2(hono@4.12.16)(zod@3.25.75) + hono: 4.12.16 zod: 3.25.75 - '@hono/zod-validator@0.7.2(hono@4.12.7)(zod@3.25.75)': + '@hono/zod-validator@0.7.2(hono@4.12.16)(zod@3.25.75)': dependencies: - hono: 4.12.7 + hono: 4.12.16 zod: 3.25.75 '@hookform/resolvers@5.2.2(react-hook-form@7.65.0(react@19.2.5))(zod@3.25.75)': @@ -12729,7 +12683,7 @@ snapshots: '@modelcontextprotocol/sdk@1.29.0(zod@3.25.75)': dependencies: - '@hono/node-server': 1.19.13(hono@4.12.7) + '@hono/node-server': 1.19.13(hono@4.12.16) ajv: 8.18.0 ajv-formats: 3.0.1(ajv@8.18.0) content-type: 1.0.5 @@ -12739,7 +12693,7 @@ snapshots: eventsource-parser: 3.0.6 express: 5.2.1 express-rate-limit: 8.4.1(express@5.2.1) - hono: 4.12.7 + hono: 4.12.16 jose: 6.1.3 json-schema-typed: 8.0.2 pkce-challenge: 5.0.1 @@ -12751,7 +12705,7 @@ snapshots: '@modelcontextprotocol/sdk@1.29.0(zod@3.25.76)': dependencies: - '@hono/node-server': 1.19.13(hono@4.12.7) + '@hono/node-server': 1.19.13(hono@4.12.16) ajv: 8.18.0 ajv-formats: 3.0.1(ajv@8.18.0) content-type: 1.0.5 @@ -12761,7 +12715,7 @@ snapshots: eventsource-parser: 3.0.6 express: 5.2.1 express-rate-limit: 8.4.1(express@5.2.1) - hono: 4.12.7 + hono: 4.12.16 jose: 6.1.3 json-schema-typed: 8.0.2 pkce-challenge: 5.0.1 @@ -12771,7 +12725,7 @@ snapshots: transitivePeerDependencies: - supports-color - '@mongodb-js/saslprep@1.4.9': + '@mongodb-js/saslprep@1.4.11': dependencies: sparse-bitfield: 3.0.3 optional: true @@ -18965,16 +18919,16 @@ snapshots: highlightjs-vue@1.0.0: {} - hono-openapi@1.1.1(@standard-community/standard-json@0.3.5(@standard-schema/spec@1.1.0)(@types/json-schema@7.0.15)(@valibot/to-json-schema@1.6.0(valibot@1.3.1(typescript@5.9.3)))(quansync@0.2.11)(valibot@1.3.1(typescript@5.9.3))(zod-to-json-schema@3.25.1(zod@3.25.75))(zod@3.25.75))(@standard-community/standard-openapi@0.2.9(@standard-community/standard-json@0.3.5(@standard-schema/spec@1.1.0)(@types/json-schema@7.0.15)(@valibot/to-json-schema@1.6.0(valibot@1.3.1(typescript@5.9.3)))(quansync@0.2.11)(valibot@1.3.1(typescript@5.9.3))(zod-to-json-schema@3.25.1(zod@3.25.75))(zod@3.25.75))(@standard-schema/spec@1.1.0)(openapi-types@12.1.3)(valibot@1.3.1(typescript@5.9.3))(zod-openapi@5.4.3(zod@3.25.75))(zod@3.25.75))(@types/json-schema@7.0.15)(hono@4.12.7)(openapi-types@12.1.3): + hono-openapi@1.1.1(@standard-community/standard-json@0.3.5(@standard-schema/spec@1.1.0)(@types/json-schema@7.0.15)(@valibot/to-json-schema@1.6.0(valibot@1.3.1(typescript@5.9.3)))(quansync@0.2.11)(valibot@1.3.1(typescript@5.9.3))(zod-to-json-schema@3.25.1(zod@3.25.75))(zod@3.25.75))(@standard-community/standard-openapi@0.2.9(@standard-community/standard-json@0.3.5(@standard-schema/spec@1.1.0)(@types/json-schema@7.0.15)(@valibot/to-json-schema@1.6.0(valibot@1.3.1(typescript@5.9.3)))(quansync@0.2.11)(valibot@1.3.1(typescript@5.9.3))(zod-to-json-schema@3.25.1(zod@3.25.75))(zod@3.25.75))(@standard-schema/spec@1.1.0)(openapi-types@12.1.3)(valibot@1.3.1(typescript@5.9.3))(zod-openapi@5.4.3(zod@3.25.75))(zod@3.25.75))(@types/json-schema@7.0.15)(hono@4.12.16)(openapi-types@12.1.3): dependencies: '@standard-community/standard-json': 0.3.5(@standard-schema/spec@1.1.0)(@types/json-schema@7.0.15)(@valibot/to-json-schema@1.6.0(valibot@1.3.1(typescript@5.9.3)))(quansync@0.2.11)(valibot@1.3.1(typescript@5.9.3))(zod-to-json-schema@3.25.1(zod@3.25.75))(zod@3.25.75) '@standard-community/standard-openapi': 0.2.9(@standard-community/standard-json@0.3.5(@standard-schema/spec@1.1.0)(@types/json-schema@7.0.15)(@valibot/to-json-schema@1.6.0(valibot@1.3.1(typescript@5.9.3)))(quansync@0.2.11)(valibot@1.3.1(typescript@5.9.3))(zod-to-json-schema@3.25.1(zod@3.25.75))(zod@3.25.75))(@standard-schema/spec@1.1.0)(openapi-types@12.1.3)(valibot@1.3.1(typescript@5.9.3))(zod-openapi@5.4.3(zod@3.25.75))(zod@3.25.75) '@types/json-schema': 7.0.15 openapi-types: 12.1.3 optionalDependencies: - hono: 4.12.7 + hono: 4.12.16 - hono@4.12.7: {} + hono@4.12.16: {} hook-std@4.0.0: {} @@ -20333,7 +20287,7 @@ snapshots: mongodb@7.1.0: dependencies: - '@mongodb-js/saslprep': 1.4.9 + '@mongodb-js/saslprep': 1.4.11 bson: 7.2.0 mongodb-connection-string-url: 7.0.1 optional: true @@ -20445,7 +20399,7 @@ snapshots: - '@babel/core' - babel-plugin-macros - node-abi@3.89.0: + node-abi@3.92.0: dependencies: semver: 7.7.4 optional: true @@ -20643,6 +20597,16 @@ snapshots: openapi-typescript-helpers@0.0.15: {} + openapi-typescript@7.10.1(typescript@5.9.2): + dependencies: + '@redocly/openapi-core': 1.34.5(supports-color@10.2.2) + ansi-colors: 4.1.3 + change-case: 5.4.4 + parse-json: 8.3.0 + supports-color: 10.2.2 + typescript: 5.9.2 + yargs-parser: 21.1.1 + openapi-typescript@7.10.1(typescript@5.9.3): dependencies: '@redocly/openapi-core': 1.34.5(supports-color@10.2.2) @@ -21000,7 +20964,7 @@ snapshots: minimist: 1.2.8 mkdirp-classic: 0.5.3 napi-build-utils: 2.0.0 - node-abi: 3.89.0 + node-abi: 3.92.0 pump: 3.0.4 rc: 1.2.8 simple-get: 4.0.1 From f0d3ca0fe63f969bf57059cc50f9dd6912502476 Mon Sep 17 00:00:00 2001 From: Luca Steeb Date: Thu, 7 May 2026 21:27:19 +0700 Subject: [PATCH 13/25] fix(gateway): respect RPM limits in low-uptime fallback (#2042) Co-authored-by: Claude Opus 4.7 --- apps/gateway/src/chat/chat.ts | 31 +++---- .../src/lib/provider-rate-limit.spec.ts | 89 +++++++++++++++++++ apps/gateway/src/lib/provider-rate-limit.ts | 38 ++++++++ 3 files changed, 140 insertions(+), 18 deletions(-) diff --git a/apps/gateway/src/chat/chat.ts b/apps/gateway/src/chat/chat.ts index 52d59a276b..68ad2d2b83 100644 --- a/apps/gateway/src/chat/chat.ts +++ b/apps/gateway/src/chat/chat.ts @@ -39,6 +39,7 @@ import { filterRateLimitedProviders, getExceededProviderRateLimitLabels, peekProviderRateLimit, + pickNonRateLimitedCandidates, providerRateLimitWindows, } from "@/lib/provider-rate-limit.js"; import { getResponsesContext } from "@/lib/responses-context.js"; @@ -2161,24 +2162,12 @@ chat.openapi(completions, async (c) => { return true; }); - // Also filter out rate-limited alternatives - const rateLimitedAlternatives = await filterRateLimitedProviders( + const candidatesForRouting = await pickNonRateLimitedCandidates( project.organizationId, - availableModelProviders.map((p) => ({ - providerId: p.providerId, - model: baseModelId, - providerModelName: p.modelName, - })), - ); - const nonRateLimitedAlternatives = availableModelProviders.filter( - (p) => !rateLimitedAlternatives.has(p.providerId), + baseModelId, + availableModelProviders, ); - const candidatesForRouting = - nonRateLimitedAlternatives.length > 0 - ? nonRateLimitedAlternatives - : availableModelProviders; - if (candidatesForRouting.length > 0) { const rawModelForFallback = models.find((m) => m.id === baseModelId); const modelWithPricing = rawModelForFallback @@ -2326,7 +2315,13 @@ chat.openapi(completions, async (c) => { ), ); - if (availableModelProviders.length > 0) { + const uptimeFallbackCandidates = await pickNonRateLimitedCandidates( + project.organizationId, + baseModelId, + availableModelProviders, + ); + + if (uptimeFallbackCandidates.length > 0) { const rawModelForFallback = models.find((m) => m.id === baseModelId); const modelWithPricing = rawModelForFallback ? { @@ -2339,7 +2334,7 @@ chat.openapi(completions, async (c) => { if (modelWithPricing) { // Fetch metrics for all available providers - const metricsCombinations = availableModelProviders.map((p) => ({ + const metricsCombinations = uptimeFallbackCandidates.map((p) => ({ modelId: resolveMetricsModelId(modelWithPricing.id, p.modelName), providerId: p.providerId, region: p.region, @@ -2349,7 +2344,7 @@ chat.openapi(completions, async (c) => { await getProviderMetricsForCombinations(metricsCombinations); const providerAgnosticCandidates = collapseProvidersToBestRegionPerProvider( - availableModelProviders, + uptimeFallbackCandidates, modelWithPricing, { metricsMap: allMetricsMap, diff --git a/apps/gateway/src/lib/provider-rate-limit.spec.ts b/apps/gateway/src/lib/provider-rate-limit.spec.ts index fff2f07723..19981b4597 100644 --- a/apps/gateway/src/lib/provider-rate-limit.spec.ts +++ b/apps/gateway/src/lib/provider-rate-limit.spec.ts @@ -5,6 +5,7 @@ import { filterRateLimitedProviders, getExceededProviderRateLimitLabels, peekProviderRateLimit, + pickNonRateLimitedCandidates, } from "./provider-rate-limit.js"; vi.mock("@llmgateway/cache", () => ({ @@ -245,6 +246,94 @@ describe("filterRateLimitedProviders", () => { }); }); +describe("pickNonRateLimitedCandidates", () => { + beforeEach(() => { + vi.resetAllMocks(); + }); + + const cappedRpm = { + maxRpm: 10, + maxRpd: 0, + rpmSource: "global_provider", + rpdSource: "none", + rpmRateLimitId: "rl-rpm", + } as const; + + const openRpm = { + maxRpm: 100, + maxRpd: 0, + rpmSource: "global_provider", + rpdSource: "none", + rpmRateLimitId: "rl-rpm", + } as const; + + it("drops a rate-limited candidate so the router falls back to the next one", async () => { + vi.mocked(mockDb.getEffectiveRateLimit) + .mockResolvedValueOnce(cappedRpm) + .mockResolvedValueOnce(openRpm); + vi.mocked(redis.zcard).mockResolvedValueOnce(10).mockResolvedValueOnce(20); + vi.mocked(redis.zrange).mockResolvedValueOnce([ + "member", + Date.now().toString(), + ]); + + const result = await pickNonRateLimitedCandidates("org-1", "glm-4.7", [ + { providerId: "together-ai", modelName: "glm-4.7" }, + { providerId: "cerebras", modelName: "glm-4.7" }, + ]); + + expect(result).toEqual([{ providerId: "cerebras", modelName: "glm-4.7" }]); + }); + + it("fails open when every candidate is rate-limited", async () => { + vi.mocked(mockDb.getEffectiveRateLimit) + .mockResolvedValueOnce(cappedRpm) + .mockResolvedValueOnce(cappedRpm); + vi.mocked(redis.zcard).mockResolvedValueOnce(10).mockResolvedValueOnce(10); + vi.mocked(redis.zrange) + .mockResolvedValueOnce(["m1", Date.now().toString()]) + .mockResolvedValueOnce(["m2", Date.now().toString()]); + + const candidates = [ + { providerId: "together-ai", modelName: "glm-4.7" }, + { providerId: "cerebras", modelName: "glm-4.7" }, + ]; + const result = await pickNonRateLimitedCandidates( + "org-1", + "glm-4.7", + candidates, + ); + + expect(result).toEqual(candidates); + }); + + it("dedupes peeks across region-expanded variants of the same provider+model", async () => { + vi.mocked(mockDb.getEffectiveRateLimit).mockResolvedValueOnce(openRpm); + vi.mocked(redis.zcard).mockResolvedValueOnce(0); + + const candidates = [ + { providerId: "alibaba", modelName: "glm-4.6", region: "singapore" }, + { providerId: "alibaba", modelName: "glm-4.6", region: "cn-beijing" }, + { providerId: "alibaba", modelName: "glm-4.6", region: "us-east-1" }, + ]; + const result = await pickNonRateLimitedCandidates( + "org-1", + "glm-4.6", + candidates, + ); + + expect(vi.mocked(mockDb.getEffectiveRateLimit)).toHaveBeenCalledTimes(1); + expect(result).toEqual(candidates); + }); + + it("returns an empty list unchanged without calling Redis", async () => { + const result = await pickNonRateLimitedCandidates("org-1", "glm-4.7", []); + + expect(result).toEqual([]); + expect(vi.mocked(mockDb.getEffectiveRateLimit)).not.toHaveBeenCalled(); + }); +}); + describe("getExceededProviderRateLimitLabels", () => { it("formats the blocked limit types for logging", () => { expect(getExceededProviderRateLimitLabels(["rpm"])).toBe("RPM"); diff --git a/apps/gateway/src/lib/provider-rate-limit.ts b/apps/gateway/src/lib/provider-rate-limit.ts index 44da1757d4..db5e3b1d8d 100644 --- a/apps/gateway/src/lib/provider-rate-limit.ts +++ b/apps/gateway/src/lib/provider-rate-limit.ts @@ -273,6 +273,44 @@ export async function filterRateLimitedProviders( ); } +/** + * Pick fallback candidates that are not at their RPM/RPD cap. + * Dedupes peeks by providerId+modelName since region-expanded variants share + * the same rate-limit window. Falls open to the original candidates if every + * one is capped, so callers always get a non-empty list when input was non-empty. + */ +export async function pickNonRateLimitedCandidates< + T extends { providerId: string; modelName: string }, +>(organizationId: string, baseModelId: string, candidates: T[]): Promise { + if (candidates.length === 0) { + return candidates; + } + + const uniquePeekCandidates = Array.from( + new Map( + candidates.map((p) => [ + `${p.providerId}:${p.modelName}`, + { + providerId: p.providerId, + model: baseModelId, + providerModelName: p.modelName, + }, + ]), + ).values(), + ); + + const rateLimited = await filterRateLimitedProviders( + organizationId, + uniquePeekCandidates, + ); + + const nonRateLimited = candidates.filter( + (p) => !rateLimited.has(p.providerId), + ); + + return nonRateLimited.length > 0 ? nonRateLimited : candidates; +} + /** * Check configurable provider/model caps stored in the database. * Uses a Redis sliding window approach identical to free model rate limiting. From a5fc6c4764e9b85f2ce369b4a2a0c995da446531 Mon Sep 17 00:00:00 2001 From: Luca Steeb Date: Thu, 7 May 2026 21:28:29 +0700 Subject: [PATCH 14/25] feat: decouple gateway caching from data retention (#2186) Co-authored-by: Claude Opus 4.7 --- apps/api/src/routes/dev-plans.ts | 114 +++++++- .../src/app/dashboard/DashboardClient.tsx | 3 + .../dashboard/components/DevPlanSettings.tsx | 250 +++++++++++++++--- apps/code/src/lib/api/v1.d.ts | 12 + apps/playground/src/lib/api/v1.d.ts | 12 + .../components/settings/caching-settings.tsx | 41 +-- .../organization-retention-settings.tsx | 41 +-- apps/ui/src/lib/api/v1.d.ts | 12 + ee/admin/src/lib/api/v1.d.ts | 12 + 9 files changed, 371 insertions(+), 126 deletions(-) diff --git a/apps/api/src/routes/dev-plans.ts b/apps/api/src/routes/dev-plans.ts index 2adc9a4c74..8d8cde4387 100644 --- a/apps/api/src/routes/dev-plans.ts +++ b/apps/api/src/routes/dev-plans.ts @@ -724,6 +724,9 @@ const getStatus = createRoute({ projectId: z.string().nullable(), apiKey: z.string().nullable(), devPlanAllowAllModels: z.boolean(), + cachingEnabled: z.boolean(), + cacheDurationSeconds: z.number(), + retentionLevel: z.enum(["retain", "none"]), }), }, }, @@ -770,6 +773,9 @@ devPlans.openapi(getStatus, async (c) => { projectId: null, apiKey: null, devPlanAllowAllModels: false, + cachingEnabled: false, + cacheDurationSeconds: 60, + retentionLevel: "none" as const, }); } @@ -780,6 +786,8 @@ devPlans.openapi(getStatus, async (c) => { // Get API key and project if user has an active dev plan let apiKey: string | null = null; let projectId: string | null = null; + let cachingEnabled = false; + let cacheDurationSeconds = 60; if (personalOrg.devPlan !== "none") { // Find the default project for this org. Order by createdAt asc so we // always return the original "Default Project" rather than whichever @@ -797,6 +805,8 @@ devPlans.openapi(getStatus, async (c) => { if (project) { projectId = project.id; + cachingEnabled = project.cachingEnabled; + cacheDurationSeconds = project.cacheDurationSeconds; apiKey = await getOrCreatePersonalOrgApiKey( personalOrg.id, project.id, @@ -821,6 +831,9 @@ devPlans.openapi(getStatus, async (c) => { projectId, apiKey, devPlanAllowAllModels: personalOrg.devPlanAllowAllModels, + cachingEnabled, + cacheDurationSeconds, + retentionLevel: personalOrg.retentionLevel, }); }); @@ -834,6 +847,9 @@ const updateSettings = createRoute({ "application/json": { schema: z.object({ devPlanAllowAllModels: z.boolean().optional(), + cachingEnabled: z.boolean().optional(), + cacheDurationSeconds: z.number().min(10).max(31536000).optional(), + retentionLevel: z.enum(["retain", "none"]).optional(), }), }, }, @@ -846,6 +862,9 @@ const updateSettings = createRoute({ schema: z.object({ success: z.boolean(), devPlanAllowAllModels: z.boolean(), + cachingEnabled: z.boolean(), + cacheDurationSeconds: z.number(), + retentionLevel: z.enum(["retain", "none"]), }), }, }, @@ -856,7 +875,12 @@ const updateSettings = createRoute({ devPlans.openapi(updateSettings, async (c) => { const user = c.get("user"); - const { devPlanAllowAllModels } = c.req.valid("json"); + const { + devPlanAllowAllModels, + cachingEnabled, + cacheDurationSeconds, + retentionLevel, + } = c.req.valid("json"); if (!user) { throw new HTTPException(401, { @@ -890,11 +914,19 @@ devPlans.openapi(updateSettings, async (c) => { }); } - const updateData: { devPlanAllowAllModels?: boolean } = {}; + const updateData: { + devPlanAllowAllModels?: boolean; + retentionLevel?: "retain" | "none"; + } = {}; if (devPlanAllowAllModels !== undefined) { updateData.devPlanAllowAllModels = devPlanAllowAllModels; } + if (retentionLevel !== undefined) { + updateData.retentionLevel = retentionLevel; + } + + const changes: Record = {}; if (Object.keys(updateData).length > 0) { await db @@ -902,7 +934,6 @@ devPlans.openapi(updateSettings, async (c) => { .set(updateData) .where(eq(tables.organization.id, personalOrg.id)); - const changes: Record = {}; if ( devPlanAllowAllModels !== undefined && devPlanAllowAllModels !== personalOrg.devPlanAllowAllModels @@ -912,22 +943,83 @@ devPlans.openapi(updateSettings, async (c) => { new: devPlanAllowAllModels, }; } + if ( + retentionLevel !== undefined && + retentionLevel !== personalOrg.retentionLevel + ) { + changes.retentionLevel = { + old: personalOrg.retentionLevel, + new: retentionLevel, + }; + } + } - if (Object.keys(changes).length > 0) { - await logAuditEvent({ - organizationId: personalOrg.id, - userId: user.id, - action: "dev_plan.update_settings", - resourceType: "dev_plan", - metadata: { changes }, - }); + const project = await db.query.project.findFirst({ + where: { + organizationId: { + eq: personalOrg.id, + }, + }, + orderBy: { + createdAt: "asc", + }, + }); + + const projectUpdate: { + cachingEnabled?: boolean; + cacheDurationSeconds?: number; + } = {}; + if (cachingEnabled !== undefined) { + projectUpdate.cachingEnabled = cachingEnabled; + } + if (cacheDurationSeconds !== undefined) { + projectUpdate.cacheDurationSeconds = cacheDurationSeconds; + } + + if (project && Object.keys(projectUpdate).length > 0) { + await db + .update(tables.project) + .set(projectUpdate) + .where(eq(tables.project.id, project.id)); + + if ( + cachingEnabled !== undefined && + cachingEnabled !== project.cachingEnabled + ) { + changes.cachingEnabled = { + old: project.cachingEnabled, + new: cachingEnabled, + }; } + if ( + cacheDurationSeconds !== undefined && + cacheDurationSeconds !== project.cacheDurationSeconds + ) { + changes.cacheDurationSeconds = { + old: project.cacheDurationSeconds, + new: cacheDurationSeconds, + }; + } + } + + if (Object.keys(changes).length > 0) { + await logAuditEvent({ + organizationId: personalOrg.id, + userId: user.id, + action: "dev_plan.update_settings", + resourceType: "dev_plan", + metadata: { changes }, + }); } return c.json({ success: true, devPlanAllowAllModels: devPlanAllowAllModels ?? personalOrg.devPlanAllowAllModels, + cachingEnabled: cachingEnabled ?? project?.cachingEnabled ?? false, + cacheDurationSeconds: + cacheDurationSeconds ?? project?.cacheDurationSeconds ?? 60, + retentionLevel: retentionLevel ?? personalOrg.retentionLevel, }); }); diff --git a/apps/code/src/app/dashboard/DashboardClient.tsx b/apps/code/src/app/dashboard/DashboardClient.tsx index 8c95019743..a1239b8fd5 100644 --- a/apps/code/src/app/dashboard/DashboardClient.tsx +++ b/apps/code/src/app/dashboard/DashboardClient.tsx @@ -475,6 +475,9 @@ export default function DashboardClient() { devPlanAllowAllModels={ devPlanStatus?.devPlanAllowAllModels ?? false } + cachingEnabled={devPlanStatus?.cachingEnabled ?? false} + cacheDurationSeconds={devPlanStatus?.cacheDurationSeconds ?? 60} + retentionLevel={devPlanStatus?.retentionLevel ?? "none"} /> {/* Change plan */} diff --git a/apps/code/src/app/dashboard/components/DevPlanSettings.tsx b/apps/code/src/app/dashboard/components/DevPlanSettings.tsx index daadc57a7b..cfac2dc523 100644 --- a/apps/code/src/app/dashboard/components/DevPlanSettings.tsx +++ b/apps/code/src/app/dashboard/components/DevPlanSettings.tsx @@ -1,31 +1,64 @@ "use client"; -import { AlertTriangle } from "lucide-react"; +import { useQueryClient } from "@tanstack/react-query"; +import { AlertTriangle, Loader2 } from "lucide-react"; import { useState } from "react"; import { toast } from "sonner"; +import { Button } from "@/components/ui/button"; +import { Input } from "@/components/ui/input"; import { Label } from "@/components/ui/label"; import { Switch } from "@/components/ui/switch"; import { useApi } from "@/lib/fetch-client"; interface DevPlanSettingsProps { devPlanAllowAllModels: boolean; + cachingEnabled: boolean; + cacheDurationSeconds: number; + retentionLevel: "retain" | "none"; } export default function DevPlanSettings({ - devPlanAllowAllModels: initialValue, + devPlanAllowAllModels: initialAllowAllModels, + cachingEnabled: initialCachingEnabled, + cacheDurationSeconds: initialCacheDurationSeconds, + retentionLevel: initialRetentionLevel, }: DevPlanSettingsProps) { const api = useApi(); - const [allowAllModels, setAllowAllModels] = useState(initialValue); - const [isUpdating, setIsUpdating] = useState(false); + const queryClient = useQueryClient(); + const [allowAllModels, setAllowAllModels] = useState(initialAllowAllModels); + const [isUpdatingAllowAll, setIsUpdatingAllowAll] = useState(false); + + const [cachingEnabled, setCachingEnabled] = useState(initialCachingEnabled); + const [cacheDuration, setCacheDuration] = useState( + initialCacheDurationSeconds, + ); + const [savedCacheDuration, setSavedCacheDuration] = useState( + initialCacheDurationSeconds, + ); + const [isSavingCaching, setIsSavingCaching] = useState(false); + const [isTogglingCaching, setIsTogglingCaching] = useState(false); + + const [retainData, setRetainData] = useState( + initialRetentionLevel === "retain", + ); + const [isUpdatingRetention, setIsUpdatingRetention] = useState(false); const updateSettingsMutation = api.useMutation( "patch", "/dev-plans/settings", ); - const handleToggle = async (checked: boolean) => { - setIsUpdating(true); + const invalidateStatus = () => + queryClient.invalidateQueries({ + predicate: (query) => { + const key = query.queryKey; + return Array.isArray(key) && key[1] === "/dev-plans/status"; + }, + }); + + const handleAllowAllToggle = async (checked: boolean) => { + setIsUpdatingAllowAll(true); try { await updateSettingsMutation.mutateAsync({ body: { devPlanAllowAllModels: checked }, @@ -37,50 +70,193 @@ export default function DevPlanSettings({ } catch { toast.error("Failed to update settings"); } finally { - setIsUpdating(false); + setIsUpdatingAllowAll(false); + } + }; + + const handleCachingToggle = async (checked: boolean) => { + setIsTogglingCaching(true); + try { + await updateSettingsMutation.mutateAsync({ + body: { cachingEnabled: checked }, + }); + setCachingEnabled(checked); + await invalidateStatus(); + toast.success(checked ? "Caching enabled" : "Caching disabled"); + } catch { + toast.error("Failed to update caching"); + } finally { + setIsTogglingCaching(false); + } + }; + + const handleSaveCacheDuration = async () => { + if ( + !Number.isFinite(cacheDuration) || + cacheDuration < 10 || + cacheDuration > 31536000 + ) { + toast.error("Cache duration must be between 10 and 31,536,000 seconds"); + return; + } + setIsSavingCaching(true); + try { + await updateSettingsMutation.mutateAsync({ + body: { cacheDurationSeconds: cacheDuration }, + }); + setSavedCacheDuration(cacheDuration); + await invalidateStatus(); + toast.success("Cache duration updated"); + } catch { + toast.error("Failed to update cache duration"); + } finally { + setIsSavingCaching(false); + } + }; + + const handleRetentionToggle = async (checked: boolean) => { + setIsUpdatingRetention(true); + try { + await updateSettingsMutation.mutateAsync({ + body: { retentionLevel: checked ? "retain" : "none" }, + }); + setRetainData(checked); + await invalidateStatus(); + toast.success( + checked ? "Data retention enabled" : "Switched to metadata-only", + ); + } catch { + toast.error("Failed to update data retention"); + } finally { + setIsUpdatingRetention(false); } }; return (

Settings

-
-
-
-