1import{j as e,L as v,m as L,A as I,p as y,a5 as A,M as T,I as F,r as x,k as E,S as D,a6 as V,_ as q}from"./index-C0-3lqMC.js";import{B as f}from"./badge-D_4a3gjm.js";import{N as B,F as G}from"./Footer-BDhz9QpG.js";import{c as P}from"./motion-VOB8oQwK.js";import{G as $}from"./gauge-MGCFP_WW.js";import{Z as O}from"./zap-WDQErkXs.js";import{B as C}from"./box-BEmuO2uz.js";import{M as H,f as Y}from"./model-families-pX7fcbrn.js";import{L as R}from"./layers-BBy3rNWT.js";import"./useSignupsEnabled-Bqv8la2b.js";const U={Fast:"bg-emerald-500/10 text-emerald-400 border-emerald-500/20",Standard:"bg-sky-500/10 text-sky-400 border-sky-500/20",Slow:"bg-amber-500/10 text-amber-400 border-amber-500/20"},W={Best:"bg-primary/10 text-primary border-primary/20",Great:"bg-violet-500/10 text-violet-400 border-violet-500/20",Good:"bg-muted/40 text-muted-foreground border-border"},Q={image:e.jsx(F,{className:"h-4 w-4"}),video:e.jsx(y,{className:"h-4 w-4"}),voice:e.jsx(T,{className:"h-4 w-4"}),music:e.jsx(A,{className:"h-4 w-4"}),talkingHead:e.jsx(y,{className:"h-4 w-4"}),threeD:e.jsx(C,{className:"h-4 w-4"})},N={t2i:"Text to Image",edit:"Image Edit",upscale:"Upscale",utility:"Utility","bg-removal":"BG Removal",t2v:"Text to Video",i2v:"Image to Video",flf:"First+Last Frame",v2v:"Video to Video",tts:"Text to Speech",stt:"Speech to Text",clone:"Voice Clone",sfx:"Sound FX",t2a:"Text to Audio",processing:"Audio Processing",generate:"Generate","music-video":"Music Video","audio-driven":"Avatar",lipsync:"Lip Sync","t2-3d":"Text to 3D","i2-3d":"Image to 3D"},Z={t2i:"bg-sky-500/10 text-sky-400 border-sky-500/20",edit:"bg-violet-500/10 text-violet-400 border-violet-500/20",upscale:"bg-success/10 text-success border-success/20","bg-removal":"bg-success/10 text-success border-success/20",utility:"bg-muted/30 text-muted-foreground border-border",t2v:"bg-sky-500/10 text-sky-400 border-sky-500/20",i2v:"bg-violet-500/10 text-violet-400 border-violet-500/20",flf:"bg-violet-500/10 text-violet-400 border-violet-500/20",v2v:"bg-warning/10 text-warning border-warning/20",tts:"bg-sky-500/10 text-sky-400 border-sky-500/20",stt:"bg-violet-500/10 text-violet-400 border-violet-500/20",clone:"bg-warning/10 text-warning border-warning/20",sfx:"bg-success/10 text-success border-success/20",generate:"bg-sky-500/10 text-sky-400 border-sky-500/20","audio-driven":"bg-sky-500/10 text-sky-400 border-sky-500/20",lipsync:"bg-violet-500/10 text-violet-400 border-violet-500/20","t2-3d":"bg-sky-500/10 text-sky-400 border-sky-500/20","i2-3d":"bg-violet-500/10 text-violet-400 border-violet-500/20"};function S({model:t}){const l=N[t.type]||t.type,c=Z[t.type]||"bg-muted/30 text-muted-foreground border-border",d=!!t.cost_per_second;return e.jsx(v,{href:`/models/${t.id}`,children:e.jsxs(L.div,{...P,className:"group relative rounded-xl border border-border bg-card/60 p-4 hover:border-primary/40 hover:shadow-md transition-all cursor-pointer h-full flex flex-col card-hover",children:[e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"mt-0.5 h-8 w-8 rounded-lg bg-muted/30 grid place-items-center text-muted-foreground group-hover:text-primary transition-colors shrink-0",children:Q[t.modality]}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("h3",{className:"font-medium text-sm text-foreground group-hover:text-primary transition-colors truncate",children:t.name}),t.tagline?e.jsx("p",{className:"text-mini text-muted-foreground/70 truncate",children:t.tagline}):e.jsx("code",{className:"text-2xs text-muted-foreground/70 font-mono truncate block",children:t.id})]})]}),e.jsxs("div",{className:"mt-3 flex items-center gap-1.5 flex-wrap",children:[e.jsx(f,{variant:"outline",className:`text-2xs px-1.5 py-0 ${c}`,children:l}),t.cheapest_in_type&&e.jsx(f,{variant:"outline",className:"text-2xs px-1.5 py-0 bg-success/10 text-success border-success/20",children:"Cheapest"}),t.quality_tier_label&&e.jsxs(f,{variant:"outline",className:`text-2xs px-1.5 py-0 ${W[t.quality_tier_label]||""}`,children:[e.jsx($,{className:"h-2.5 w-2.5 mr-0.5"}),t.quality_tier_label]}),t.speed_tier&&e.jsxs(f,{variant:"outline",className:`text-2xs px-1.5 py-0 ${U[t.speed_tier]||""}`,children:[e.jsx(O,{className:"h-2.5 w-2.5 mr-0.5"}),t.speed_tier]}),t.variantCount&&t.variantCount>1&&e.jsxs(f,{variant:"outline",className:"text-2xs px-1.5 py-0 bg-white/5 text-muted-foreground border-border",children:[t.variantCount," variants"]})]}),e.jsxs("div",{className:"mt-auto pt-3 flex items-end justify-between",children:[e.jsxs("div",{children:[e.jsxs("span",{className:"font-mono text-sm font-semibold text-foreground",children:["$",(()=>{const r=t.price_payg??0;return r<.001||r<.01?r.toFixed(3):r.toFixed(2)})()]}
1),e.jsxs("span",{className:"text-2xs text-muted-foreground/70 ml-0.5",children:["/",d?"sec":"gen"]})]}),e.jsx(I,{className:"h-3.5 w-3.5 text-muted-foreground/50 group-hover:text-primary group-hover:translate-x-0.5 transition-all"})]})]})})}const z=[{key:"all",label:"All Models",icon:e.jsx(R,{className:"h-4 w-4"})},{key:"image",label:"Image",icon:e.jsx(F,{className:"h-4 w-4"})},{key:"video",label:"Video",icon:e.jsx(y,{className:"h-4 w-4"})},{key:"voice",label:"Voice",icon:e.jsx(T,{className:"h-4 w-4"})},{key:"music",label:"Music",icon:e.jsx(A,{className:"h-4 w-4"})},{key:"talkingHead",label:"Avatar",icon:e.jsx(y,{className:"h-4 w-4"})},{key:"threeD",label:"3D",icon:e.jsx(C,{className:"h-4 w-4"})}],K={image:{title:"Image Generation",description:"Text-to-image, editing, upscaling, and background removal â from quick drafts to production assets."},video:{title:"Video Generation",description:"Text-to-video, image-to-video, and video-to-video â cinematic clips in seconds."},voice:{title:"Voice & Audio",description:"Text-to-speech, voice cloning, sound effects, and audio processing."},music:{title:"Music Generation",description:"Full songs with lyrics, instrumentals, and style control."},talkingHead:{title:"Talking Head & Avatar",description:"Audio-driven avatars and lip sync from a single portrait photo."},threeD:{title:"3D Generation",description:"Text-to-3D and image-to-3D model generation."}};function X(t){return!t.endsWith("-fal")&&!t.endsWith("-kieai")&&!t.endsWith("-runpod")}function J(t){const l=[],c=[["image",t.image],["video",t.video],["voice",t.voice],["music",t.music],["talkingHead",t.talkingHead],["threeD",t.threeD]];for(const[d,r]of c)if(r)for(const o of r)X(o.id)&&l.push({id:o.id,name:o.name,type:o.type,modality:d,price_payg:o.price_payg,cheapest_in_type:o.cheapest_in_type,cost_per_second:o.cost_per_second,tagline:o.tagline,best_for:o.best_for,speed_tier:o.speed_tier,quality_tier_label:o.quality_tier_label});return l}function k(t,l){return l==="all"||t.modality===l||t.modalities?.includes(l)===!0}function ee(t){const l=new Map(t.map(r=>[r.id,r])),c=new Set,d=[];for(const r of Object.values(H)){const o=r.variants.map(a=>l.get(a.slug)).filter(a=>!!a);if(o.length===0)continue;for(const a of o)c.add(a.id);const b=l.get(r.primaryVariantSlug)??o.find(a=>a.modality===r.modalities[0])??o[0],p=o.map(a=>a.price_payg).filter(a=>a!=null&&Number.isFinite(a));d.push({...b,id:r.id,name:r.displayName,tagline:r.tagline,modality:r.modalities[0],modalities:r.modalities,price_payg:p.length>0?Math.min(...p):b.price_payg,cheapest_in_type:o.some(a=>a.cheapest_in_type),best_for:Array.from(new Set(o.flatMap(a=>a.best_for??[]))),speed_tier:null,quality_tier_label:null,variantCount:r.variants.length})}
1for(const r of t)!c.has(r.id)&&!Y(r.id)&&d.push(r);return d}function te(t,l){const c=new Set;for(const d of t)k(d,l)&&c.add(d.type);return Array.from(c).sort()}function ue(){const[t,l]=x.useState("all"),[c,d]=x.useState("all"),[r,o]=x.useState(""),{data:b,isLoading:p}=E({queryKey:["/v1/models"],queryFn:async()=>{const s=await fetch("/v1/models");if(!s.ok)throw new Error("Failed to load models");const i=await s.json();return i.data||i},staleTime:300*1e3}),a=x.useMemo(()=>b?J(b):[],[b]),m=x.useMemo(()=>ee(a),[a]),j=x.useMemo(()=>te(m,t),[m,t]),g=j.includes(c)?c:"all",_=x.useMemo(()=>{const s=new Map,i=t==="all"?m:m.filter(n=>k(n,t));for(const n of i)if(n.best_for)for(const u of n.best_for)s.set(u,(s.get(u)||0)+1);return Array.from(s.entries()).sort((n,u)=>u[1]-n[1]).slice(0,12).map(([n])=>n)},[m,t]),h=x.useMemo(()=>{let s=m;if(t!=="all"&&(s=s.filter(i=>k(i,t))),g!=="all"&&(s=s.filter(i=>i.type===g)),r.trim()){const i=r.toLowerCase();s=s.filter(n=>n.name.toLowerCase().includes(i)||n.id.toLowerCase().includes(i)||n.tagline&&n.tagline.toLowerCase().includes(i)||n.best_for&&n.best_for.some(u=>u.toLowerCase().includes(i)))}return s},[m,t,g,r]),w=x.useMemo(()=>{if(t!=="all")return null;const s={};for(const i of h)s[i.modality]||(s[i.modality]=[]),s[i.modality].push(i);return s},[h,t]),M=m.length;return e.jsxs("div",{className:"min-h-screen bg-background",children:[e.jsx(D,{title:"AI Models â FairStack",description:`Browse ${M}+ AI models for image, video, voice, music, and 3D generation. Fair, transparent pricing. Every model, one API.`,path:"/models"}),e.jsx(B,{variant:"dark"}),e.jsxs("div",{className:"mx-auto w-full max-w-6xl px-5 py-8 sm:px-6 lg:px-8",children:[e.jsxs("div",{className:"mb-8",children:[e.jsx("h1",{className:"text-3xl font-semibold tracking-tight sm:text-4xl",children:"AI Model Catalog"}),e.jsxs("p",{className:"mt-2 text-base text-muted-foreground max-w-2xl",children:[M,"+ model families and single models across image, video, voice, music, and 3D. All accessible through one API with transparent pricing â"," ",e.jsx(v,{href:"/pricing",className:"text-brand hover:underline",children:"one transparent price"}),", that's it."]})]}),e.jsxs("div",{className:"sticky top-0 z-20 -mx-5 px-5 py-3 bg-gradient-to-b from-background/95 to-background/80 backdrop-blur-sm border-b border-white/10 mb-6",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center gap-3",children:[e.jsx("div",{className:"flex items-center gap-1 overflow-x-auto pb-1 sm:pb-0 scrollbar-none",children:z.map(s=>e.jsxs("button",{onClick:()=>{l(s.key),d("all")},className:`flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs font-medium whitespace-nowrap transition-colors ${t===s.key?"bg-brand/15 text-brand border border-brand/30":"text-muted-foreground hover:bg-white/5 hover:text-muted-foreground border border-transparent"}`,children:[s.icon,s.label]},s.key))}),e.jsxs("div",{className:"relative sm:ml-auto sm:w-64",children:[e.jsx(V,{className:"absolute left-2.5 top-1/2 -translate-y-1/2 h-3.5 w-3.5 text-muted-foreground"}),e.jsx("input",{type:"text",value:r,onChange:s=>o(s.target.value),placeholder:"Search by name, capability, or use case...",className:"w-full rounded-lg border border-white/10 bg-background pl-8 pr-3 py-1.5 text-sm placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-brand/30 focus:border-brand"})]})]}),t!=="all"&&j.length>1&&e.jsxs("div",{className:"flex items-center gap-1.5 mt-2 overflow-x-auto pb-1 scrollbar-none",children:[e.jsx("button",{onClick:()=>d("all"),className:`px-2.5 py-1 rounded-md text-xs font-medium transition-colors ${g==="all"?"bg-white/10 text-white":"text-muted-foreground hover:bg-white/5"}`,children:"All types"}),j.map(s=>e.jsx("button",{onClick:()=>d(s),className:`px-2.5 py-1 rounded-md text-xs font-medium whitespace-nowrap transition-colors ${g===s?"bg-white/10 text-white":"text-muted-foreground hover:bg-white/5"}`,children:N[s]||s},s))]}),_.length>0&&!r&&e.jsxs("div",{className:"flex items-center gap-1.5 mt-2 overflow-x-auto pb-1 scrollbar-none",children:[e.jsx("span",{className:"text-2xs text-muted-foreground shrink-0 mr-1",children:"Use case:"}),_.map(s=>e.jsx("button",{onClick:()=>o(s),className:"px-2 py-0.5 rounded-full text-mini font-medium whitespace-nowrap bg-white/5 text-muted-foreground hover:bg-brand/15 hover:text-brand border border-white/10 hover:border-brand/30 transition-colors",children:s},s))]})]}),p&&e.jsx("div",{className:"flex items-center justify-center py-20",children:e.jsx(q,{className:"h-6 w-6 animate-spin text-muted-foreground"})}),!p&&h.length===0&&e.jsxs("div",{className:"text-center py-16",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:r?`No models matching "${r}"`:"No models found"}),r&&e.jsx("button",{onClick:()=>o(""),className:"mt-2 text-xs text-brand hover:underline",children:"Clear search"})]}),!p&&w&&e.jsx("div",{className:"space-y-12",children:Object.entries(w).map(([s,i])=>{const n=K[s];return e.jsxs("section",{id:s,children:[e.jsxs("div",{className:"mb-4",children:[e.jsx("h2",{className:"text-xl font-semibold tracking-tight",children:n?.title||s}),e.jsxs("p",{className:"text-sm text-muted-foreground mt-0.5",children:[n?.description||""," ",e.jsxs("span",{className:"text-muted-foreground",children:["(",i.length," models)"]})]})]}),e.jsx("div",{className:"grid gap-3 grid-cols-2 sm:grid-cols-3 lg:grid-cols-4",children:i.map(u=>e.jsx(S,{model:u},u.id))})]},s)})}),!p&&!w&&h.length>0&&e.jsxs("div",{children:[e.jsxs("p",{className:"text-sm text-muted-foreground mb-4",children:[h.length," model",h.length!==1?"s":"",g!=="all"&&e.jsxs(e.Fragment,{children:[" ","
1in"," ",e.jsx(f,{variant:"secondary",className:"ml-1 text-xs",children:N[g]||g})]})]}),e.jsx("div",{className:"grid gap-3 grid-cols-2 sm:grid-cols-3 lg:grid-cols-4",children:h.map(s=>e.jsx(S,{model:s},s.id))})]}),!p&&m.length>0&&e.jsxs("div",{className:"mt-16 rounded-2xl border border-white/10 bg-white/5 p-6 sm:p-8 text-center",children:[e.jsx("h2",{className:"text-lg font-semibold",children:"One API, all models"}),e.jsx("p",{className:"mt-2 text-sm text-muted-foreground max-w-lg mx-auto",children:"Every model on this page is accessible through the same REST API. Transparent pricing â one clear price per generation. No hidden fees."}),e.jsxs("div",{className:"mt-5 flex items-center justify-center gap-3 flex-wrap",children:[e.jsx(v,{href:"/docs/quickstart",children:e.jsx("button",{className:"rounded-lg bg-brand hover:bg-brand px-5 py-2 text-sm font-medium text-white transition-colors",children:"Get started"})}),e.jsx(v,{href:"/pricing",children:e.jsx("button",{className:"rounded-lg border border-white/10 bg-background/40 hover:bg-white/5 px-5 py-2 text-sm font-medium text-muted-foreground transition-colors",children:"See pricing"})})]})]})]}),e.jsx(G,{})]})}export{ue as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.