diff --git a/apps/api/src/routes/activity.ts b/apps/api/src/routes/activity.ts index 1ffcad3a2..9111f9bc9 100644 --- a/apps/api/src/routes/activity.ts +++ b/apps/api/src/routes/activity.ts @@ -48,6 +48,7 @@ const dailyActivitySchema = z.object({ requestCost: z.number(), dataStorageCost: z.number(), imageInputCost: z.number(), + audioInputCost: z.number(), imageOutputCost: z.number(), videoOutputCost: z.number(), cachedInputCost: z.number(), @@ -252,6 +253,10 @@ activity.openapi(getActivity, async (c) => { sql`COALESCE(SUM(${apiKeyHourlyStats.imageInputCost}), 0)`.as( "imageInputCost", ), + audioInputCost: + sql`COALESCE(SUM(${apiKeyHourlyStats.audioInputCost}), 0)`.as( + "audioInputCost", + ), imageOutputCost: sql`COALESCE(SUM(${apiKeyHourlyStats.imageOutputCost}), 0)`.as( "imageOutputCost", @@ -409,6 +414,7 @@ activity.openapi(getActivity, async (c) => { const cacheCount = Number(day.cacheCount); const discountSavings = Number(day.discountSavings); const imageInputCost = Number(day.imageInputCost); + const audioInputCost = Number(day.audioInputCost); const imageOutputCost = Number(day.imageOutputCost); const videoOutputCost = Number(day.videoOutputCost); const cachedInputCost = Number(day.cachedInputCost); @@ -440,6 +446,7 @@ activity.openapi(getActivity, async (c) => { requestCost, dataStorageCost, imageInputCost, + audioInputCost, imageOutputCost, videoOutputCost, cachedInputCost, @@ -521,6 +528,10 @@ activity.openapi(getActivity, async (c) => { sql`COALESCE(SUM(${projectHourlyStats.imageInputCost}), 0)`.as( "imageInputCost", ), + audioInputCost: + sql`COALESCE(SUM(${projectHourlyStats.audioInputCost}), 0)`.as( + "audioInputCost", + ), imageOutputCost: sql`COALESCE(SUM(${projectHourlyStats.imageOutputCost}), 0)`.as( "imageOutputCost", @@ -679,6 +690,7 @@ activity.openapi(getActivity, async (c) => { const requestCost = Number(day.requestCost); const dataStorageCost = Number(day.dataStorageCost); const imageInputCost = Number(day.imageInputCost); + const audioInputCost = Number(day.audioInputCost); const imageOutputCost = Number(day.imageOutputCost); const videoOutputCost = Number(day.videoOutputCost); const cachedInputCost = Number(day.cachedInputCost); @@ -711,6 +723,7 @@ activity.openapi(getActivity, async (c) => { requestCost, dataStorageCost, imageInputCost, + audioInputCost, imageOutputCost, videoOutputCost, cachedInputCost, diff --git a/apps/api/src/routes/chats.ts b/apps/api/src/routes/chats.ts index 8bb171467..24025e988 100644 --- a/apps/api/src/routes/chats.ts +++ b/apps/api/src/routes/chats.ts @@ -39,6 +39,7 @@ const messageSchema = z.object({ role: z.enum(["user", "assistant", "system"]), content: z.string().nullable(), images: z.string().nullable(), // JSON string + audios: z.string().nullable(), // JSON string of audio attachments reasoning: z.string().nullable(), // Reasoning content tools: z.string().nullable(), // JSON string of tool parts metadata: z.record(z.unknown()).nullable(), @@ -58,6 +59,7 @@ const sharedMessageSnapshotSchema = z.array( role: z.enum(["user", "assistant", "system"]), content: z.string().nullable(), images: z.string().nullable(), + audios: z.string().nullable().optional(), reasoning: z.string().nullable(), tools: z.string().nullable(), metadata: z.record(z.unknown()).nullable().optional(), @@ -82,14 +84,20 @@ const createMessageSchema = z role: z.enum(["user", "assistant", "system"]), content: z.string().optional(), images: z.string().optional(), // JSON string + audios: z.string().optional(), // JSON string of audio attachments reasoning: z.string().optional(), // Reasoning content tools: z.string().optional(), // Tool parts JSON metadata: z.record(z.unknown()).optional(), }) .refine( - (data) => data.content ?? data.images ?? data.reasoning ?? data.tools, + (data) => + data.content ?? + data.images ?? + data.audios ?? + data.reasoning ?? + data.tools, { - message: "Either content or images must be provided", + message: "Either content, images, or audios must be provided", }, ); @@ -487,6 +495,7 @@ chats.openapi(getChat, async (c) => { role: message.role as "user" | "assistant" | "system", content: message.content, images: message.images, + audios: (message as any).audios ?? null, reasoning: message.reasoning, tools: message.tools ?? null, metadata: message.metadata ?? null, @@ -661,6 +670,7 @@ chats.openapi(shareChat, async (c) => { role: tables.message.role, content: tables.message.content, images: tables.message.images, + audios: tables.message.audios, reasoning: tables.message.reasoning, tools: tables.message.tools, metadata: tables.message.metadata, @@ -683,6 +693,7 @@ chats.openapi(shareChat, async (c) => { role: message.role, content: message.content, images: message.images, + audios: message.audios, reasoning: message.reasoning, tools: message.tools, metadata: message.metadata, @@ -892,6 +903,7 @@ chats.openapi(forkSharedChat, async (c) => { role: message.role, content: message.content, images: message.images, + audios: message.audios ?? null, reasoning: message.reasoning, tools: message.tools, metadata: message.metadata ?? null, @@ -1059,6 +1071,7 @@ chats.openapi(addMessage, async (c) => { role: body.role, content: body.content ?? null, images: body.images ?? null, + audios: body.audios ?? null, reasoning: body.reasoning ?? null, tools: body.tools ?? null, metadata: body.metadata ?? null, @@ -1079,6 +1092,7 @@ chats.openapi(addMessage, async (c) => { role: newMessage.role as "user" | "assistant" | "system", content: newMessage.content, images: newMessage.images, + audios: (newMessage as any).audios ?? null, reasoning: newMessage.reasoning, tools: newMessage.tools ?? null, metadata: newMessage.metadata ?? null, diff --git a/apps/api/src/routes/internal-models.ts b/apps/api/src/routes/internal-models.ts index 57e4c154b..132d8fded 100644 --- a/apps/api/src/routes/internal-models.ts +++ b/apps/api/src/routes/internal-models.ts @@ -60,6 +60,7 @@ const modelProviderMappingSchema = z.object({ maxOutput: z.number().nullable(), streaming: z.boolean(), vision: z.boolean().nullable(), + audio: z.boolean().nullable(), reasoning: z.boolean().nullable(), reasoningOutput: z.string().nullable(), tools: z.boolean().nullable(), @@ -219,6 +220,7 @@ internalModels.openapi(getModelsRoute, async (c) => { return { ...mapping, discount: effectiveDiscount, + audio: sharedMapping?.audio ?? null, imageOutputPrice: sharedMapping?.imageOutputPrice !== undefined ? String(sharedMapping.imageOutputPrice) diff --git a/apps/api/src/routes/logs.ts b/apps/api/src/routes/logs.ts index f271bfed0..fb9b3c921 100644 --- a/apps/api/src/routes/logs.ts +++ b/apps/api/src/routes/logs.ts @@ -136,8 +136,10 @@ const logSchema = z.object({ cacheWriteInputCost: z.number().nullable().optional(), webSearchCost: z.number().nullable().optional(), imageInputTokens: z.string().nullable(), + audioInputTokens: z.string().nullable(), imageOutputTokens: z.string().nullable(), imageInputCost: z.number().nullable(), + audioInputCost: z.number().nullable(), imageOutputCost: z.number().nullable(), videoOutputCost: z.number().nullable(), videoDownloadCount: z.number().nullable(), diff --git a/apps/api/src/routes/public-chat-shares.ts b/apps/api/src/routes/public-chat-shares.ts index dbef074cc..8a7f3e653 100644 --- a/apps/api/src/routes/public-chat-shares.ts +++ b/apps/api/src/routes/public-chat-shares.ts @@ -11,6 +11,7 @@ const sharedMessageSchema = z.object({ role: z.enum(["user", "assistant", "system"]), content: z.string().nullable(), images: z.string().nullable(), + audios: z.string().nullable().optional(), reasoning: z.string().nullable(), tools: z.string().nullable(), metadata: z.record(z.unknown()).nullable().optional(), diff --git a/apps/code/src/lib/api/v1.d.ts b/apps/code/src/lib/api/v1.d.ts index 1d98dd15e..466ef89bb 100644 --- a/apps/code/src/lib/api/v1.d.ts +++ b/apps/code/src/lib/api/v1.d.ts @@ -527,6 +527,7 @@ export interface paths { role: "user" | "assistant" | "system"; content: string | null; images: string | null; + audios?: string | null; reasoning: string | null; tools: string | null; metadata?: { @@ -1086,8 +1087,10 @@ export interface paths { cacheWriteInputCost?: number | null; webSearchCost?: number | null; imageInputTokens: string | null; + audioInputTokens: string | null; imageOutputTokens: string | null; imageInputCost: number | null; + audioInputCost: number | null; imageOutputCost: number | null; videoOutputCost: number | null; videoDownloadCount: number | null; @@ -1337,8 +1340,10 @@ export interface paths { cacheWriteInputCost?: number | null; webSearchCost?: number | null; imageInputTokens: string | null; + audioInputTokens: string | null; imageOutputTokens: string | null; imageInputCost: number | null; + audioInputCost: number | null; imageOutputCost: number | null; videoOutputCost: number | null; videoDownloadCount: number | null; @@ -1472,6 +1477,7 @@ export interface paths { requestCost: number; dataStorageCost: number; imageInputCost: number; + audioInputCost: number; imageOutputCost: number; videoOutputCost: number; cachedInputCost: number; @@ -7406,6 +7412,7 @@ export interface paths { role: "user" | "assistant" | "system"; content: string | null; images: string | null; + audios: string | null; reasoning: string | null; tools: string | null; metadata: { @@ -7663,6 +7670,7 @@ export interface paths { role: "user" | "assistant" | "system"; content?: string; images?: string; + audios?: string; reasoning?: string; tools?: string; metadata?: { @@ -7685,6 +7693,7 @@ export interface paths { role: "user" | "assistant" | "system"; content: string | null; images: string | null; + audios: string | null; reasoning: string | null; tools: string | null; metadata: { @@ -9336,6 +9345,7 @@ export interface operations { maxOutput: number | null; streaming: boolean; vision: boolean | null; + audio: boolean | null; reasoning: boolean | null; reasoningOutput: string | null; tools: boolean | null; diff --git a/apps/gateway/src/app.ts b/apps/gateway/src/app.ts index bdd16caa6..5b48e0497 100644 --- a/apps/gateway/src/app.ts +++ b/apps/gateway/src/app.ts @@ -7,6 +7,7 @@ import { cors } from "hono/cors"; import { HTTPException } from "hono/http-exception"; import { z } from "zod"; +import { UnsupportedAudioFormatError } from "@llmgateway/actions"; import { redisClient } from "@llmgateway/cache"; import { db } from "@llmgateway/db"; import { @@ -112,6 +113,22 @@ app.use("*", async (c, next) => { }); app.onError((error, c) => { + if (error instanceof UnsupportedAudioFormatError) { + logger.warn("Unsupported audio format", { + message: error.message, + format: error.format, + providerTarget: error.providerTarget, + }); + return c.json( + { + error: true, + status: 400, + message: error.message, + }, + 400, + ); + } + if (error instanceof HTTPException) { const status = error.status; diff --git a/apps/gateway/src/audio.e2e.ts b/apps/gateway/src/audio.e2e.ts new file mode 100644 index 000000000..6aacd8a1c --- /dev/null +++ b/apps/gateway/src/audio.e2e.ts @@ -0,0 +1,175 @@ +import fs from "node:fs"; +import path from "node:path"; +import { fileURLToPath } from "node:url"; + +import "dotenv/config"; +import { beforeAll, beforeEach, describe, expect, test } from "vitest"; + +import { + beforeAllHook, + beforeEachHook, + filteredModels, + getTestOptions, + hasOnlyModels, + logMode, + matchesTestModel, + specifiedModels, +} from "@/chat-helpers.e2e.js"; + +import { db, tables } from "@llmgateway/db"; + +import { app } from "./app.js"; + +import type { ProviderModelMapping } from "@llmgateway/models"; + +const AUDIO_PROJECT_ID = "audio-test-project-id"; +const AUDIO_API_KEY_ID = "audio-test-api-key-id"; +const AUDIO_API_KEY_TOKEN = "real-token-audio"; + +const __dirname = path.dirname(fileURLToPath(import.meta.url)); +const FIXTURE_AUDIO_PATH = path.join( + __dirname, + "test-fixtures", + "test-audio.wav", +); + +function readFixtureAudioBase64(): string { + const bytes = fs.readFileSync(FIXTURE_AUDIO_PATH); + return bytes.toString("base64"); +} + +const audioTestCases = filteredModels + .filter((model) => { + if (hasOnlyModels) { + return model.providers.some( + (provider: ProviderModelMapping) => provider.test === "only", + ); + } + return true; + }) + .flatMap((model) => { + const cases: { model: string; provider: ProviderModelMapping }[] = []; + + for (const provider of model.providers as ProviderModelMapping[]) { + if (provider.inputAudioPrice === undefined) { + continue; + } + if (provider.deactivatedAt && new Date() > provider.deactivatedAt) { + continue; + } + if (provider.deprecatedAt && new Date() > provider.deprecatedAt) { + continue; + } + + if (specifiedModels) { + if (!matchesTestModel(provider.providerId, model.id, provider.region)) { + continue; + } + } else { + if (provider.test === "skip") { + continue; + } + } + + if (hasOnlyModels && provider.test !== "only") { + continue; + } + + cases.push({ + model: `${provider.providerId}/${provider.region ? provider.modelName : model.id}`, + provider, + }); + } + + return cases; + }); + +async function audioBeforeAllHook() { + await beforeAllHook(); + await db + .insert(tables.project) + .values({ + id: AUDIO_PROJECT_ID, + name: "Audio E2E Project", + organizationId: "org-id", + mode: "credits", + }) + .onConflictDoUpdate({ + target: tables.project.id, + set: { mode: "credits", organizationId: "org-id" }, + }); + await db + .insert(tables.apiKey) + .values({ + id: AUDIO_API_KEY_ID, + token: AUDIO_API_KEY_TOKEN, + projectId: AUDIO_PROJECT_ID, + description: "Audio E2E API Key", + createdBy: "user-id", + }) + .onConflictDoNothing(); +} + +describe("e2e audio input", getTestOptions(), () => { + beforeAll(audioBeforeAllHook); + beforeEach(beforeEachHook); + + test("empty", () => { + expect(true).toBe(true); + }); + + test.each(audioTestCases)( + "/v1/chat/completions accepts input_audio for $model", + { ...getTestOptions(), timeout: 120_000 }, + async ({ model, provider }) => { + const audioBase64 = readFixtureAudioBase64(); + const res = await app.request("/v1/chat/completions", { + method: "POST", + headers: { + "Content-Type": "application/json", + Authorization: `Bearer ${AUDIO_API_KEY_TOKEN}`, + }, + body: JSON.stringify({ + model, + messages: [ + { + role: "user", + content: [ + { + type: "text", + text: "What do you hear in this audio? Reply in one short sentence.", + }, + { + type: "input_audio", + input_audio: { data: audioBase64, format: "wav" }, + }, + ], + }, + ], + }), + }); + + const json = await res.json(); + if (logMode) { + console.log( + "audio chat.completions response", + model, + JSON.stringify(json).slice(0, 800), + ); + } + expect(res.status).toBe(200); + expect(json.choices?.[0]?.message?.content).toBeTruthy(); + + const audioTokens = json.usage?.prompt_tokens_details?.audio_tokens; + expect(typeof audioTokens).toBe("number"); + expect(audioTokens).toBeGreaterThan(0); + + const audioInputCost = json.usage?.cost_details?.audio_input_cost; + expect(typeof audioInputCost).toBe("number"); + + const expected = + audioTokens * (provider.inputAudioPrice ?? provider.inputPrice ?? 0); + expect(audioInputCost).toBeCloseTo(expected, 8); + }, + ); +}); diff --git a/apps/gateway/src/chat/chat.ts b/apps/gateway/src/chat/chat.ts index 6fcb7e441..16d0e36a3 100644 --- a/apps/gateway/src/chat/chat.ts +++ b/apps/gateway/src/chat/chat.ts @@ -55,6 +55,7 @@ import { getProviderEndpoint, getProviderHeaders, getProviderSelectionPrice, + googleProviderSupportsAudioFormat, prepareRequestBody, resolveMetricsModelId, type RoutingMetadata, @@ -132,6 +133,10 @@ import { hasMeaningfulAssistantOutput } from "./tools/has-meaningful-assistant-o import { healJsonResponse } from "./tools/heal-json-response.js"; import { isModelTrulyFree } from "./tools/is-model-truly-free.js"; import { mapFinishReasonToOpenai } from "./tools/map-finish-reason-to-openai.js"; +import { + getAudioFormatsFromMessages, + messagesContainAudio, +} from "./tools/messages-contain-audio.js"; import { messagesContainImages } from "./tools/messages-contain-images.js"; import { mightBeCompleteJson } from "./tools/might-be-complete-json.js"; import { normalizeStreamingError } from "./tools/normalize-streaming-error.js"; @@ -346,6 +351,8 @@ function filterEligibleModelProviders( webSearchTool?: WebSearchTool; responseFormatType?: string; hasImages: boolean; + hasAudio: boolean; + audioFormats?: string[]; maxTokens?: number; reasoningEffort?: string; }, @@ -389,6 +396,21 @@ function filterEligibleModelProviders( return false; } + if (options.hasAudio && provider.audio !== true) { + return false; + } + + if ( + options.hasAudio && + options.audioFormats && + options.audioFormats.length > 0 && + !options.audioFormats.every((fmt) => + googleProviderSupportsAudioFormat(provider.providerId, fmt), + ) + ) { + return false; + } + if ( options.maxTokens !== undefined && provider.maxOutput !== undefined && @@ -933,6 +955,7 @@ const completions = createRoute({ web_search_cost: z.number().nullable().optional(), image_input_cost: z.number().nullable().optional(), image_output_cost: z.number().nullable().optional(), + audio_input_cost: z.number().nullable().optional(), data_storage_cost: z.number().nullable().optional(), }) .optional(), @@ -1115,6 +1138,10 @@ chat.openapi(completions, async (c) => { // Check if messages contain images for vision capability filtering const hasImages = messagesContainImages(messages as BaseMessage[]); + const hasAudio = messagesContainAudio(messages as BaseMessage[]); + const audioFormats = hasAudio + ? getAudioFormatsFromMessages(messages as BaseMessage[]) + : []; // Extract web_search tool from tools array if present // The web_search tool is a special tool that enables native web search for providers that support it @@ -1671,7 +1698,7 @@ chat.openapi(completions, async (c) => { if (!("free" in modelDef && modelDef.free)) { continue; } - } else if (!allowedAutoModels.includes(modelDef.id)) { + } else if (!allowedAutoModels.includes(modelDef.id) && !hasAudio) { continue; } else if ( estimatedInputTokens > 10_000 && @@ -1782,6 +1809,20 @@ chat.openapi(completions, async (c) => { return false; } + if (hasAudio && provider.audio !== true) { + return false; + } + + if ( + hasAudio && + audioFormats.length > 0 && + !audioFormats.every((fmt) => + googleProviderSupportsAudioFormat(provider.providerId, fmt), + ) + ) { + return false; + } + if ( max_tokens !== undefined && provider.maxOutput !== undefined && @@ -1945,7 +1986,7 @@ chat.openapi(completions, async (c) => { const allSameProviderMappings = modelInfo.providers.filter( (p) => p.providerId === usedProvider, ); - const sameProviderMappings = isDevPlanRestricted + let sameProviderMappings = isDevPlanRestricted ? allSameProviderMappings.filter(providerSupportsCachedInput) : allSameProviderMappings; if (isDevPlanRestricted && sameProviderMappings.length === 0) { @@ -1953,6 +1994,21 @@ chat.openapi(completions, async (c) => { message: `Provider ${usedProvider} does not offer cached input pricing for model ${modelInfo.id}. Coding plans require providers with prompt caching support; choose another provider or enable access to all models in your dashboard settings at code.llmgateway.io/dashboard.`, }); } + if (hasAudio) { + sameProviderMappings = sameProviderMappings.filter( + (p) => + p.audio === true && + (audioFormats.length === 0 || + audioFormats.every((fmt) => + googleProviderSupportsAudioFormat(p.providerId, fmt), + )), + ); + if (sameProviderMappings.length === 0) { + throw new HTTPException(400, { + message: `Provider ${usedProvider} does not support audio input for model ${modelInfo.id}.`, + }); + } + } const sameProviderRegionalMappings = sameProviderMappings.filter( (p) => p.region, ); @@ -1998,6 +2054,8 @@ chat.openapi(completions, async (c) => { webSearchTool, responseFormatType: response_format?.type, hasImages, + hasAudio, + audioFormats, maxTokens: max_tokens, reasoningEffort: reasoning_effort, }, @@ -2162,6 +2220,18 @@ chat.openapi(completions, async (c) => { if (hasImages && provider.vision !== true) { return false; } + if (hasAudio && provider.audio !== true) { + return false; + } + if ( + hasAudio && + audioFormats.length > 0 && + !audioFormats.every((fmt) => + googleProviderSupportsAudioFormat(provider.providerId, fmt), + ) + ) { + return false; + } return true; }); @@ -2307,6 +2377,8 @@ chat.openapi(completions, async (c) => { webSearchTool, responseFormatType: response_format?.type, hasImages, + hasAudio, + audioFormats, maxTokens: max_tokens, reasoningEffort: reasoning_effort, }, @@ -2492,20 +2564,23 @@ chat.openapi(completions, async (c) => { webSearchTool, responseFormatType: response_format?.type, hasImages, + hasAudio, + audioFormats, maxTokens: max_tokens, reasoningEffort: reasoning_effort, }, ); if (availableModelProviders.length === 0) { + const audience = + project.mode === "api-keys" ? "configured" : "available"; throw new HTTPException(400, { - message: - project.mode === "api-keys" - ? hasImages - ? `No provider with vision support is available for model ${usedModel}. The request contains images but none of the configured providers support vision.` - : `No provider key set for any of the providers that support model ${usedModel}. Please add the provider key in the settings or switch the project mode to credits or hybrid.` - : hasImages - ? `No provider with vision support is available for model ${usedModel}. The request contains images but none of the available providers support vision.` + message: hasAudio + ? `No provider with audio support is available for model ${usedModel}. The request contains audio but none of the ${audience} providers support audio input.` + : hasImages + ? `No provider with vision support is available for model ${usedModel}. The request contains images but none of the ${audience} providers support vision.` + : project.mode === "api-keys" + ? `No provider key set for any of the providers that support model ${usedModel}. Please add the provider key in the settings or switch the project mode to credits or hybrid.` : `No available provider could be found for model ${usedModel}`, }); } @@ -2698,6 +2773,8 @@ chat.openapi(completions, async (c) => { webSearchTool, responseFormatType: response_format?.type, hasImages, + hasAudio, + audioFormats, maxTokens: max_tokens, reasoningEffort: reasoning_effort, }, @@ -3524,6 +3601,7 @@ chat.openapi(completions, async (c) => { let cachedTokens = null; let cacheWriteTokens: number | null = null; let cacheWrite1hTokens: number | null = null; + let audioInputTokens: number | null = null; let rawCachedResponseData = ""; // Raw SSE data from cached response let cachedResponseSize = 0; // Track size incrementally to avoid expensive stringify @@ -3587,6 +3665,11 @@ chat.openapi(completions, async (c) => { ) { cacheWrite1hTokens = chunkCacheWrite1h; } + const chunkAudioTokens = + chunkData.usage.prompt_tokens_details?.audio_tokens; + if (chunkAudioTokens !== undefined && chunkAudioTokens !== null) { + audioInputTokens = chunkAudioTokens; + } } } catch (e) { // Skip malformed chunks @@ -3656,6 +3739,7 @@ chat.openapi(completions, async (c) => { { cacheWriteTokens, cacheWrite1hTokens, + audioInputTokens, }, ); @@ -3695,6 +3779,8 @@ chat.openapi(completions, async (c) => { imageOutputTokens: costs.imageOutputTokens?.toString() ?? null, imageInputCost: costs.imageInputCost ?? null, imageOutputCost: costs.imageOutputCost ?? null, + audioInputTokens: costs.audioInputTokens?.toString() ?? null, + audioInputCost: costs.audioInputCost ?? null, cost: costs.totalCost ?? 0, estimatedCost: costs.estimatedCost, discount: costs.discount ?? null, @@ -3824,6 +3910,8 @@ chat.openapi(completions, async (c) => { cacheWrite1hTokens: cachedResponse.usage?.prompt_tokens_details?.cache_creation ?.ephemeral_1h_input_tokens ?? null, + audioInputTokens: + cachedResponse.usage?.prompt_tokens_details?.audio_tokens ?? null, }, ); @@ -3881,6 +3969,8 @@ chat.openapi(completions, async (c) => { imageOutputTokens: cachedCosts.imageOutputTokens?.toString() ?? null, imageInputCost: cachedCosts.imageInputCost ?? null, imageOutputCost: cachedCosts.imageOutputCost ?? null, + audioInputTokens: cachedCosts.audioInputTokens?.toString() ?? null, + audioInputCost: cachedCosts.audioInputCost ?? null, cost: cachedCosts.totalCost ?? 0, estimatedCost: cachedCosts.estimatedCost, discount: cachedCosts.discount ?? null, @@ -4496,6 +4586,7 @@ chat.openapi(completions, async (c) => { webSearchCost: streamingCosts.webSearchCost, imageInputCost: streamingCosts.imageInputCost, imageOutputCost: streamingCosts.imageOutputCost, + audioInputCost: streamingCosts.audioInputCost, totalCost: streamingCosts.totalCost, dataStorageCost: streamingCosts.dataStorageCost, }, @@ -4958,6 +5049,9 @@ chat.openapi(completions, async (c) => { cancelledCosts?.imageOutputTokens?.toString() ?? null, imageInputCost: cancelledCosts?.imageInputCost ?? null, imageOutputCost: cancelledCosts?.imageOutputCost ?? null, + audioInputTokens: + cancelledCosts?.audioInputTokens?.toString() ?? null, + audioInputCost: cancelledCosts?.audioInputCost ?? null, cost: cancelledCosts?.totalCost ?? null, estimatedCost: cancelledCosts?.estimatedCost ?? false, discount: cancelledCosts?.discount ?? null, @@ -5818,6 +5912,8 @@ chat.openapi(completions, async (c) => { let cacheCreationTokens: number | null = null; let cacheCreation5mTokens: number | null = null; let cacheCreation1hTokens: number | null = null; + let audioInputTokens: number | null = null; + let cachedAudioInputTokens: number | null = null; let streamingToolCalls = null; let imageByteSize = 0; // Track total image data size for token estimation let outputImageCount = 0; // Track number of output images for cost calculation @@ -6245,6 +6341,8 @@ chat.openapi(completions, async (c) => { { cacheWriteTokens: cacheCreationTokens, cacheWrite1hTokens: cacheCreation1hTokens, + audioInputTokens, + cachedAudioInputTokens, }, ); streamingCosts.dataStorageCost = toDataStorageCostNumber( @@ -6319,6 +6417,7 @@ chat.openapi(completions, async (c) => { webSearchCost: streamingCosts.webSearchCost, imageInputCost: streamingCosts.imageInputCost, imageOutputCost: streamingCosts.imageOutputCost, + audioInputCost: streamingCosts.audioInputCost, totalCost: streamingCosts.totalCost, dataStorageCost: streamingCosts.dataStorageCost, } @@ -6326,6 +6425,7 @@ chat.openapi(completions, async (c) => { cachedTokens, cacheCreationTokens, reasoningTokens, + audioInputTokens, }); const finalUsageChunk = { id: `chatcmpl-${Date.now()}`, @@ -7052,6 +7152,12 @@ chat.openapi(completions, async (c) => { if (usage.cacheCreation1hTokens !== null) { cacheCreation1hTokens = usage.cacheCreation1hTokens; } + if (usage.audioInputTokens !== null) { + audioInputTokens = usage.audioInputTokens; + } + if (usage.cachedAudioInputTokens !== null) { + cachedAudioInputTokens = usage.cachedAudioInputTokens; + } if ( usage.totalTokens === null && promptTokens !== null && @@ -7496,6 +7602,8 @@ chat.openapi(completions, async (c) => { imageOutputTokens: null, imageInputCost: null, imageOutputCost: null, + audioInputTokens: null, + audioInputCost: null, totalCost: null, promptTokens: null, completionTokens: null, @@ -7531,6 +7639,8 @@ chat.openapi(completions, async (c) => { { cacheWriteTokens: cacheCreationTokens, cacheWrite1hTokens: cacheCreation1hTokens, + audioInputTokens, + cachedAudioInputTokens, }, ); if (streamingCostsEarly.totalCost !== null) { @@ -7627,12 +7737,14 @@ chat.openapi(completions, async (c) => { webSearchCost: streamingCostsEarly.webSearchCost, imageInputCost: streamingCostsEarly.imageInputCost, imageOutputCost: streamingCostsEarly.imageOutputCost, + audioInputCost: streamingCostsEarly.audioInputCost, totalCost: streamingCostsEarly.totalCost, dataStorageCost: streamingCostsEarly.dataStorageCost, }, cachedTokens, cacheCreationTokens, reasoningTokens, + audioInputTokens, }); return earlyUsage; })(), @@ -7806,6 +7918,8 @@ chat.openapi(completions, async (c) => { imageOutputTokens: null, imageInputCost: null, imageOutputCost: null, + audioInputTokens: null, + audioInputCost: null, totalCost: null, promptTokens: null, completionTokens: null, @@ -7841,6 +7955,8 @@ chat.openapi(completions, async (c) => { { cacheWriteTokens: cacheCreationTokens, cacheWrite1hTokens: cacheCreation1hTokens, + audioInputTokens, + cachedAudioInputTokens, }, )); @@ -8007,6 +8123,8 @@ chat.openapi(completions, async (c) => { imageOutputTokens: costs.imageOutputTokens?.toString() ?? null, imageInputCost: costs.imageInputCost ?? null, imageOutputCost: costs.imageOutputCost ?? null, + audioInputTokens: costs.audioInputTokens?.toString() ?? null, + audioInputCost: costs.audioInputCost ?? null, cost: costs.totalCost, estimatedCost: costs.estimatedCost, discount: costs.discount, @@ -8571,6 +8689,8 @@ chat.openapi(completions, async (c) => { cancelledCosts?.imageOutputTokens?.toString() ?? null, imageInputCost: cancelledCosts?.imageInputCost ?? null, imageOutputCost: cancelledCosts?.imageOutputCost ?? null, + audioInputTokens: cancelledCosts?.audioInputTokens?.toString() ?? null, + audioInputCost: cancelledCosts?.audioInputCost ?? null, cost: cancelledCosts?.totalCost ?? null, estimatedCost: cancelledCosts?.estimatedCost ?? false, discount: cancelledCosts?.discount ?? null, @@ -9434,6 +9554,8 @@ chat.openapi(completions, async (c) => { cacheCreation1hTokens, imageInputTokens, imageOutputTokens, + audioInputTokens, + cachedAudioInputTokens, toolResults, images, annotations, @@ -9556,6 +9678,8 @@ chat.openapi(completions, async (c) => { { cacheWriteTokens: cacheCreationTokens, cacheWrite1hTokens: cacheCreation1hTokens, + audioInputTokens, + cachedAudioInputTokens, }, ); costs.dataStorageCost = toDataStorageCostNumber( @@ -9613,6 +9737,7 @@ chat.openapi(completions, async (c) => { webSearchCost: costs.webSearchCost, imageInputCost: costs.imageInputCost, imageOutputCost: costs.imageOutputCost, + audioInputCost: costs.audioInputCost, totalCost: costs.totalCost, dataStorageCost: costs.dataStorageCost, } @@ -9627,6 +9752,7 @@ chat.openapi(completions, async (c) => { imageOutputTokens, cacheCreation5mTokens, cacheCreation1hTokens, + audioInputTokens, ); // Extract plugin IDs for logging @@ -9765,6 +9891,8 @@ chat.openapi(completions, async (c) => { imageOutputTokens: costs.imageOutputTokens?.toString() ?? null, imageInputCost: costs.imageInputCost ?? null, imageOutputCost: costs.imageOutputCost ?? null, + audioInputTokens: costs.audioInputTokens?.toString() ?? null, + audioInputCost: costs.audioInputCost ?? null, cost: costs.totalCost, estimatedCost: costs.estimatedCost, discount: costs.discount, diff --git a/apps/gateway/src/chat/schemas/completions.ts b/apps/gateway/src/chat/schemas/completions.ts index ad40e7371..180dbd1eb 100644 --- a/apps/gateway/src/chat/schemas/completions.ts +++ b/apps/gateway/src/chat/schemas/completions.ts @@ -33,6 +33,26 @@ export const completionsRequestSchema = z.object({ detail: z.enum(["low", "high", "auto"]).optional(), }), }), + z.object({ + type: z.literal("input_audio"), + input_audio: z.object({ + data: z.string(), + format: z.enum([ + "wav", + "mp3", + "aiff", + "aac", + "ogg", + "flac", + "m4a", + "mpeg", + "mpga", + "mp4", + "pcm", + "webm", + ]), + }), + }), ]), ), ]) diff --git a/apps/gateway/src/chat/tools/extract-token-usage.ts b/apps/gateway/src/chat/tools/extract-token-usage.ts index ffd79875b..7e322cfad 100644 --- a/apps/gateway/src/chat/tools/extract-token-usage.ts +++ b/apps/gateway/src/chat/tools/extract-token-usage.ts @@ -73,6 +73,8 @@ export function extractTokenUsage( let cacheCreationTokens = null; let cacheCreation5mTokens: number | null = null; let cacheCreation1hTokens: number | null = null; + let audioInputTokens: number | null = null; + let cachedAudioInputTokens: number | null = null; switch (provider) { case "google-ai-studio": @@ -85,6 +87,21 @@ export function extractTokenUsage( reasoningTokens = data.usageMetadata.thoughtsTokenCount ?? null; // Extract cached tokens from Google's implicit caching cachedTokens = data.usageMetadata.cachedContentTokenCount ?? null; + if (Array.isArray(data.usageMetadata.promptTokensDetails)) { + for (const detail of data.usageMetadata.promptTokensDetails) { + if (detail?.modality === "AUDIO" && detail.tokenCount) { + audioInputTokens = (audioInputTokens ?? 0) + detail.tokenCount; + } + } + } + if (Array.isArray(data.usageMetadata.cacheTokensDetails)) { + for (const detail of data.usageMetadata.cacheTokensDetails) { + if (detail?.modality === "AUDIO" && detail.tokenCount) { + cachedAudioInputTokens = + (cachedAudioInputTokens ?? 0) + detail.tokenCount; + } + } + } // Adjust for inconsistent Google API behavior where // candidatesTokenCount may already include thoughtsTokenCount @@ -214,5 +231,7 @@ export function extractTokenUsage( cacheCreationTokens, cacheCreation5mTokens, cacheCreation1hTokens, + audioInputTokens, + cachedAudioInputTokens, }; } diff --git a/apps/gateway/src/chat/tools/messages-contain-audio.spec.ts b/apps/gateway/src/chat/tools/messages-contain-audio.spec.ts new file mode 100644 index 000000000..b00c9fdaf --- /dev/null +++ b/apps/gateway/src/chat/tools/messages-contain-audio.spec.ts @@ -0,0 +1,176 @@ +import { describe, expect, it } from "vitest"; + +import { models } from "@llmgateway/models"; + +import { + getAudioFormatsFromMessages, + messagesContainAudio, +} from "./messages-contain-audio.js"; + +import type { BaseMessage, ProviderModelMapping } from "@llmgateway/models"; + +describe("messagesContainAudio", () => { + it("returns false for plain text-only messages", () => { + const msgs: BaseMessage[] = [{ role: "user", content: "hello" }]; + expect(messagesContainAudio(msgs)).toBe(false); + }); + + it("returns false for image-only multipart content", () => { + const msgs: BaseMessage[] = [ + { + role: "user", + content: [ + { type: "text", text: "describe this" }, + { type: "image_url", image_url: { url: "data:image/png;base64,A" } }, + ], + }, + ]; + expect(messagesContainAudio(msgs)).toBe(false); + }); + + it("returns true when any part is input_audio", () => { + const msgs: BaseMessage[] = [ + { + role: "user", + content: [ + { type: "text", text: "transcribe" }, + { + type: "input_audio", + input_audio: { data: "AAAA", format: "wav" }, + }, + ], + }, + ]; + expect(messagesContainAudio(msgs)).toBe(true); + }); + + it("returns true even when audio is in a later message", () => { + const msgs: BaseMessage[] = [ + { role: "system", content: "be terse" }, + { role: "user", content: "hi" }, + { + role: "user", + content: [ + { + type: "input_audio", + input_audio: { data: "AAAA", format: "mp3" }, + }, + ], + }, + ]; + expect(messagesContainAudio(msgs)).toBe(true); + }); +}); + +describe("getAudioFormatsFromMessages", () => { + it("returns empty for non-audio messages", () => { + const msgs: BaseMessage[] = [{ role: "user", content: "hello" }]; + expect(getAudioFormatsFromMessages(msgs)).toEqual([]); + }); + + it("returns the format from a single audio block", () => { + const msgs: BaseMessage[] = [ + { + role: "user", + content: [ + { + type: "input_audio", + input_audio: { data: "AAAA", format: "wav" }, + }, + ], + }, + ]; + expect(getAudioFormatsFromMessages(msgs)).toEqual(["wav"]); + }); + + it("deduplicates across multiple audio blocks", () => { + const msgs: BaseMessage[] = [ + { + role: "user", + content: [ + { + type: "input_audio", + input_audio: { data: "A", format: "mp3" }, + }, + { + type: "input_audio", + input_audio: { data: "B", format: "mp3" }, + }, + { + type: "input_audio", + input_audio: { data: "C", format: "m4a" }, + }, + ], + }, + ]; + const formats = getAudioFormatsFromMessages(msgs); + expect(formats.sort()).toEqual(["m4a", "mp3"]); + }); +}); + +describe("Gemini audio capability flag", () => { + const expectedAudioFlashModelIds = [ + "gemini-2.0-flash", + "gemini-2.5-flash", + "gemini-2.5-flash-lite", + "gemini-3-flash-preview", + "gemini-3.1-flash-lite", + ]; + + for (const id of expectedAudioFlashModelIds) { + const model = models.find((m) => m.id === id); + if (!model) { + continue; + } + const providers = model.providers as readonly ProviderModelMapping[]; + const audioCapableProviders = providers.filter((p) => p.audio === true); + const audioPricedProviders = providers.filter( + (p) => p.inputAudioPrice !== undefined, + ); + it(`marks every audio-priced provider on ${id} as audio: true`, () => { + expect(audioCapableProviders.length).toBe(audioPricedProviders.length); + expect(audioCapableProviders.length).toBeGreaterThan(0); + }); + } + + const expectedAudioProModelIds = [ + "gemini-2.5-pro", + "gemini-3-pro-preview", + "gemini-3.1-pro-preview", + "gemini-1.5-pro", + "gemini-1.5-flash", + "gemini-1.5-flash-8b", + "gemini-2.0-flash-lite", + ]; + + for (const id of expectedAudioProModelIds) { + const model = models.find((m) => m.id === id); + if (!model) { + continue; + } + const providers = model.providers as readonly ProviderModelMapping[]; + const audioCapableProviders = providers.filter((p) => p.audio === true); + it(`marks Pro/legacy audio-capable model ${id} on every provider`, () => { + expect(audioCapableProviders.length).toBe(providers.length); + expect(audioCapableProviders.length).toBeGreaterThan(0); + }); + } + + it("does not flag image-only Gemini variants as audio-capable", () => { + const imageOnlyIds = [ + "gemini-2.5-flash-image", + "gemini-2.5-flash-image-preview", + "gemini-3-pro-image-preview", + "gemini-3.1-flash-image-preview", + ]; + for (const id of imageOnlyIds) { + const model = models.find((m) => m.id === id); + if (!model) { + continue; + } + const providers = model.providers as readonly ProviderModelMapping[]; + const audioCapableProviders = providers.filter((p) => p.audio === true); + expect(audioCapableProviders.length).toBe(0); + } + }); +}); diff --git a/apps/gateway/src/chat/tools/messages-contain-audio.ts b/apps/gateway/src/chat/tools/messages-contain-audio.ts new file mode 100644 index 000000000..c265c4e20 --- /dev/null +++ b/apps/gateway/src/chat/tools/messages-contain-audio.ts @@ -0,0 +1,51 @@ +import type { BaseMessage } from "@llmgateway/models"; + +/** + * Checks if any messages contain `input_audio` content blocks. Used to filter + * providers/models that do not accept audio input when the router is selecting + * a target (model: "auto") or when validating an explicit selection. + */ +export function messagesContainAudio(messages: BaseMessage[]): boolean { + for (const message of messages) { + if (Array.isArray(message.content)) { + for (const part of message.content) { + if ( + typeof part === "object" && + part !== null && + "type" in part && + part.type === "input_audio" + ) { + return true; + } + } + } + } + return false; +} + +/** + * Returns the distinct audio formats present in the message stream's + * `input_audio` blocks. Empty array if there are no audio parts. Used by the + * router to filter providers that cannot handle the requested formats. + */ +export function getAudioFormatsFromMessages(messages: BaseMessage[]): string[] { + const formats = new Set(); + for (const message of messages) { + if (Array.isArray(message.content)) { + for (const part of message.content) { + if ( + typeof part === "object" && + part !== null && + "type" in part && + part.type === "input_audio" && + "input_audio" in part && + part.input_audio && + typeof (part.input_audio as { format?: unknown }).format === "string" + ) { + formats.add((part.input_audio as { format: string }).format); + } + } + } + } + return [...formats]; +} diff --git a/apps/gateway/src/chat/tools/parse-provider-response.ts b/apps/gateway/src/chat/tools/parse-provider-response.ts index d4c512dcb..6ac31a855 100644 --- a/apps/gateway/src/chat/tools/parse-provider-response.ts +++ b/apps/gateway/src/chat/tools/parse-provider-response.ts @@ -38,6 +38,8 @@ export function parseProviderResponse( let cacheCreation1hTokens: number | null = null; let imageInputTokens: number | null = null; let imageOutputTokens: number | null = null; + let audioInputTokens: number | null = null; + let cachedAudioInputTokens: number | null = null; let toolResults = null; let images: ImageObject[] = []; const annotations: Annotation[] = []; @@ -396,6 +398,21 @@ export function parseProviderResponse( reasoningTokens = json.usageMetadata?.thoughtsTokenCount ?? null; // Extract cached tokens from Google's implicit caching cachedTokens = json.usageMetadata?.cachedContentTokenCount ?? null; + if (Array.isArray(json.usageMetadata?.promptTokensDetails)) { + for (const detail of json.usageMetadata.promptTokensDetails) { + if (detail?.modality === "AUDIO" && detail.tokenCount) { + audioInputTokens = (audioInputTokens ?? 0) + detail.tokenCount; + } + } + } + if (Array.isArray(json.usageMetadata?.cacheTokensDetails)) { + for (const detail of json.usageMetadata.cacheTokensDetails) { + if (detail?.modality === "AUDIO" && detail.tokenCount) { + cachedAudioInputTokens = + (cachedAudioInputTokens ?? 0) + detail.tokenCount; + } + } + } // Adjust for inconsistent Google API behavior where // candidatesTokenCount may already include thoughtsTokenCount @@ -900,6 +917,8 @@ export function parseProviderResponse( cacheCreation1hTokens, imageInputTokens, imageOutputTokens, + audioInputTokens, + cachedAudioInputTokens, toolResults, images, annotations: annotations.length > 0 ? annotations : null, diff --git a/apps/gateway/src/chat/tools/transform-response-to-openai.ts b/apps/gateway/src/chat/tools/transform-response-to-openai.ts index e83910483..b76d345be 100644 --- a/apps/gateway/src/chat/tools/transform-response-to-openai.ts +++ b/apps/gateway/src/chat/tools/transform-response-to-openai.ts @@ -13,6 +13,7 @@ export interface CostData { webSearchCost: number | null; imageInputCost: number | null; imageOutputCost: number | null; + audioInputCost?: number | null; totalCost: number | null; dataStorageCost?: number | null; } @@ -28,6 +29,7 @@ export function applyExtendedUsageFields( reasoningTokens?: number | null; imageInputTokens?: number | null; imageOutputTokens?: number | null; + audioInputTokens?: number | null; }, ): Record { const { @@ -39,6 +41,7 @@ export function applyExtendedUsageFields( reasoningTokens, imageInputTokens, imageOutputTokens, + audioInputTokens, } = options; if (costs) { @@ -70,6 +73,7 @@ export function applyExtendedUsageFields( web_search_cost: costs.webSearchCost, image_input_cost: costs.imageInputCost, image_output_cost: costs.imageOutputCost, + audio_input_cost: costs.audioInputCost ?? null, ...(costs.dataStorageCost !== null && costs.dataStorageCost !== undefined && { data_storage_cost: costs.dataStorageCost, @@ -89,6 +93,8 @@ export function applyExtendedUsageFields( 0; const resolvedPromptImageTokens = imageInputTokens ?? existingPromptDetails.image_tokens ?? 0; + const resolvedPromptAudioTokens = + audioInputTokens ?? existingPromptDetails.audio_tokens ?? 0; // `cache_write_tokens` is the canonical field; `cache_creation_tokens` is emitted // alongside it for backward compatibility with consumers that read the older name. // Readers should prefer `cache_write_tokens ?? cache_creation_tokens`. @@ -115,7 +121,7 @@ export function applyExtendedUsageFields( ...existingPromptDetails, cached_tokens: resolvedCacheRead, cache_write_tokens: resolvedCacheWrite, - audio_tokens: existingPromptDetails.audio_tokens ?? 0, + audio_tokens: resolvedPromptAudioTokens, video_tokens: existingPromptDetails.video_tokens ?? 0, image_tokens: resolvedPromptImageTokens, ...(resolvedCacheWrite > 0 && { @@ -249,6 +255,7 @@ function buildUsageObject( imageOutputTokens: number | null = null, cacheCreation5mTokens: number | null = null, cacheCreation1hTokens: number | null = null, + audioInputTokens: number | null = null, ) { const usage: Record = { prompt_tokens: Math.max(1, promptTokens ?? 1), @@ -275,6 +282,7 @@ function buildUsageObject( reasoningTokens, imageInputTokens, imageOutputTokens, + audioInputTokens, }); return usage; @@ -311,6 +319,7 @@ export function transformResponseToOpenai( imageOutputTokens: number | null = null, cacheCreation5mTokens: number | null = null, cacheCreation1hTokens: number | null = null, + audioInputTokens: number | null = null, ) { let transformedResponse = json; @@ -357,6 +366,7 @@ export function transformResponseToOpenai( imageOutputTokens, cacheCreation5mTokens, cacheCreation1hTokens, + audioInputTokens, ), metadata: buildMetadata( requestedModel, @@ -409,6 +419,7 @@ export function transformResponseToOpenai( imageOutputTokens, cacheCreation5mTokens, cacheCreation1hTokens, + audioInputTokens, ), metadata: buildMetadata( requestedModel, @@ -551,6 +562,7 @@ export function transformResponseToOpenai( imageOutputTokens, cacheCreation5mTokens, cacheCreation1hTokens, + audioInputTokens, ), metadata: buildMetadata( requestedModel, diff --git a/apps/gateway/src/lib/costs.spec.ts b/apps/gateway/src/lib/costs.spec.ts index a8c66af85..942aea691 100644 --- a/apps/gateway/src/lib/costs.spec.ts +++ b/apps/gateway/src/lib/costs.spec.ts @@ -873,6 +873,108 @@ describe("calculateCosts", () => { expect(result.imageOutputCost).toBeGreaterThan(0); }); + it("does not subtract text-cached tokens from audio billing on Gemini 2.5 Flash-Lite", async () => { + // Repro for the prior bug: 100 audio tokens + 50 cached tokens that are + // entirely text. The pre-fix code subtracted ALL cachedReadTokens from + // audioInputTokens, leaving 50 audio billable. With the fix, audio + // billing is reduced only by the reported cachedAudioInputTokens (here + // 0), so all 100 audio tokens are billed at the audio rate. + const promptTokens = 200; + const audioInputTokens = 100; + const cachedTokens = 50; + const result = await calculateCosts( + "gemini-2.5-flash-lite", + "google-ai-studio", + promptTokens, + 0, + cachedTokens, + undefined, + null, + 0, + undefined, + 0, + null, + null, + undefined, + null, + null, + { audioInputTokens, cachedAudioInputTokens: 0 }, + ); + expect(result.audioInputCost).toBeCloseTo(audioInputTokens * (0.3 / 1e6)); + expect(result.cachedInputCost).toBeCloseTo(cachedTokens * (0.01 / 1e6)); + }); + + it("bills cached audio at cachedInputAudioPrice on Gemini 2.5 Flash", async () => { + // 100 audio tokens, all cached. Pre-fix: charged at cached text rate + // ($0.03/M). Post-fix: charged at cached audio rate ($0.10/M). + const audioInputTokens = 100; + const cachedAudioInputTokens = 100; + const cachedTokens = 100; + const result = await calculateCosts( + "gemini-2.5-flash", + "google-ai-studio", + audioInputTokens, // entire prompt is audio + 0, + cachedTokens, + undefined, + null, + 0, + undefined, + 0, + null, + null, + undefined, + null, + null, + { audioInputTokens, cachedAudioInputTokens }, + ); + expect(result.audioInputCost).toBeNull(); + expect(result.cachedInputCost).toBeCloseTo( + cachedAudioInputTokens * (0.1 / 1e6), + ); + }); + + it("splits mixed text+audio cache correctly on Gemini 2.0 Flash", async () => { + // 80 audio (60 cached) + 120 text (40 cached). Audio cache @ $0.175/M, + // text cache @ $0.025/M, uncached audio @ $0.70/M, uncached text @ + // $0.10/M (AI Studio). + const promptTokens = 200; + const audioInputTokens = 80; + const cachedAudioInputTokens = 60; + const cachedTokens = 100; + const result = await calculateCosts( + "gemini-2.0-flash", + "google-ai-studio", + promptTokens, + 0, + cachedTokens, + undefined, + null, + 0, + undefined, + 0, + null, + null, + undefined, + null, + null, + { audioInputTokens, cachedAudioInputTokens }, + ); + const uncachedAudio = audioInputTokens - cachedAudioInputTokens; + const uncachedText = + promptTokens - audioInputTokens - (cachedTokens - cachedAudioInputTokens); + expect(result.audioInputCost).toBeCloseTo(uncachedAudio * (0.7 / 1e6)); + const uncachedTextCost = uncachedText * (0.1 / 1e6); + const uncachedAudioCost = uncachedAudio * (0.7 / 1e6); + expect(result.inputCost).toBeCloseTo(uncachedTextCost + uncachedAudioCost); + const cachedText = cachedTokens - cachedAudioInputTokens; + const cachedAudioCost = cachedAudioInputTokens * (0.175 / 1e6); + const cachedTextCost = cachedText * (0.025 / 1e6); + expect(result.cachedInputCost).toBeCloseTo( + cachedTextCost + cachedAudioCost, + ); + }); + it("should compute exact cost values without IEEE-754 noise", async () => { // gpt-4o-mini has inputPrice 0.15/1e6 and outputPrice 0.6/1e6. Raw JS // arithmetic on these prices produces values like 2.5000000000000004e-7 diff --git a/apps/gateway/src/lib/costs.ts b/apps/gateway/src/lib/costs.ts index f48525b10..27aa9f412 100644 --- a/apps/gateway/src/lib/costs.ts +++ b/apps/gateway/src/lib/costs.ts @@ -120,10 +120,14 @@ export async function calculateCosts( options?: { cacheWriteTokens?: number | null; cacheWrite1hTokens?: number | null; + audioInputTokens?: number | null; + cachedAudioInputTokens?: number | null; }, ) { const cacheWriteTokens = options?.cacheWriteTokens ?? null; const cacheWrite1hTokens = options?.cacheWrite1hTokens ?? null; + const audioInputTokens = options?.audioInputTokens ?? null; + const cachedAudioInputTokens = options?.cachedAudioInputTokens ?? null; // Find the model info - try both base model name and provider model name // Strip :region suffix if present (e.g., "deepseek-v3.2:cn-beijing" → "deepseek-v3.2") @@ -152,6 +156,8 @@ export async function calculateCosts( imageOutputTokens: null, imageInputCost: null, imageOutputCost: null, + audioInputTokens: null, + audioInputCost: null, totalCost: null, dataStorageCost: null as number | null, promptTokens, @@ -226,6 +232,8 @@ export async function calculateCosts( imageOutputTokens: null, imageInputCost: null, imageOutputCost: null, + audioInputTokens: null, + audioInputCost: null, totalCost: null, dataStorageCost: null as number | null, promptTokens: calculatedPromptTokens, @@ -267,6 +275,8 @@ export async function calculateCosts( imageOutputTokens: null, imageInputCost: null, imageOutputCost: null, + audioInputTokens: null, + audioInputCost: null, totalCost: null, dataStorageCost: null as number | null, promptTokens: calculatedPromptTokens, @@ -398,7 +408,20 @@ export async function calculateCosts( Math.round(cachedReadTokens * imageRatio), ); } - const cachedTextTokens = cachedReadTokens - cachedImageTokens; + // Cached audio tokens (Google reports these via cacheTokensDetails[] with + // modality=AUDIO). They're a subset of cachedReadTokens and must be billed + // at the model's cachedInputAudioPrice rather than the cheaper text-cache + // rate. When the upstream split is missing, we fall back to 0 cached audio + // rather than over-attributing. + const reportedCachedAudio = cachedAudioInputTokens ?? 0; + const audioCacheable = audioInputTokens ?? 0; + const safeCachedAudioTokens = Math.min( + reportedCachedAudio, + audioCacheable, + Math.max(0, cachedReadTokens - cachedImageTokens), + ); + const cachedTextTokens = + cachedReadTokens - cachedImageTokens - safeCachedAudioTokens; const uncachedImageTokens = imageInputTokens ? Math.max(0, imageInputTokens - cachedImageTokens) : 0; @@ -408,15 +431,34 @@ export async function calculateCosts( .times(imageInputPricePerToken) .times(discountMultiplier); } - const billableTextPromptTokens = - promptIncludesImageTokens && imageInputTokens - ? Math.max(0, uncachedPromptTokens - uncachedImageTokens) - : uncachedPromptTokens; - // inputCost includes both text and image input costs when applicable + // Audio input tokens are reported separately by Google and OpenAI but are + // included in the upstream prompt-token total, so we subtract them from the + // text-billable count and price them at inputAudioPrice (falling back to + // inputPrice when the model doesn't price audio separately). Cached audio + // portion is billed via cachedInputAudioPrice in cachedInputCost below. + const audioInputPricePerToken = + providerInfo.inputAudioPrice ?? pricing.inputPrice; + const billableAudioInputTokens = audioInputTokens + ? Math.max(0, audioInputTokens - safeCachedAudioTokens) + : 0; + let audioInputCost: Decimal | null = null; + if (billableAudioInputTokens > 0 && audioInputPricePerToken) { + audioInputCost = new Decimal(billableAudioInputTokens) + .times(audioInputPricePerToken) + .times(discountMultiplier); + } + const billableTextPromptTokens = Math.max( + 0, + (promptIncludesImageTokens && imageInputTokens + ? uncachedPromptTokens - uncachedImageTokens + : uncachedPromptTokens) - billableAudioInputTokens, + ); + // inputCost includes text, image, and audio input costs when applicable const inputCost = new Decimal(billableTextPromptTokens) .times(inputPrice) .times(discountMultiplier) - .plus(imageInputCost ?? 0); + .plus(imageInputCost ?? 0) + .plus(audioInputCost ?? 0); // For Google models, completionTokens already includes reasoning tokens // (merged during extraction). For other providers, add reasoning separately. @@ -470,12 +512,21 @@ export async function calculateCosts( cachedImageInputPricePerToken !== undefined ? new Decimal(cachedImageInputPricePerToken) : cachedInputPrice; + const cachedInputAudioPriceDecimal = + providerInfo.cachedInputAudioPrice !== undefined + ? new Decimal(providerInfo.cachedInputAudioPrice) + : cachedInputPrice; const cachedInputCost = cachedTokens ? new Decimal(cachedTextTokens) .times(cachedInputPrice) .plus( new Decimal(cachedImageTokens).times(cachedImageInputPriceDecimal), ) + .plus( + new Decimal(safeCachedAudioTokens).times( + cachedInputAudioPriceDecimal, + ), + ) .times(discountMultiplier) : new Decimal(0); // `cacheWriteTokens` is the total cache-creation tokens (5m + 1h). @@ -530,6 +581,8 @@ export async function calculateCosts( imageOutputTokens, imageInputCost: imageInputCost?.toNumber() ?? null, imageOutputCost: imageOutputCost?.toNumber() ?? null, + audioInputTokens, + audioInputCost: audioInputCost?.toNumber() ?? null, totalCost: totalCost.toNumber(), dataStorageCost: null as number | null, // Only add image input tokens to promptTokens for providers whose upstream diff --git a/apps/gateway/src/responses/tools/convert-chat-to-responses.ts b/apps/gateway/src/responses/tools/convert-chat-to-responses.ts index 895faaba2..49883605a 100644 --- a/apps/gateway/src/responses/tools/convert-chat-to-responses.ts +++ b/apps/gateway/src/responses/tools/convert-chat-to-responses.ts @@ -54,6 +54,7 @@ interface ChatCompletionsResponse { web_search_cost?: number | null; image_input_cost?: number | null; image_output_cost?: number | null; + audio_input_cost?: number | null; data_storage_cost?: number | null; }; }; @@ -90,6 +91,7 @@ export interface ResponsesApiUsage { web_search_cost?: number | null; image_input_cost?: number | null; image_output_cost?: number | null; + audio_input_cost?: number | null; data_storage_cost?: number | null; }; } diff --git a/apps/gateway/src/responses/tools/convert-streaming-to-responses.ts b/apps/gateway/src/responses/tools/convert-streaming-to-responses.ts index bbb8bfcd4..2598935f0 100644 --- a/apps/gateway/src/responses/tools/convert-streaming-to-responses.ts +++ b/apps/gateway/src/responses/tools/convert-streaming-to-responses.ts @@ -46,6 +46,7 @@ interface StreamingState { web_search_cost?: number | null; image_input_cost?: number | null; image_output_cost?: number | null; + audio_input_cost?: number | null; data_storage_cost?: number | null; }; }; diff --git a/apps/gateway/src/test-fixtures/test-audio.wav b/apps/gateway/src/test-fixtures/test-audio.wav new file mode 100644 index 000000000..56b590d8c Binary files /dev/null and b/apps/gateway/src/test-fixtures/test-audio.wav differ diff --git a/apps/playground/package.json b/apps/playground/package.json index 411352d61..a1fcb7505 100644 --- a/apps/playground/package.json +++ b/apps/playground/package.json @@ -21,7 +21,7 @@ "@ai-sdk/react": "3.0.29", "@better-auth/passkey": "1.6.9", "@hookform/resolvers": "5.2.2", - "@llmgateway/ai-sdk-provider": "3.7.0", + "@llmgateway/ai-sdk-provider": "3.8.0", "@llmgateway/models": "workspace:*", "@llmgateway/shared": "workspace:*", "@modelcontextprotocol/sdk": "1.29.0", diff --git a/apps/playground/src/app/share/[shareId]/page.tsx b/apps/playground/src/app/share/[shareId]/page.tsx index f9fc1ef21..8abe2b8d2 100644 --- a/apps/playground/src/app/share/[shareId]/page.tsx +++ b/apps/playground/src/app/share/[shareId]/page.tsx @@ -15,6 +15,7 @@ interface SharedMessage { role: "user" | "assistant" | "system"; content: string | null; images: string | null; + audios: string | null; reasoning: string | null; tools: string | null; metadata?: unknown; @@ -22,6 +23,13 @@ interface SharedMessage { createdAt: string; } +interface StoredAudioPart { + type?: string; + url?: string; + mediaType?: string; + name?: string; +} + interface SharedChatResponse { share: { id: string; @@ -186,6 +194,27 @@ function toUiMessage(message: SharedMessage): UIMessage { } } + if (message.audios) { + try { + const parsedAudios = JSON.parse(message.audios) as unknown; + if (Array.isArray(parsedAudios)) { + for (const audio of parsedAudios.filter(isStoredAudioPart)) { + if (!audio.url) { + continue; + } + parts.push({ + type: "file", + mediaType: audio.mediaType ?? "audio/mpeg", + url: audio.url, + ...(audio.name ? { name: audio.name } : {}), + }); + } + } + } catch { + // Ignore malformed legacy audio payloads in public snapshots. + } + } + if (message.tools) { try { const parsedTools = JSON.parse(message.tools) as unknown; @@ -219,6 +248,15 @@ function isStoredImagePart(value: unknown): value is StoredImagePart { ); } +function isStoredAudioPart(value: unknown): value is StoredAudioPart { + return ( + typeof value === "object" && + value !== null && + "url" in value && + typeof (value as { url?: unknown }).url === "string" + ); +} + function isToolUiPart(value: unknown): value is UIMessage["parts"][number] { return ( typeof value === "object" && diff --git a/apps/playground/src/components/ai-elements/prompt-input.tsx b/apps/playground/src/components/ai-elements/prompt-input.tsx index 2d44c02b0..b9cac5a9a 100644 --- a/apps/playground/src/components/ai-elements/prompt-input.tsx +++ b/apps/playground/src/components/ai-elements/prompt-input.tsx @@ -4,6 +4,7 @@ import { ImageIcon, Loader2Icon, MicIcon, + Music2Icon, PaperclipIcon, PlusIcon, SendIcon, @@ -250,12 +251,45 @@ export function PromptInputAttachment({ const attachments = usePromptInputAttachments(); const mediaType = - data.mediaType?.startsWith("image/") && data.url ? "image" : "file"; + data.mediaType?.startsWith("image/") && data.url + ? "image" + : data.mediaType?.startsWith("audio/") && data.url + ? "audio" + : "file"; + + if (mediaType === "audio") { + return ( +
+
+ +
+ +
+ ); + } return (
{ - e.preventDefault(); + onSelect={() => { attachments.openFileDialog(); }} > @@ -473,11 +506,23 @@ export const PromptInput = ({ if (!accept || accept.trim() === "") { return true; } - if (accept.includes("image/*")) { - return f.type.startsWith("image/"); + const patterns = accept + .split(",") + .map((p) => p.trim()) + .filter(Boolean); + if (patterns.length === 0) { + return true; } - // NOTE: keep simple; expand as needed - return true; + return patterns.some((pattern) => { + if (pattern.endsWith("/*")) { + const prefix = pattern.slice(0, -1); + return f.type.startsWith(prefix); + } + if (pattern.startsWith(".")) { + return f.name.toLowerCase().endsWith(pattern.toLowerCase()); + } + return f.type === pattern; + }); }, [accept], ); diff --git a/apps/playground/src/components/playground/chat-page-client.tsx b/apps/playground/src/components/playground/chat-page-client.tsx index 8b811ca48..0c2bed045 100644 --- a/apps/playground/src/components/playground/chat-page-client.tsx +++ b/apps/playground/src/components/playground/chat-page-client.tsx @@ -442,6 +442,14 @@ export default function ChatPageClient({ return !!mapping?.vision; }, [models, selectedModel]); + const supportsAudio = useMemo(() => { + let model = availableModels.find((m) => m.id === selectedModel); + if (!model && !selectedModel.includes("/")) { + model = availableModels.find((m) => m.id.endsWith(`/${selectedModel}`)); + } + return !!model?.audio; + }, [availableModels, selectedModel]); + const supportsImageGen = useMemo(() => { if (!selectedModel) { return false; @@ -702,6 +710,27 @@ export default function ChatPageClient({ } } + if (msg.audios) { + try { + const parsedAudios = JSON.parse(msg.audios); + if (Array.isArray(parsedAudios)) { + for (const a of parsedAudios) { + if (!a?.url) { + continue; + } + parts.push({ + type: "file", + mediaType: a.mediaType ?? "audio/mpeg", + url: a.url, + ...(a.name ? { name: a.name } : {}), + }); + } + } + } catch (error) { + toast.error("Failed to parse audios: " + getErrorMessage(error)); + } + } + if ((msg as any).tools) { try { const parsedTools = JSON.parse((msg as any).tools); @@ -819,6 +848,12 @@ export default function ChatPageClient({ type: "image_url"; image_url: { url: string }; }>, + audio?: Array<{ + type: "audio"; + url: string; + mediaType: string; + name?: string; + }>, ) => { if (selectedOrganization && Number(selectedOrganization.credits) <= 0) { setShowTopUp(true); @@ -831,6 +866,7 @@ export default function ChatPageClient({ posthog.capture("playground_chat_sent", { model: selectedModel, has_images: !!images?.length, + has_audio: !!audio?.length, web_search: webSearchEnabled, }); errorOccurredRef.current = false; @@ -869,6 +905,7 @@ export default function ChatPageClient({ role: "user", ...(content.trim() ? { content } : {}), ...(images?.length ? { images: JSON.stringify(images) } : {}), + ...(audio?.length ? { audios: JSON.stringify(audio) } : {}), }, }); } catch (error: any) { @@ -887,6 +924,7 @@ export default function ChatPageClient({ role: "user", ...(content.trim() ? { content } : {}), ...(images?.length ? { images: JSON.stringify(images) } : {}), + ...(audio?.length ? { audios: JSON.stringify(audio) } : {}), }, }); setIsLoading(false); @@ -1268,6 +1306,7 @@ export default function ChatPageClient({ { + let model = availableModels.find((m) => m.id === selectedModel); + if (!model && !selectedModel.includes("/")) { + model = availableModels.find((m) => m.id.endsWith(`/${selectedModel}`)); + } + return !!model?.audio; + }, [availableModels, selectedModel]); + const supportsReasoning = useMemo(() => { if (!selectedModel) { return false; @@ -1695,6 +1743,7 @@ function ExtraChatPanel({ , + audio?: Array<{ + type: "audio"; + url: string; + mediaType: string; + name?: string; + }>, ) => Promise; isLoading?: boolean; error?: string | null; @@ -207,6 +214,7 @@ type HeroSuggestionGroup = keyof typeof heroSuggestionGroups; interface ExtractedParts { textParts: string[]; imageParts: any[]; + audioParts: any[]; toolParts: any[]; reasoningContent: string; sourceParts: any[]; @@ -215,6 +223,7 @@ interface ExtractedParts { function extractMessageParts(parts: any[]): ExtractedParts { const textParts: string[] = []; const imageParts: any[] = []; + const audioParts: any[] = []; const toolParts: any[] = []; const reasoningParts: string[] = []; const sourceParts: any[] = []; @@ -234,12 +243,15 @@ function extractMessageParts(parts: any[]): ExtractedParts { (p.type === "file" && p.mediaType?.startsWith("image/")) ) { imageParts.push(p); + } else if (p.type === "file" && p.mediaType?.startsWith("audio/")) { + audioParts.push(p); } } return { textParts, imageParts, + audioParts, toolParts, reasoningContent: reasoningParts.join(""), sourceParts, @@ -475,7 +487,7 @@ const UserMessage = memo( isLastMessage: boolean; status: string; }) => { - const { textParts, imageParts } = useMemo( + const { textParts, imageParts, audioParts } = useMemo( () => extractMessageParts(message.parts), [message.parts], ); @@ -506,6 +518,21 @@ const UserMessage = memo( })}
)} + {audioParts.length > 0 && ( +
+ {audioParts.map((part: any, idx: number) => ( + + ))} +
+ )} {isLastMessage && (status === "submitted" || status === "streaming") && } @@ -549,6 +576,7 @@ export function ReadOnlyChatMessages({ messages }: { messages: UIMessage[] }) { export const ChatUI = ({ messages, supportsImages, + supportsAudio, supportsImageGen, sendMessage, selectedModel, @@ -674,6 +702,18 @@ export const ChatUI = ({ })) : undefined; + const audioToSave = + supportsAudio && files?.length + ? files + .filter((f) => f.mediaType?.startsWith("audio/") && f.url) + .map((f) => ({ + type: "audio" as const, + url: f.url!, + mediaType: f.mediaType!, + ...(f.filename ? { name: f.filename } : {}), + })) + : undefined; + if (content.trim()) { parts.push({ type: "text", text: content }); } @@ -693,14 +733,30 @@ export const ChatUI = ({ } } + if (supportsAudio && files?.length) { + for (const file of files) { + if (file.mediaType?.startsWith("audio/") && file.url) { + parts.push({ + type: "file", + url: file.url, + mediaType: file.mediaType, + name: file.filename, + }); + } + } + } + if (parts.length === 0) { return; } // Ensure the chat exists + user message is persisted BEFORE streaming starts. // Otherwise `onFinish` may run before `chatIdRef` is set, and we can't save the AI response. - if (onUserMessage && (content.trim() || imagesToSave?.length)) { - await onUserMessage(content, imagesToSave); + if ( + onUserMessage && + (content.trim() || imagesToSave?.length || audioToSave?.length) + ) { + await onUserMessage(content, imagesToSave, audioToSave); } // Call sendMessage which will handle adding the user message and API request @@ -881,10 +937,18 @@ export const ChatUI = ({ transition={{ duration: 0.18, ease: "easeOut" }} > { void handlePromptSubmit(message.text ?? "", message.files); @@ -903,11 +967,19 @@ export const ChatUI = ({ - {supportsImages && ( + {(supportsImages || supportsAudio) && ( - + )} diff --git a/apps/playground/src/hooks/useChats.ts b/apps/playground/src/hooks/useChats.ts index 110111f55..56104ac8c 100644 --- a/apps/playground/src/hooks/useChats.ts +++ b/apps/playground/src/hooks/useChats.ts @@ -22,6 +22,7 @@ export interface ChatMessage { role: "user" | "assistant" | "system"; content: string | null; images: string | null; // JSON string from API + audios: string | null; // JSON string of audio attachments reasoning: string | null; // Reasoning content from AI tools: string | null; // Tool parts JSON metadata: unknown | null; // Assistant response metadata diff --git a/apps/playground/src/lib/api/v1.d.ts b/apps/playground/src/lib/api/v1.d.ts index 1d98dd15e..466ef89bb 100644 --- a/apps/playground/src/lib/api/v1.d.ts +++ b/apps/playground/src/lib/api/v1.d.ts @@ -527,6 +527,7 @@ export interface paths { role: "user" | "assistant" | "system"; content: string | null; images: string | null; + audios?: string | null; reasoning: string | null; tools: string | null; metadata?: { @@ -1086,8 +1087,10 @@ export interface paths { cacheWriteInputCost?: number | null; webSearchCost?: number | null; imageInputTokens: string | null; + audioInputTokens: string | null; imageOutputTokens: string | null; imageInputCost: number | null; + audioInputCost: number | null; imageOutputCost: number | null; videoOutputCost: number | null; videoDownloadCount: number | null; @@ -1337,8 +1340,10 @@ export interface paths { cacheWriteInputCost?: number | null; webSearchCost?: number | null; imageInputTokens: string | null; + audioInputTokens: string | null; imageOutputTokens: string | null; imageInputCost: number | null; + audioInputCost: number | null; imageOutputCost: number | null; videoOutputCost: number | null; videoDownloadCount: number | null; @@ -1472,6 +1477,7 @@ export interface paths { requestCost: number; dataStorageCost: number; imageInputCost: number; + audioInputCost: number; imageOutputCost: number; videoOutputCost: number; cachedInputCost: number; @@ -7406,6 +7412,7 @@ export interface paths { role: "user" | "assistant" | "system"; content: string | null; images: string | null; + audios: string | null; reasoning: string | null; tools: string | null; metadata: { @@ -7663,6 +7670,7 @@ export interface paths { role: "user" | "assistant" | "system"; content?: string; images?: string; + audios?: string; reasoning?: string; tools?: string; metadata?: { @@ -7685,6 +7693,7 @@ export interface paths { role: "user" | "assistant" | "system"; content: string | null; images: string | null; + audios: string | null; reasoning: string | null; tools: string | null; metadata: { @@ -9336,6 +9345,7 @@ export interface operations { maxOutput: number | null; streaming: boolean; vision: boolean | null; + audio: boolean | null; reasoning: boolean | null; reasoningOutput: string | null; tools: boolean | null; diff --git a/apps/playground/src/lib/fetch-models.ts b/apps/playground/src/lib/fetch-models.ts index e281fe439..b0464d288 100644 --- a/apps/playground/src/lib/fetch-models.ts +++ b/apps/playground/src/lib/fetch-models.ts @@ -34,6 +34,7 @@ export interface ApiModelProviderMapping { maxOutput: number | null; streaming: boolean; vision: boolean | null; + audio: boolean | null; reasoning: boolean | null; reasoningOutput: string | null; tools: boolean | null; diff --git a/apps/playground/src/lib/mapmodels.ts b/apps/playground/src/lib/mapmodels.ts index 74a5c34be..46f372179 100644 --- a/apps/playground/src/lib/mapmodels.ts +++ b/apps/playground/src/lib/mapmodels.ts @@ -15,6 +15,7 @@ export function mapModels( // Determine capabilities based on if ANY provider supports them const hasVision = rootProviders.some((p) => p.vision); + const hasAudio = rootProviders.some((p) => p.audio); const hasTools = rootProviders.some((p) => p.tools); const hasImageGen = m.output?.includes("image"); const supportsVideoAudio = rootProviders.some( @@ -31,6 +32,7 @@ export function mapModels( providerId: undefined, family: m.family, vision: hasVision, + audio: hasAudio, tools: hasTools, imageGen: hasImageGen, supportsVideoAudio, @@ -59,6 +61,7 @@ export function mapModels( inputPrice: p.inputPrice ? parseFloat(p.inputPrice) : undefined, outputPrice: p.outputPrice ? parseFloat(p.outputPrice) : undefined, vision: p.vision ?? undefined, + audio: p.audio ?? undefined, tools: p.tools ?? undefined, imageGen: m.output?.includes("image"), supportsVideoAudio: p.supportsVideoAudio ?? undefined, diff --git a/apps/playground/src/lib/types.ts b/apps/playground/src/lib/types.ts index e9d19471a..234e3ee60 100644 --- a/apps/playground/src/lib/types.ts +++ b/apps/playground/src/lib/types.ts @@ -52,6 +52,7 @@ export interface ComboboxModel { inputPrice?: number; outputPrice?: number; vision?: boolean; + audio?: boolean; tools?: boolean; imageGen?: boolean; supportsVideoAudio?: boolean; diff --git a/apps/ui/src/lib/api/v1.d.ts b/apps/ui/src/lib/api/v1.d.ts index 1d98dd15e..466ef89bb 100644 --- a/apps/ui/src/lib/api/v1.d.ts +++ b/apps/ui/src/lib/api/v1.d.ts @@ -527,6 +527,7 @@ export interface paths { role: "user" | "assistant" | "system"; content: string | null; images: string | null; + audios?: string | null; reasoning: string | null; tools: string | null; metadata?: { @@ -1086,8 +1087,10 @@ export interface paths { cacheWriteInputCost?: number | null; webSearchCost?: number | null; imageInputTokens: string | null; + audioInputTokens: string | null; imageOutputTokens: string | null; imageInputCost: number | null; + audioInputCost: number | null; imageOutputCost: number | null; videoOutputCost: number | null; videoDownloadCount: number | null; @@ -1337,8 +1340,10 @@ export interface paths { cacheWriteInputCost?: number | null; webSearchCost?: number | null; imageInputTokens: string | null; + audioInputTokens: string | null; imageOutputTokens: string | null; imageInputCost: number | null; + audioInputCost: number | null; imageOutputCost: number | null; videoOutputCost: number | null; videoDownloadCount: number | null; @@ -1472,6 +1477,7 @@ export interface paths { requestCost: number; dataStorageCost: number; imageInputCost: number; + audioInputCost: number; imageOutputCost: number; videoOutputCost: number; cachedInputCost: number; @@ -7406,6 +7412,7 @@ export interface paths { role: "user" | "assistant" | "system"; content: string | null; images: string | null; + audios: string | null; reasoning: string | null; tools: string | null; metadata: { @@ -7663,6 +7670,7 @@ export interface paths { role: "user" | "assistant" | "system"; content?: string; images?: string; + audios?: string; reasoning?: string; tools?: string; metadata?: { @@ -7685,6 +7693,7 @@ export interface paths { role: "user" | "assistant" | "system"; content: string | null; images: string | null; + audios: string | null; reasoning: string | null; tools: string | null; metadata: { @@ -9336,6 +9345,7 @@ export interface operations { maxOutput: number | null; streaming: boolean; vision: boolean | null; + audio: boolean | null; reasoning: boolean | null; reasoningOutput: string | null; tools: boolean | null; diff --git a/apps/ui/src/types/activity.ts b/apps/ui/src/types/activity.ts index aefee18b3..6b4702bbb 100644 --- a/apps/ui/src/types/activity.ts +++ b/apps/ui/src/types/activity.ts @@ -24,6 +24,7 @@ export interface DailyActivity { requestCost: number; dataStorageCost: number; imageInputCost: number; + audioInputCost: number; imageOutputCost: number; videoOutputCost: number; cachedInputCost: number; @@ -62,6 +63,7 @@ export type ActivitT = requestCost: number; dataStorageCost: number; imageInputCost: number; + audioInputCost: number; imageOutputCost: number; videoOutputCost: number; cachedInputCost: number; diff --git a/apps/worker/src/services/global-stats-aggregator.ts b/apps/worker/src/services/global-stats-aggregator.ts index cac09ba42..18cb738c9 100644 --- a/apps/worker/src/services/global-stats-aggregator.ts +++ b/apps/worker/src/services/global-stats-aggregator.ts @@ -88,6 +88,7 @@ const AGGREGATE_KEYS = [ "discountSavings", "imageInputCost", "imageOutputCost", + "audioInputCost", "videoOutputCost", "cachedInputCost", "cacheWriteInputCost", diff --git a/apps/worker/src/services/project-stats-aggregator.ts b/apps/worker/src/services/project-stats-aggregator.ts index ec3d9c9c2..34955a6b4 100644 --- a/apps/worker/src/services/project-stats-aggregator.ts +++ b/apps/worker/src/services/project-stats-aggregator.ts @@ -158,6 +158,9 @@ export function getCommonAggregationFields() { imageOutputCost: sql`coalesce(sum(${log.imageOutputCost}), 0)`.as( "imageOutputCost", ), + audioInputCost: sql`coalesce(sum(${log.audioInputCost}), 0)`.as( + "audioInputCost", + ), videoOutputCost: sql`coalesce(sum(${log.videoOutputCost}), 0)`.as( "videoOutputCost", ), diff --git a/ee/admin/src/lib/api/v1.d.ts b/ee/admin/src/lib/api/v1.d.ts index 1d98dd15e..466ef89bb 100644 --- a/ee/admin/src/lib/api/v1.d.ts +++ b/ee/admin/src/lib/api/v1.d.ts @@ -527,6 +527,7 @@ export interface paths { role: "user" | "assistant" | "system"; content: string | null; images: string | null; + audios?: string | null; reasoning: string | null; tools: string | null; metadata?: { @@ -1086,8 +1087,10 @@ export interface paths { cacheWriteInputCost?: number | null; webSearchCost?: number | null; imageInputTokens: string | null; + audioInputTokens: string | null; imageOutputTokens: string | null; imageInputCost: number | null; + audioInputCost: number | null; imageOutputCost: number | null; videoOutputCost: number | null; videoDownloadCount: number | null; @@ -1337,8 +1340,10 @@ export interface paths { cacheWriteInputCost?: number | null; webSearchCost?: number | null; imageInputTokens: string | null; + audioInputTokens: string | null; imageOutputTokens: string | null; imageInputCost: number | null; + audioInputCost: number | null; imageOutputCost: number | null; videoOutputCost: number | null; videoDownloadCount: number | null; @@ -1472,6 +1477,7 @@ export interface paths { requestCost: number; dataStorageCost: number; imageInputCost: number; + audioInputCost: number; imageOutputCost: number; videoOutputCost: number; cachedInputCost: number; @@ -7406,6 +7412,7 @@ export interface paths { role: "user" | "assistant" | "system"; content: string | null; images: string | null; + audios: string | null; reasoning: string | null; tools: string | null; metadata: { @@ -7663,6 +7670,7 @@ export interface paths { role: "user" | "assistant" | "system"; content?: string; images?: string; + audios?: string; reasoning?: string; tools?: string; metadata?: { @@ -7685,6 +7693,7 @@ export interface paths { role: "user" | "assistant" | "system"; content: string | null; images: string | null; + audios: string | null; reasoning: string | null; tools: string | null; metadata: { @@ -9336,6 +9345,7 @@ export interface operations { maxOutput: number | null; streaming: boolean; vision: boolean | null; + audio: boolean | null; reasoning: boolean | null; reasoningOutput: string | null; tools: boolean | null; diff --git a/packages/actions/src/prepare-request-body.ts b/packages/actions/src/prepare-request-body.ts index a9e334798..d063d85e9 100644 --- a/packages/actions/src/prepare-request-body.ts +++ b/packages/actions/src/prepare-request-body.ts @@ -2153,6 +2153,8 @@ export async function prepareRequestBody( isProd, maxImageSizeMB, userPlan, + undefined, + usedProvider, ); // Transform tools from OpenAI format to Google format diff --git a/packages/actions/src/transform-google-messages.spec.ts b/packages/actions/src/transform-google-messages.spec.ts new file mode 100644 index 000000000..77be22d00 --- /dev/null +++ b/packages/actions/src/transform-google-messages.spec.ts @@ -0,0 +1,174 @@ +import { describe, expect, it } from "vitest"; + +import { + googleProviderSupportsAudioFormat, + transformGoogleMessages, + UnsupportedAudioFormatError, +} from "./transform-google-messages.js"; + +import type { BaseMessage } from "@llmgateway/models"; + +type AudioFormat = + | "wav" + | "mp3" + | "aiff" + | "aac" + | "ogg" + | "flac" + | "m4a" + | "mpeg" + | "mpga" + | "mp4" + | "pcm" + | "webm"; + +function audioMessages(format: AudioFormat): BaseMessage[] { + return [ + { + role: "user", + content: [ + { + type: "input_audio", + input_audio: { + data: "AAAA", + format, + }, + }, + ], + }, + ]; +} + +describe("transformGoogleMessages — audio MIME resolution", () => { + it("maps AI Studio formats including aiff", async () => { + const out = await transformGoogleMessages( + audioMessages("aiff"), + false, + 20, + null, + undefined, + "google-ai-studio", + ); + expect(out[0].parts[0].inline_data?.mime_type).toBe("audio/aiff"); + }); + + it("maps Vertex aac to audio/x-aac (not audio/aac)", async () => { + const out = await transformGoogleMessages( + audioMessages("aac"), + false, + 20, + null, + undefined, + "google-vertex", + ); + expect(out[0].parts[0].inline_data?.mime_type).toBe("audio/x-aac"); + }); + + it("maps Vertex m4a (a Vertex-only extension)", async () => { + const out = await transformGoogleMessages( + audioMessages("m4a"), + false, + 20, + null, + undefined, + "google-vertex", + ); + expect(out[0].parts[0].inline_data?.mime_type).toBe("audio/m4a"); + }); + + it("throws UnsupportedAudioFormatError for Vertex + aiff", async () => { + await expect( + transformGoogleMessages( + audioMessages("aiff"), + false, + 20, + null, + undefined, + "google-vertex", + ), + ).rejects.toBeInstanceOf(UnsupportedAudioFormatError); + }); + + it("throws UnsupportedAudioFormatError for AI Studio + m4a", async () => { + await expect( + transformGoogleMessages( + audioMessages("m4a"), + false, + 20, + null, + undefined, + "google-ai-studio", + ), + ).rejects.toBeInstanceOf(UnsupportedAudioFormatError); + }); + + it("attaches format and providerTarget on the error", async () => { + try { + await transformGoogleMessages( + audioMessages("aiff"), + false, + 20, + null, + undefined, + "quartz", + ); + throw new Error("expected throw"); + } catch (err) { + expect(err).toBeInstanceOf(UnsupportedAudioFormatError); + const e = err as UnsupportedAudioFormatError; + expect(e.format).toBe("aiff"); + expect(e.providerTarget).toBe("Vertex AI"); + } + }); +}); + +describe("googleProviderSupportsAudioFormat", () => { + it("AI Studio accepts wav/mp3/aiff/aac/ogg/flac", () => { + const fmts = ["wav", "mp3", "aiff", "aac", "ogg", "flac"]; + for (const f of fmts) { + expect(googleProviderSupportsAudioFormat("google-ai-studio", f)).toBe( + true, + ); + } + }); + + it("AI Studio rejects vertex-only formats", () => { + const fmts = ["m4a", "mpeg", "mpga", "mp4", "pcm", "webm"]; + for (const f of fmts) { + expect(googleProviderSupportsAudioFormat("google-ai-studio", f)).toBe( + false, + ); + } + }); + + it("Vertex accepts m4a/mp4/pcm/webm/mpeg/mpga + shared formats", () => { + const fmts = [ + "wav", + "mp3", + "aac", + "ogg", + "flac", + "m4a", + "mpeg", + "mpga", + "mp4", + "pcm", + "webm", + ]; + for (const f of fmts) { + expect(googleProviderSupportsAudioFormat("google-vertex", f)).toBe(true); + } + }); + + it("Vertex rejects aiff (AI-Studio-only)", () => { + expect(googleProviderSupportsAudioFormat("google-vertex", "aiff")).toBe( + false, + ); + expect(googleProviderSupportsAudioFormat("quartz", "aiff")).toBe(false); + }); + + it("returns true for non-Google providers (defers to provider.audio)", () => { + expect(googleProviderSupportsAudioFormat("openai", "m4a")).toBe(true); + expect(googleProviderSupportsAudioFormat(undefined, "wav")).toBe(true); + }); +}); diff --git a/packages/actions/src/transform-google-messages.ts b/packages/actions/src/transform-google-messages.ts index 55042189c..aabd92608 100644 --- a/packages/actions/src/transform-google-messages.ts +++ b/packages/actions/src/transform-google-messages.ts @@ -1,11 +1,113 @@ import { type BaseMessage, isImageUrlContent, + isInputAudioContent, isTextContent, + type ProviderId, } from "@llmgateway/models"; import { processImageUrl } from "./process-image-url.js"; +type GoogleAudioFormat = + | "wav" + | "mp3" + | "aiff" + | "aac" + | "ogg" + | "flac" + | "m4a" + | "mpeg" + | "mpga" + | "mp4" + | "pcm" + | "webm"; + +const VERTEX_FAMILY: ReadonlySet = new Set(["google-vertex", "quartz"]); +const AI_STUDIO_FAMILY: ReadonlySet = new Set([ + "google-ai-studio", + "glacier", +]); + +const AI_STUDIO_AUDIO_MIME: Partial> = { + wav: "audio/wav", + mp3: "audio/mp3", + aiff: "audio/aiff", + aac: "audio/aac", + ogg: "audio/ogg", + flac: "audio/flac", +}; + +const VERTEX_AUDIO_MIME: Partial> = { + wav: "audio/wav", + mp3: "audio/mp3", + aac: "audio/x-aac", + ogg: "audio/ogg", + flac: "audio/flac", + m4a: "audio/m4a", + mpeg: "audio/mpeg", + mpga: "audio/mpga", + mp4: "audio/mp4", + pcm: "audio/pcm", + webm: "audio/webm", +}; + +/** + * Returns true if the given provider can accept the given audio format. + * For Google providers, checks the family-specific MIME map (AI Studio vs + * Vertex have different format support). For non-Google providers, returns + * true (this helper has no opinion about them — non-Google providers must be + * filtered upstream by the `provider.audio` capability flag). + */ +export function googleProviderSupportsAudioFormat( + providerId: ProviderId | string | undefined, + format: string, +): boolean { + const id = providerId ?? ""; + if (VERTEX_FAMILY.has(id)) { + return format in VERTEX_AUDIO_MIME; + } + if (AI_STUDIO_FAMILY.has(id)) { + return format in AI_STUDIO_AUDIO_MIME; + } + return true; +} + +/** + * Thrown when an audio format passes schema validation but is not supported + * by the resolved Google provider (AI Studio vs Vertex have different MIME + * support). The gateway maps this to HTTP 400 so the client sees the actual + * format/provider mismatch instead of a generic 500. + */ +export class UnsupportedAudioFormatError extends Error { + readonly format: string; + readonly providerTarget: string; + constructor(format: string, providerTarget: string) { + super(`Audio format "${format}" is not supported by ${providerTarget}.`); + this.name = "UnsupportedAudioFormatError"; + this.format = format; + this.providerTarget = providerTarget; + } +} + +function resolveGoogleAudioMime( + format: GoogleAudioFormat, + providerId: ProviderId | string | undefined, +): string { + const map = VERTEX_FAMILY.has(providerId ?? "") + ? VERTEX_AUDIO_MIME + : AI_STUDIO_FAMILY.has(providerId ?? "") + ? AI_STUDIO_AUDIO_MIME + : { ...AI_STUDIO_AUDIO_MIME, ...VERTEX_AUDIO_MIME }; + const mime = map[format]; + if (!mime) { + const target = VERTEX_FAMILY.has(providerId ?? "") + ? "Vertex AI" + : "Google AI Studio"; + throw new UnsupportedAudioFormatError(format, target); + } + return mime; +} + // Google-specific message format with all part types interface GooglePart { text?: string; @@ -46,6 +148,7 @@ export async function transformGoogleMessages( userPlan: "free" | "pro" | "enterprise" | null = null, // Map of tool_call IDs to their thought signatures (retrieved from cache at gateway level) thoughtSignatureCache?: Map, + providerId?: ProviderId | string, ): Promise { const result: GoogleMessageExtended[] = []; @@ -173,6 +276,17 @@ export async function transformGoogleMessages( error instanceof Error ? error.message : "Unknown error"; throw new Error(`Failed to process image: ${errorMsg}`); } + } else if (isInputAudioContent(content)) { + const mimeType = resolveGoogleAudioMime( + content.input_audio.format as GoogleAudioFormat, + providerId, + ); + parts.push({ + inline_data: { + mime_type: mimeType, + data: content.input_audio.data, + }, + }); } else { throw new Error( `Not supported content type yet: ${(content as any).type}`, diff --git a/packages/db/migrations/1778573463_lazy_scream.sql b/packages/db/migrations/1778573463_lazy_scream.sql new file mode 100644 index 000000000..312a1d332 --- /dev/null +++ b/packages/db/migrations/1778573463_lazy_scream.sql @@ -0,0 +1,9 @@ +ALTER TABLE "api_key_hourly_model_stats" ADD COLUMN "audio_input_cost" real DEFAULT 0 NOT NULL;--> statement-breakpoint +ALTER TABLE "api_key_hourly_stats" ADD COLUMN "audio_input_cost" real DEFAULT 0 NOT NULL;--> statement-breakpoint +ALTER TABLE "global_model_stats" ADD COLUMN "audio_input_cost" real DEFAULT 0 NOT NULL;--> statement-breakpoint +ALTER TABLE "global_source_stats" ADD COLUMN "audio_input_cost" real DEFAULT 0 NOT NULL;--> statement-breakpoint +ALTER TABLE "log" ADD COLUMN "audio_input_tokens" numeric;--> statement-breakpoint +ALTER TABLE "log" ADD COLUMN "audio_input_cost" real;--> statement-breakpoint +ALTER TABLE "message" ADD COLUMN "audios" text;--> statement-breakpoint +ALTER TABLE "project_hourly_model_stats" ADD COLUMN "audio_input_cost" real DEFAULT 0 NOT NULL;--> statement-breakpoint +ALTER TABLE "project_hourly_stats" ADD COLUMN "audio_input_cost" real DEFAULT 0 NOT NULL; \ No newline at end of file diff --git a/packages/db/migrations/meta/1778573463_snapshot.json b/packages/db/migrations/meta/1778573463_snapshot.json new file mode 100644 index 000000000..db3690df2 --- /dev/null +++ b/packages/db/migrations/meta/1778573463_snapshot.json @@ -0,0 +1,16604 @@ +{ + "version": "8", + "dialect": "postgres", + "id": "3b97bbc2-c0bc-41c0-a6d1-b669a829f28c", + "prevId": "0874fdf6-7b44-43fb-b7c1-b34bfbb5ca1b", + "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_share", + "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": "dev_plan_cancellation_feedback", + "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_aggregation_state", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "global_model_stats", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "global_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": "audio_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": "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": "audio_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": "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_share" + }, + { + "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_share" + }, + { + "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_share" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "deleted_at", + "entityType": "columns", + "schema": "public", + "table": "chat_share" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "chat_id", + "entityType": "columns", + "schema": "public", + "table": "chat_share" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "entityType": "columns", + "schema": "public", + "table": "chat_share" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "title", + "entityType": "columns", + "schema": "public", + "table": "chat_share" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "model", + "entityType": "columns", + "schema": "public", + "table": "chat_share" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "messages", + "entityType": "columns", + "schema": "public", + "table": "chat_share" + }, + { + "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": "dev_plan_cancellation_feedback" + }, + { + "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": "dev_plan_cancellation_feedback" + }, + { + "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": "dev_plan_cancellation_feedback" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "organization_id", + "entityType": "columns", + "schema": "public", + "table": "dev_plan_cancellation_feedback" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "entityType": "columns", + "schema": "public", + "table": "dev_plan_cancellation_feedback" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "dev_plan_stripe_subscription_id", + "entityType": "columns", + "schema": "public", + "table": "dev_plan_cancellation_feedback" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "previous_dev_plan", + "entityType": "columns", + "schema": "public", + "table": "dev_plan_cancellation_feedback" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "reason", + "entityType": "columns", + "schema": "public", + "table": "dev_plan_cancellation_feedback" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "comments", + "entityType": "columns", + "schema": "public", + "table": "dev_plan_cancellation_feedback" + }, + { + "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_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_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_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_aggregation_state" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "global_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_model_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "audio_input_cost", + "entityType": "columns", + "schema": "public", + "table": "global_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_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_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_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_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_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_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_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_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_model_stats" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "global_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_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_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_source_stats" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "source", + "entityType": "columns", + "schema": "public", + "table": "global_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_source_stats" + }, + { + "type": "real", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": { + "value": "0", + "type": "unknown" + }, + "generated": null, + "identity": null, + "name": "audio_input_cost", + "entityType": "columns", + "schema": "public", + "table": "global_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_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_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_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_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_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_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_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_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_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": "numeric", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "audio_input_tokens", + "entityType": "columns", + "schema": "public", + "table": "log" + }, + { + "type": "real", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "audio_input_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": "audios", + "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": "jsonb", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "metadata", + "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": "completed_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": "length_limit_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": "content_filter_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": "tool_calls_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": "canceled_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": "unknown_finish_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": "completed_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": "length_limit_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": "content_filter_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": "tool_calls_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": "canceled_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": "unknown_finish_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": "audio_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": "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": "audio_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": "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": "chat_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": "\"deleted_at\" IS NULL", + "with": "", + "method": "btree", + "concurrently": false, + "name": "chat_share_active_chat_id_unique", + "entityType": "indexes", + "schema": "public", + "table": "chat_share" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "chat_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "chat_share_chat_id_idx", + "entityType": "indexes", + "schema": "public", + "table": "chat_share" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "deleted_at", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "chat_share_deleted_at_idx", + "entityType": "indexes", + "schema": "public", + "table": "chat_share" + }, + { + "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 + }, + { + "value": "dev_plan_stripe_subscription_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "dev_plan_cancellation_feedback_org_sub_unique", + "entityType": "indexes", + "schema": "public", + "table": "dev_plan_cancellation_feedback" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "organization_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "dev_plan_cancellation_feedback_organization_id_idx", + "entityType": "indexes", + "schema": "public", + "table": "dev_plan_cancellation_feedback" + }, + { + "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_model_stats_day_timestamp_idx", + "entityType": "indexes", + "schema": "public", + "table": "global_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_model_stats_used_model_day_timestamp_idx", + "entityType": "indexes", + "schema": "public", + "table": "global_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_model_stats_p_m_time_idx", + "entityType": "indexes", + "schema": "public", + "table": "global_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_source_stats_day_timestamp_idx", + "entityType": "indexes", + "schema": "public", + "table": "global_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_source_stats_source_day_timestamp_idx", + "entityType": "indexes", + "schema": "public", + "table": "global_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": [ + "chat_id" + ], + "schemaTo": "public", + "tableTo": "chat", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "chat_share_chat_id_chat_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "chat_share" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "chat_share_user_id_user_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "chat_share" + }, + { + "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": "dev_plan_cancellation_feedback_FlmxK90wrnKv_fkey", + "entityType": "fks", + "schema": "public", + "table": "dev_plan_cancellation_feedback" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "dev_plan_cancellation_feedback_user_id_user_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "dev_plan_cancellation_feedback" + }, + { + "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_share_pkey", + "schema": "public", + "table": "chat_share", + "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": "dev_plan_cancellation_feedback_pkey", + "schema": "public", + "table": "dev_plan_cancellation_feedback", + "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_aggregation_state_pkey", + "schema": "public", + "table": "global_aggregation_state", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "global_model_stats_pkey", + "schema": "public", + "table": "global_model_stats", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "global_source_stats_pkey", + "schema": "public", + "table": "global_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_model_stats_day_timestamp_used_model_used_provider_unique", + "entityType": "uniques", + "schema": "public", + "table": "global_model_stats" + }, + { + "nameExplicit": false, + "columns": [ + "day_timestamp", + "source" + ], + "nullsNotDistinct": false, + "name": "global_source_stats_day_timestamp_source_unique", + "entityType": "uniques", + "schema": "public", + "table": "global_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 0e47dc651..537b41241 100644 --- a/packages/db/migrations/meta/_journal.json +++ b/packages/db/migrations/meta/_journal.json @@ -890,6 +890,13 @@ "when": 1778521071636, "tag": "1778521071_abandoned_robbie_robertson", "breakpoints": true + }, + { + "idx": 127, + "version": "8", + "when": 1778573463540, + "tag": "1778573463_lazy_scream", + "breakpoints": true } ] } \ No newline at end of file diff --git a/packages/db/src/schema.ts b/packages/db/src/schema.ts index 56d08c2fb..922a9bbff 100644 --- a/packages/db/src/schema.ts +++ b/packages/db/src/schema.ts @@ -611,6 +611,8 @@ export const log = pgTable( imageOutputTokens: decimal(), imageInputCost: real(), imageOutputCost: real(), + audioInputTokens: decimal(), + audioInputCost: real(), videoOutputCost: real(), videoDownloadCount: integer().notNull().default(0), lastVideoDownloadedAt: timestamp(), @@ -1035,6 +1037,7 @@ export const message = pgTable( }).notNull(), content: text(), // Made nullable to support image-only messages images: text(), // JSON string to store images array + audios: text(), // JSON string to store audio attachments array reasoning: text(), // Reasoning content from AI models tools: text(), // JSON string to store tool call parts metadata: jsonb().$type>(), @@ -1761,6 +1764,7 @@ export const projectHourlyStats = pgTable( discountSavings: real().notNull().default(0), imageInputCost: real().notNull().default(0), imageOutputCost: real().notNull().default(0), + audioInputCost: real().notNull().default(0), videoOutputCost: real().notNull().default(0), cachedInputCost: real().notNull().default(0), cacheWriteInputCost: real().notNull().default(0), @@ -1827,6 +1831,7 @@ export const projectHourlyModelStats = pgTable( discountSavings: real().notNull().default(0), imageInputCost: real().notNull().default(0), imageOutputCost: real().notNull().default(0), + audioInputCost: real().notNull().default(0), videoOutputCost: real().notNull().default(0), cachedInputCost: real().notNull().default(0), cacheWriteInputCost: real().notNull().default(0), @@ -1915,6 +1920,7 @@ export const apiKeyHourlyStats = pgTable( discountSavings: real().notNull().default(0), imageInputCost: real().notNull().default(0), imageOutputCost: real().notNull().default(0), + audioInputCost: real().notNull().default(0), videoOutputCost: real().notNull().default(0), cachedInputCost: real().notNull().default(0), cacheWriteInputCost: real().notNull().default(0), @@ -1992,6 +1998,7 @@ export const apiKeyHourlyModelStats = pgTable( discountSavings: real().notNull().default(0), imageInputCost: real().notNull().default(0), imageOutputCost: real().notNull().default(0), + audioInputCost: real().notNull().default(0), videoOutputCost: real().notNull().default(0), cachedInputCost: real().notNull().default(0), cacheWriteInputCost: real().notNull().default(0), @@ -2076,6 +2083,7 @@ export const globalModelStats = pgTable( discountSavings: real().notNull().default(0), imageInputCost: real().notNull().default(0), imageOutputCost: real().notNull().default(0), + audioInputCost: real().notNull().default(0), videoOutputCost: real().notNull().default(0), cachedInputCost: real().notNull().default(0), cacheWriteInputCost: real().notNull().default(0), @@ -2149,6 +2157,7 @@ export const globalSourceStats = pgTable( discountSavings: real().notNull().default(0), imageInputCost: real().notNull().default(0), imageOutputCost: real().notNull().default(0), + audioInputCost: real().notNull().default(0), videoOutputCost: real().notNull().default(0), cachedInputCost: real().notNull().default(0), cacheWriteInputCost: real().notNull().default(0), diff --git a/packages/models/src/models.ts b/packages/models/src/models.ts index 4f669f905..b4ca84fea 100644 --- a/packages/models/src/models.ts +++ b/packages/models/src/models.ts @@ -175,6 +175,12 @@ export interface ProviderModelMapping { * Price per image input in USD */ imageInputPrice?: number; + /** + * Price per audio input token in USD. When unset, audio input tokens are + * billed at the regular `inputPrice` (used for providers that don't price + * audio separately, e.g. Gemini 2.5 Pro where audio follows the text tier). + */ + inputAudioPrice?: number; /** * Price per cached image input token in USD. Used by image-output models * (e.g. gpt-image-2) where OpenAI bills cached image tokens at a different @@ -182,6 +188,13 @@ export interface ProviderModelMapping { * to `cachedInputPrice`. */ cachedImageInputPrice?: number; + /** + * Price per cached audio input token in USD. Used by Google Gemini models + * which list a separate context-cache rate for audio that's higher than the + * text/image/video cache rate. When unset, cached audio tokens fall back to + * `cachedInputPrice`. + */ + cachedInputAudioPrice?: number; /** * Resolution-based token counts for image output. * Maps resolution keys (e.g., "1K", "2K", "4K", "default") to tokens per image. @@ -237,6 +250,13 @@ export interface ProviderModelMapping { * Whether this specific model supports vision (image inputs) for this provider */ vision?: boolean; + /** + * Whether this specific model accepts audio inputs (`input_audio` content + * blocks) for this provider. Used by the `model: "auto"` router to avoid + * selecting providers that would fail upstream when the request contains + * audio content. + */ + audio?: boolean; /** * Whether this model supports reasoning mode */ diff --git a/packages/models/src/models/google.ts b/packages/models/src/models/google.ts index 23f54a10a..c1d749d67 100644 --- a/packages/models/src/models/google.ts +++ b/packages/models/src/models/google.ts @@ -38,6 +38,7 @@ export const googleModels = [ reasoningMaxTokens: true, streaming: true, vision: true, + audio: true, tools: true, webSearch: true, webSearchPrice: 0.035, // $35 per 1000 prompts @@ -73,6 +74,7 @@ export const googleModels = [ reasoningMaxTokens: true, streaming: true, vision: true, + audio: true, tools: true, webSearch: true, webSearchPrice: 0.035, // $35 per 1000 prompts @@ -115,6 +117,7 @@ export const googleModels = [ reasoningMaxTokens: true, streaming: true, vision: true, + audio: true, tools: true, jsonOutput: true, jsonOutputSchema: true, @@ -147,6 +150,7 @@ export const googleModels = [ reasoningMaxTokens: true, streaming: true, vision: true, + audio: true, tools: true, jsonOutput: true, jsonOutputSchema: true, @@ -188,6 +192,7 @@ export const googleModels = [ reasoningMaxTokens: true, streaming: true, vision: true, + audio: true, tools: true, jsonOutput: true, jsonOutputSchema: true, @@ -220,6 +225,7 @@ export const googleModels = [ reasoningMaxTokens: true, streaming: true, vision: true, + audio: true, tools: true, jsonOutput: true, jsonOutputSchema: true, @@ -246,6 +252,7 @@ export const googleModels = [ reasoningMaxTokens: true, streaming: true, vision: true, + audio: true, tools: true, jsonOutput: true, jsonOutputSchema: true, @@ -263,6 +270,7 @@ export const googleModels = [ reasoningMaxTokens: true, streaming: true, vision: true, + audio: true, tools: true, jsonOutput: true, jsonOutputSchema: true, @@ -289,6 +297,7 @@ export const googleModels = [ reasoningMaxTokens: true, streaming: true, vision: true, + audio: true, tools: true, jsonOutput: true, jsonOutputSchema: true, @@ -306,6 +315,7 @@ export const googleModels = [ reasoningMaxTokens: true, streaming: true, vision: true, + audio: true, tools: true, jsonOutput: true, jsonOutputSchema: true, @@ -334,6 +344,7 @@ export const googleModels = [ reasoningMaxTokens: true, streaming: true, vision: true, + audio: true, tools: true, jsonOutput: true, jsonOutputSchema: true, @@ -352,6 +363,7 @@ export const googleModels = [ reasoningMaxTokens: true, streaming: true, vision: true, + audio: true, tools: true, jsonOutput: true, jsonOutputSchema: true, @@ -371,6 +383,8 @@ export const googleModels = [ inputPrice: 0.3 / 1e6, outputPrice: 2.5 / 1e6, cachedInputPrice: 0.03 / 1e6, + inputAudioPrice: 1.0 / 1e6, + cachedInputAudioPrice: 0.1 / 1e6, requestPrice: 0, contextSize: 1048576, maxOutput: 65535, @@ -378,6 +392,7 @@ export const googleModels = [ reasoningMaxTokens: true, streaming: true, vision: true, + audio: true, tools: true, webSearch: true, webSearchPrice: 0.035, // $35 per 1000 prompts @@ -390,6 +405,8 @@ export const googleModels = [ inputPrice: 0.3 / 1e6, outputPrice: 2.5 / 1e6, cachedInputPrice: 0.03 / 1e6, + inputAudioPrice: 1.0 / 1e6, + cachedInputAudioPrice: 0.1 / 1e6, requestPrice: 0, contextSize: 1048576, maxOutput: 65535, @@ -397,6 +414,7 @@ export const googleModels = [ reasoningMaxTokens: true, streaming: true, vision: true, + audio: true, tools: true, webSearch: true, webSearchPrice: 0.035, // $35 per 1000 prompts @@ -419,11 +437,14 @@ export const googleModels = [ inputPrice: 0.1 / 1e6, outputPrice: 0.4 / 1e6, cachedInputPrice: 0.01 / 1e6, + inputAudioPrice: 0.3 / 1e6, + cachedInputAudioPrice: 0.03 / 1e6, requestPrice: 0, contextSize: 1048576, maxOutput: 65535, streaming: true, vision: true, + audio: true, tools: true, jsonOutput: true, jsonOutputSchema: true, @@ -434,11 +455,14 @@ export const googleModels = [ inputPrice: 0.1 / 1e6, outputPrice: 0.4 / 1e6, cachedInputPrice: 0.01 / 1e6, + inputAudioPrice: 0.3 / 1e6, + cachedInputAudioPrice: 0.03 / 1e6, requestPrice: 0, contextSize: 1048576, maxOutput: 65535, streaming: true, vision: true, + audio: true, tools: true, jsonOutput: true, jsonOutputSchema: true, @@ -464,6 +488,7 @@ export const googleModels = [ maxOutput: 65535, streaming: true, vision: true, + audio: true, tools: true, jsonOutput: true, jsonOutputSchema: true, @@ -479,6 +504,7 @@ export const googleModels = [ maxOutput: 65535, streaming: true, vision: true, + audio: true, tools: true, jsonOutput: true, jsonOutputSchema: true, @@ -522,6 +548,7 @@ export const googleModels = [ reasoningMaxTokens: true, streaming: true, vision: true, + audio: true, tools: true, webSearch: true, webSearchPrice: 0.014, @@ -568,6 +595,7 @@ export const googleModels = [ reasoningMaxTokens: true, streaming: true, vision: true, + audio: true, tools: true, webSearch: true, webSearchPrice: 0.014, // $14 per 1000 queries for Gemini 3 @@ -606,6 +634,7 @@ export const googleModels = [ reasoningMaxTokens: true, streaming: true, vision: true, + audio: true, tools: true, webSearch: true, webSearchPrice: 0.014, // $14 per 1000 queries for Gemini 3 @@ -654,6 +683,7 @@ export const googleModels = [ reasoningMaxTokens: true, streaming: true, vision: true, + audio: true, tools: true, webSearch: true, webSearchPrice: 0.014, @@ -690,6 +720,7 @@ export const googleModels = [ reasoningMaxTokens: true, streaming: true, vision: true, + audio: true, tools: true, webSearch: true, webSearchPrice: 0.014, @@ -727,6 +758,7 @@ export const googleModels = [ reasoningMaxTokens: true, streaming: true, vision: true, + audio: true, tools: true, webSearch: true, webSearchPrice: 0.014, @@ -755,6 +787,7 @@ export const googleModels = [ maxOutput: 65536, streaming: true, vision: true, + audio: true, tools: true, reasoning: true, reasoningMaxTokens: true, @@ -773,6 +806,7 @@ export const googleModels = [ maxOutput: 65536, streaming: true, vision: true, + audio: true, tools: true, reasoning: true, reasoningMaxTokens: true, @@ -796,12 +830,15 @@ export const googleModels = [ outputPrice: 1.5 / 1e6, cachedInputPrice: 0.025 / 1e6, cacheWriteInputPrice: 0.08333 / 1e6, + inputAudioPrice: 0.5 / 1e6, + cachedInputAudioPrice: 0.05 / 1e6, requestPrice: 0, webSearchPrice: 0.014, contextSize: 1048576, maxOutput: 65536, streaming: true, vision: true, + audio: true, tools: true, webSearch: true, reasoning: true, @@ -816,12 +853,15 @@ export const googleModels = [ outputPrice: 1.5 / 1e6, cachedInputPrice: 0.025 / 1e6, cacheWriteInputPrice: 0.08333 / 1e6, + inputAudioPrice: 0.5 / 1e6, + cachedInputAudioPrice: 0.05 / 1e6, requestPrice: 0, webSearchPrice: 0.014, contextSize: 1048576, maxOutput: 65536, streaming: true, vision: true, + audio: true, tools: true, webSearch: true, reasoning: true, @@ -1101,6 +1141,8 @@ export const googleModels = [ inputPrice: 0.5 / 1e6, outputPrice: 3 / 1e6, cachedInputPrice: 0.05 / 1e6, + inputAudioPrice: 1.0 / 1e6, + cachedInputAudioPrice: 0.1 / 1e6, requestPrice: 0, contextSize: 1048576, maxOutput: 65535, @@ -1108,6 +1150,7 @@ export const googleModels = [ reasoningMaxTokens: true, streaming: true, vision: true, + audio: true, tools: true, webSearch: true, webSearchPrice: 0.014, // $14 per 1000 queries for Gemini 3 @@ -1120,6 +1163,8 @@ export const googleModels = [ inputPrice: 0.5 / 1e6, outputPrice: 3 / 1e6, cachedInputPrice: 0.05 / 1e6, + inputAudioPrice: 1.0 / 1e6, + cachedInputAudioPrice: 0.1 / 1e6, requestPrice: 0, contextSize: 1048576, maxOutput: 65535, @@ -1127,6 +1172,7 @@ export const googleModels = [ reasoningMaxTokens: true, streaming: true, vision: true, + audio: true, tools: true, webSearch: true, webSearchPrice: 0.014, // $14 per 1000 queries for Gemini 3 @@ -1387,6 +1433,7 @@ export const googleModels = [ reasoningMaxTokens: true, streaming: true, vision: true, + audio: true, tools: true, jsonOutput: true, jsonOutputSchema: true, @@ -1404,6 +1451,7 @@ export const googleModels = [ reasoningMaxTokens: true, streaming: true, vision: true, + audio: true, tools: true, jsonOutput: true, jsonOutputSchema: true, @@ -1430,6 +1478,7 @@ export const googleModels = [ reasoningMaxTokens: true, streaming: true, vision: true, + audio: true, tools: true, jsonOutput: true, jsonOutputSchema: true, @@ -1447,6 +1496,7 @@ export const googleModels = [ reasoningMaxTokens: true, streaming: true, vision: true, + audio: true, tools: true, jsonOutput: true, jsonOutputSchema: true, @@ -1473,6 +1523,7 @@ export const googleModels = [ reasoningMaxTokens: true, streaming: true, vision: true, + audio: true, tools: true, jsonOutput: true, jsonOutputSchema: true, @@ -1490,6 +1541,7 @@ export const googleModels = [ reasoningMaxTokens: true, streaming: true, vision: true, + audio: true, tools: true, jsonOutput: true, jsonOutputSchema: true, @@ -1516,6 +1568,7 @@ export const googleModels = [ reasoningMaxTokens: true, streaming: true, vision: false, + audio: true, tools: true, jsonOutput: true, jsonOutputSchema: true, @@ -1533,6 +1586,7 @@ export const googleModels = [ reasoningMaxTokens: true, streaming: true, vision: false, + audio: true, tools: true, jsonOutput: true, jsonOutputSchema: true, @@ -1557,6 +1611,7 @@ export const googleModels = [ maxOutput: 8192, streaming: true, vision: false, + audio: true, tools: true, jsonOutput: true, jsonOutputSchema: true, @@ -1573,6 +1628,7 @@ export const googleModels = [ maxOutput: 8192, streaming: true, vision: false, + audio: true, tools: true, jsonOutput: true, jsonOutputSchema: true, @@ -1594,11 +1650,14 @@ export const googleModels = [ inputPrice: 0.1 / 1e6, outputPrice: 0.4 / 1e6, cachedInputPrice: 0.025 / 1e6, + inputAudioPrice: 0.7 / 1e6, + cachedInputAudioPrice: 0.175 / 1e6, requestPrice: 0, contextSize: 1048576, maxOutput: 8192, streaming: true, vision: false, + audio: true, tools: true, jsonOutput: true, jsonOutputSchema: true, @@ -1612,11 +1671,14 @@ export const googleModels = [ inputPrice: 0.1 / 1e6, outputPrice: 0.4 / 1e6, cachedInputPrice: 0.025 / 1e6, + inputAudioPrice: 1.0 / 1e6, + cachedInputAudioPrice: 0.175 / 1e6, requestPrice: 0, contextSize: 1048576, maxOutput: 8192, streaming: true, vision: false, + audio: true, tools: true, jsonOutput: true, jsonOutputSchema: true, diff --git a/packages/models/src/types.ts b/packages/models/src/types.ts index db596fbd5..e0eb6cb95 100644 --- a/packages/models/src/types.ts +++ b/packages/models/src/types.ts @@ -31,6 +31,26 @@ export interface ImageContent { }; } +export interface InputAudioContent { + type: "input_audio"; + input_audio: { + data: string; + format: + | "wav" + | "mp3" + | "aiff" + | "aac" + | "ogg" + | "flac" + | "m4a" + | "mpeg" + | "mpga" + | "mp4" + | "pcm" + | "webm"; + }; +} + export interface ToolUseContent { type: "tool_use"; id: string; @@ -48,6 +68,7 @@ export type MessageContent = | TextContent | ImageUrlContent | ImageContent + | InputAudioContent | ToolUseContent | ToolResultContent; @@ -415,6 +436,12 @@ export function isImageContent( return content.type === "image"; } +export function isInputAudioContent( + content: MessageContent, +): content is InputAudioContent { + return content.type === "input_audio"; +} + export function isToolUseContent( content: MessageContent, ): content is ToolUseContent { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 30ad7e4c7..473f68061 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -573,8 +573,8 @@ importers: specifier: 5.2.2 version: 5.2.2(react-hook-form@7.65.0(react@19.2.6))(zod@3.25.76) '@llmgateway/ai-sdk-provider': - specifier: 3.7.0 - version: 3.7.0(ai@6.0.27(zod@3.25.76))(zod@3.25.76) + specifier: 3.8.0 + version: 3.8.0(ai@6.0.27(zod@3.25.76))(zod@3.25.76) '@llmgateway/models': specifier: workspace:* version: link:../../packages/models @@ -2760,8 +2760,15 @@ packages: ai: ^6.0.0 zod: ^3.24.1 || ^v4 - '@llmgateway/models@1.67.1': - resolution: {integrity: sha512-KxED2tmeSNMQRGDEPuh2EA6T4U828N/6BO0y1PZ3iIA4JiQoA9oUuy7OnklW28yQV8hw++sScATrQmW34L7HTg==} + '@llmgateway/ai-sdk-provider@3.8.0': + resolution: {integrity: sha512-3Yr5evl5b2QtXAPSl+kHLN0Zjni+MFAv0h0bW6nQrbqPaEmC28P4gNnRNyMkrpsGptPB7ahTl66ZXg+wi0NunA==} + engines: {node: '>=18'} + peerDependencies: + ai: ^6.0.0 + zod: ^3.24.1 || ^v4 + + '@llmgateway/models@1.79.0': + resolution: {integrity: sha512-uCl6cDoDEfSais1+cPNVRtZxv0VqG2swgKGuo08gPm6p8z3SHojCnLFkC74X0V7kYidvQJUTfF9PJ1lCr+xzEA==} '@mdx-js/mdx@3.1.1': resolution: {integrity: sha512-f6ZO2ifpwAQIpzGWaBQT2TXxPv6z3RBzQKpVftEWN78Vl/YweF1uwussDx8ECAXVtr3Rs89fKyG9YlzUs9DyGQ==} @@ -12720,17 +12727,23 @@ snapshots: '@llmgateway/ai-sdk-provider@3.7.0(ai@6.0.27(zod@3.25.75))(zod@3.25.75)': dependencies: - '@llmgateway/models': 1.67.1 + '@llmgateway/models': 1.79.0 ai: 6.0.27(zod@3.25.75) zod: 3.25.75 '@llmgateway/ai-sdk-provider@3.7.0(ai@6.0.27(zod@3.25.76))(zod@3.25.76)': dependencies: - '@llmgateway/models': 1.67.1 + '@llmgateway/models': 1.79.0 + ai: 6.0.27(zod@3.25.76) + zod: 3.25.76 + + '@llmgateway/ai-sdk-provider@3.8.0(ai@6.0.27(zod@3.25.76))(zod@3.25.76)': + dependencies: + '@llmgateway/models': 1.79.0 ai: 6.0.27(zod@3.25.76) zod: 3.25.76 - '@llmgateway/models@1.67.1': {} + '@llmgateway/models@1.79.0': {} '@mdx-js/mdx@3.1.1': dependencies: