aigeneratorblogmain.tsx19 matches
27const [adContent, setAdContent] = useState("");
28const [selectedProvider, setSelectedProvider] = useState("OpenAI");
29const [apiKey, setApiKey] = useState("");
3031useEffect(() => {
39setUser(userData);
40setSelectedProvider(userData.aiProvider || "OpenAI");
41setApiKey(userData.apiKey || "");
42};
4355method: "POST",
56headers: { "Content-Type": "application/json" },
57body: JSON.stringify({ topic, format, provider: selectedProvider, apiKey }),
58});
59const data = await response.json();
91};
9293const handleApiKeyChange = async (e) => {
94const newApiKey = e.target.value;
95setApiKey(newApiKey);
96await updateUserSettings({ apiKey: newApiKey });
97};
98160</div>
161<div>
162<label htmlFor="apiKey" className="block mb-2">API Key:</label>
163<input
164type="password"
165id="apiKey"
166value={apiKey}
167onChange={handleApiKeyChange}
168placeholder="Enter your API key"
169className="w-full p-2 border rounded"
170/>
172<button
173type="submit"
174disabled={isLoading || (user && user.contentGenerated >= SUBSCRIPTION_TIERS[user.tier].contentLimit) || !apiKey}
175className="w-full bg-blue-500 text-white p-2 rounded hover:bg-blue-600 disabled:opacity-50"
176>
294contentGenerated INTEGER NOT NULL,
295aiProvider TEXT,
296apiKey TEXT
297)
298`);
304await sqlite.execute(`
305INSERT INTO ${KEY}_users_${SCHEMA_VERSION}
306(name, tier, contentGenerated, aiProvider, apiKey)
307VALUES (?, ?, ?, ?, ?)
308`, ["Demo User", "FREE", 0, "OpenAI", ""]);
341if (url.pathname === "/generate") {
342try {
343const { topic, format, provider, apiKey } = await request.json();
344
345// Get current user
429}
430431if (settings.apiKey) {
432updateFields.push("apiKey = ?");
433updateValues.push(settings.apiKey);
434}
435
jentlemans_botmain.tsx1 match
7// Verify this webhook came from our bot
8if (
9req.headers.get("x-telegram-bot-api-secret-token")
10!== secret_token
11) {
seoKeywordResearchToolmain.tsx19 matches
27const [adContent, setAdContent] = useState("");
28const [selectedProvider, setSelectedProvider] = useState("OpenAI");
29const [apiKey, setApiKey] = useState("");
3031useEffect(() => {
39setUser(userData);
40setSelectedProvider(userData.aiProvider || "OpenAI");
41setApiKey(userData.apiKey || "");
42};
4355method: "POST",
56headers: { "Content-Type": "application/json" },
57body: JSON.stringify({ topic, format, provider: selectedProvider, apiKey }),
58});
59const data = await response.json();
91};
9293const handleApiKeyChange = async (e) => {
94const newApiKey = e.target.value;
95setApiKey(newApiKey);
96await updateUserSettings({ apiKey: newApiKey });
97};
98160</div>
161<div>
162<label htmlFor="apiKey" className="block mb-2">API Key:</label>
163<input
164type="password"
165id="apiKey"
166value={apiKey}
167onChange={handleApiKeyChange}
168placeholder="Enter your API key"
169className="w-full p-2 border rounded"
170/>
172<button
173type="submit"
174disabled={isLoading || (user && user.contentGenerated >= SUBSCRIPTION_TIERS[user.tier].contentLimit) || !apiKey}
175className="w-full bg-blue-500 text-white p-2 rounded hover:bg-blue-600 disabled:opacity-50"
176>
294contentGenerated INTEGER NOT NULL,
295aiProvider TEXT,
296apiKey TEXT
297)
298`);
304await sqlite.execute(`
305INSERT INTO ${KEY}_users_${SCHEMA_VERSION}
306(name, tier, contentGenerated, aiProvider, apiKey)
307VALUES (?, ?, ?, ?, ?)
308`, ["Demo User", "FREE", 0, "OpenAI", ""]);
341if (url.pathname === "/generate") {
342try {
343const { topic, format, provider, apiKey } = await request.json();
344
345// Get current user
429}
430431if (settings.apiKey) {
432updateFields.push("apiKey = ?");
433updateValues.push(settings.apiKey);
434}
435
cerebras_coderREADME.md2 matches
671. Sign up for [Cerebras](https://cloud.cerebras.ai/)
82. Get a Cerebras API Key
93. Save it in a [Val Town environment variable](https://www.val.town/settings/environment-variables) called `CEREBRAS_API_KEY`
1011# Todos
neatBlackSwiftREADME.md2 matches
671. Sign up for [Cerebras](https://cloud.cerebras.ai/)
82. Get a Cerebras API Key
93. Save it in a [Val Town environment variable](https://www.val.town/settings/environment-variables) called `CEREBRAS_API_KEY`
1011# Todos
neatBlackSwiftmain.tsx4 matches
1025};
1026} else {
1027const client = new Cerebras({ apiKey: Deno.env.get("CEREBRAS_API_KEY") });
1028const thinkingCompletion = await client.chat.completions.create({
1029messages: [
1033another AI to code websites. You DO NOT code yourself. You just explain the plan.
1034You can include inline code if you want to explain how to do something.
1035Be sure to use APIs that don't require keys and that you know well. Explain the structure of the API.
1036`,
1037},
1170<meta name="viewport" content="width=device-width, initial-scale=1.0">
1171<title>CerebrasCoder</title>
1172<link rel="preconnect" href="https://fonts.googleapis.com" />
1173<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
1174<link
1175href="https://fonts.googleapis.com/css2?family=DM+Mono:ital,wght@0,300;0,400;0,500;1,300;1,400;1,500&family=DM+Sans:ital,opsz,wght@0,9..40,100..1000;1,9..40,100..1000&display=swap"
1176rel="stylesheet"
1177/>
1Simple Space Traders API status table.
2100% generated by Townie AI.
spaceTradersStatusTablemain.tsx3 matches
10async function fetchStatus() {
11try {
12const response = await fetch('https://api.spacetraders.io/v2/');
13if (!response.ok) throw new Error('Failed to fetch status');
14const data = await response.json();
31return (
32<div style={styles.container}>
33<h1 style={styles.title}>🚀 SpaceTraders API Status</h1>
34<table style={styles.table}>
35<thead>
130<html>
131<head>
132<title>SpaceTraders API Status</title>
133<meta name="viewport" content="width=device-width, initial-scale=1">
134</head>
cerebras_coderREADME.md2 matches
671. Sign up for [Cerebras](https://cloud.cerebras.ai/)
82. Get a Cerebras API Key
93. Save it in a [Val Town environment variable](https://www.val.town/settings/environment-variables) called `CEREBRAS_API_KEY`
1011# Todos
cerebras_codermain.tsx5 matches
212} catch (error) {
213Toastify({
214text: "We may have hit our Cerebras Usage limits. Try again later or fork this and use your own API key.",
215position: "center",
216duration: 3000,
1024};
1025} else {
1026const client = new Cerebras({ apiKey: Deno.env.get("CEREBRAS_API_KEY") });
1027const completion = await client.chat.completions.create({
1028messages: [
1149<meta name="viewport" content="width=device-width, initial-scale=1.0">
1150<title>CerebrasCoder</title>
1151<link rel="preconnect" href="https://fonts.googleapis.com" />
1152<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
1153<link
1154href="https://fonts.googleapis.com/css2?family=DM+Mono:ital,wght@0,300;0,400;0,500;1,300;1,400;1,500&family=DM+Sans:ital,opsz,wght@0,9..40,100..1000;1,9..40,100..1000&display=swap"
1155rel="stylesheet"
1156/>
1165<meta property="og:description" content="Turn your ideas into fully functional apps in less than a second – powered by Llama3.3-70b on Cerebras's super-fast wafer chips. Code is 100% open-source, hosted on Val Town."">
1166<meta property="og:type" content="website">
1167<meta property="og:image" content="https://stevekrouse-blob_admin.web.val.run/api/public/CerebrasCoderOG.jpg">
1168
1169