import { ImageResponse } from 'next/og'; import { Wallpaper } from '@/components/brand/og'; import { intel, safe } from '@/lib/api'; import { fmtInt, fmtUsdPerM, num } from '@/lib/format'; import { SITE_NAME } from '@/lib/site'; export const runtime = 'nodejs'; export const alt = `AI Price Index on ${SITE_NAME}`; export const size = { width: 1200, height: 630 }; export const contentType = 'image/png'; export default async function PricesOgImage() { const idx = await safe(intel.priceIndex(30)); const latest = (idx?.series ?? []).filter((p) => num(p.median_input) !== null || num(p.median_output) !== null).at(-1); const counters: [string, string][] = latest ? [ ['Median input / 1M', fmtUsdPerM(latest.median_input)], ['Median output / 1M', fmtUsdPerM(latest.median_output)], ['Models priced', fmtInt(latest.models)], ['Current offers', fmtInt(latest.offers)], ] : []; return new ImageResponse(, { ...size }); }