"use client"; import { useEffect, useState } from "react"; import Link from "next/link"; import { loadAiSettings, saveAiSettings, type AiProvider } from "@/lib/ai"; export default function SettingsPage() { const [provider, setProvider] = useState("anthropic"); const [key, setKey] = useState(""); const [saved, setSaved] = useState(false); const [hasStored, setHasStored] = useState(false); useEffect(() => { const existing = loadAiSettings(); if (existing) { setProvider(existing.provider); setKey(existing.key); setHasStored(true); } }, []); const onSave = () => { const trimmed = key.trim(); saveAiSettings(trimmed ? { provider, key: trimmed } : null); setHasStored(Boolean(trimmed)); setSaved(true); window.setTimeout(() => setSaved(false), 2500); }; const onClear = () => { saveAiSettings(null); setKey(""); setHasStored(false); setSaved(true); window.setTimeout(() => setSaved(false), 2500); }; return ( <>

Settings

← Back to the name finder

Bring your own AI key (optional)

The name finder works fully offline without this — the built-in generator needs no key and costs nothing. Adding your own API key gets you a second, usually more imaginative set of suggestions alongside it. Don’t have a key? Sign in with a free OTM account on the main page and AI names are included — a key here overrides that.

Your key is stored in this browser only and the request goes straight from your browser to {provider === "anthropic" ? "Anthropic" : "Google"}. It is never sent to our server and never appears in our logs. Usage is billed to your own account, so use a key with a spending limit set.

{provider === "anthropic" ? ( <> Create a key at{" "} console.anthropic.com . Starts with sk-ant-. ) : ( <> Create a key at{" "} aistudio.google.com . Gemini has a free tier that is plenty for this. )}

setKey(e.target.value)} />
{hasStored ? : null} {saved ? Saved to this browser. : null}
); }