blob_adminmain.tsx1 match
20// For backwards-compatibility with the old blob-admin
21// TODO - test that more
22app.get("/api/public/:key", (c) => {
23return blob.get("__public/" + c.req.param("key"));
24});
blob_adminREADME.md1 match
12[](https://www.val.town/v/stevekrouse/blob_admin_app/fork)
1314It uses [basic authentication](https://www.val.town/v/pomdtr/basicAuth) with your [Val Town API Token](https://www.val.town/settings/api) as the password (leave the username field blank).
1516# TODO
5<meta charset="UTF-8">
6<meta name="viewport" content="width=device-width, initial-scale=1.0">
7<title>NVIDIA API Client</title>
8<style>
9body {
121}
122
123.api-key-group {
124background: #fff3cd;
125border: 1px solid #ffeaa7;
129}
130
131.api-key-group label {
132color: #856404;
133}
137<div class="container">
138<div class="form-panel">
139<h1>NVIDIA API Client</h1>
140
141<form id="apiForm">
142<div class="api-key-group">
143<div class="form-group">
144<label for="apiKey">API Key:</label>
145<input type="password" id="apiKey" name="apiKey" placeholder="Enter your NVIDIA API key">
146</div>
147</div>
205<h2>Response</h2>
206<div id="responseContent" class="response-content">
207Click "Send Request" to see the API response here.
208</div>
209</div>
231// Load saved values
232function loadSavedValues() {
233// Load API key from cookie
234const savedApiKey = getCookie('nvidia_api_key');
235if (savedApiKey) {
236document.getElementById('apiKey').value = savedApiKey;
237}
238262// Save current form values
263function saveCurrentValues() {
264const form = document.getElementById('apiForm');
265const formData = new FormData(form);
266const params = {};
267
268// Save API key to cookie
269const apiKey = formData.get('apiKey');
270if (apiKey) {
271setCookie('nvidia_api_key', apiKey);
272}
273274// Save other parameters to localStorage
275for (const [key, value] of formData.entries()) {
276if (key !== 'apiKey') {
277if (key === 'messages') {
278try {
297}
298299// Make API request
300async function makeApiRequest(requestData, apiKey) {
301const response = await fetch('https://integrate.api.nvidia.com/v1/chat/completions', {
302method: 'POST',
303headers: {
304'Authorization': \`Bearer \${apiKey}\`,
305'Accept': 'application/json',
306'Content-Type': 'application/json'
366367// Form submission handler
368document.getElementById('apiForm').addEventListener('submit', async (e) => {
369e.preventDefault();
370
383// Get form data
384const formData = new FormData(e.target);
385const apiKey = formData.get('apiKey');
386
387if (!apiKey) {
388throw new Error('API Key is required');
389}
390
405saveCurrentValues();
406
407// Make API request
408const response = await makeApiRequest(requestData, apiKey);
409
410// Handle response based on streaming
untitled-7971main.ts1 match
1// Learn more: https://docs.val.town/vals/http/
2const BASE_URL = "https://api.longcat.chat/openai";
34export default async function (req: Request): Promise<Response> {
mcp-registrymain.tsx11 matches
421</div>
422<p style="text-align: start; text-wrap: balance; max-width: 65ch;">
423An open catalog and API for publicly available MCP servers to improve
424discoverability and implementation. This is{" "}
425<a href="https://www.val.town/x/cameronpak/mcp-registry">
427</a>{" "}
428and also serves as a proxy server for the{" "}
429<a href="/docs" target="_blank">MCP Registry API</a>
430</p>
431<wa-button
478<wa-callout variant="neutral">
479<wa-icon slot="icon" name="gear"></wa-icon>
480<strong>The MCP Registry API is down</strong>
481<br />
482I am really sorry about the downtime and will improve caching when the
483official MCP Registry's API resumes. Check back in later.
484</wa-callout>
485<p style="margin-top: 1rem;">
486I imagine the registry API was either spammed or couldn't scale fast
487enough. Not sure and I cannot speak on behalf of MCP. Please pray for
488those working to bring it back up.
520);
521522// Main route with full API support
523app.get("/", async (c) => {
524try {
525const cursor = c.req.query("cursor");
526const limit = parseInt(c.req.query("limit") || "30"); // API default is 30
527const search = c.req.query("search");
528const updatedSince = c.req.query("updated_since");
530const type = c.req.query("type");
531532// Build query parameters according to API spec
533const queryParams: any = {
534limit: Math.min(Math.max(limit, 1), 100), // API requires: ≥1 ≤100
535};
536597});
598599// API route for server details (JSON)
600app.get("/api/servers/:id", async (c) => {
601try {
602const serverId = c.req.param("id");
Letterboxd_Blueskymain.ts3 matches
67import Parser from "https://esm.sh/rss-parser@3.13.0";
8import { BskyAgent } from "https://esm.sh/@atproto/api@0.13.17";
910const RSS_URL = "https://letterboxd.com/petezarustica/rss/";
56// 4) Deduplicate by checking your recent posts for the same link
57// (avoids needing KV on Val Town)
58const feedResp = await agent.api.app.bsky.feed.getAuthorFeed({
59actor: did,
60limit: 30,
77};
7879await agent.api.com.atproto.repo.createRecord({
80repo: did,
81collection: "app.bsky.feed.post",
NowPlayingGrabbermain.tsx2 matches
2import querystring from "npm:querystring";
34const NOW_PLAYING_ENDPOINT = "https://api.spotify.com/v1/me/player/currently-playing";
5const TOKEN_ENDPOINT = "https://accounts.spotify.com/api/token";
67const client_id = Deno.env.get("spotify_client_id");
29c.redirect(`https://discord.com/oauth2/authorize?client_id=${CLIENT_ID}`)
30);
31app.post("/api/interactions", verify, handleInteraction);
3233export default app.fetch;
GLM-4-5-Omnimain.tsx12 matches
24provider: "groq",
25model: "meta-llama/llama-4-maverick-17b-128e-instruct",
26endpoint: "https://api.groq.com/openai/v1/chat/completions",
27headers: {
28"Authorization": `Bearer ${process.env.GROQ_API_KEY}`,
29"Content-Type": "application/json",
30},
35provider: "groq",
36model: "meta-llama/llama-4-scout-17b-16e-instruct",
37endpoint: "https://api.groq.com/openai/v1/chat/completions",
38headers: {
39"Authorization": `Bearer ${process.env.GROQ_API_KEY}`,
40"Content-Type": "application/json",
41},
46provider: "openrouter",
47model: "deepseek/deepseek-r1-distill-llama-70b",
48endpoint: "https://openrouter.ai/api/v1/chat/completions",
49headers: {
50"Authorization": `Bearer ${process.env.OPEN_ROUTER_API_KEY}`,
51"Content-Type": "application/json",
52"HTTP-Referer": process.env.HTTP_REFERER || "https://localhost:3000",
58provider: "deepseek",
59model: "deepseek-chat",
60endpoint: "https://api.deepseek.com/v1/chat/completions",
61headers: {
62"Authorization": `Bearer ${process.env.DEEPSEEK_API_KEY}`,
63"Content-Type": "application/json",
64},
602603for (const config of modelsToTry) {
604const apiKey = process.env[`${config.provider.toUpperCase()}_API_KEY`] ||
605process
606.env[
607`${
608config.provider.replace("openrouter", "OPEN_ROUTER").toUpperCase()
609}_API_KEY`
610];
611if (!apiKey) continue;
612613try {
634send("error", {
635text:
636"All configured models failed. Please check your API keys and try again.",
637allow_retry: true,
638});
untitled-7197main.ts15 matches
89try {
10// 1. Get the Vapi request body
11const body = await req.json();
1215if (!toolCall) {
16return new Response(
17JSON.stringify({ error: "Invalid Vapi tool call format" }),
18{ status: 400 },
19);
31}
3233// 3. Get the Bing API Key from environment secrets
34const BING_API_KEY = Deno.env.get("BING_API_KEY");
35if (!BING_API_KEY) {
36console.error("BING_API_KEY secret is not set.");
37return new Response(
38JSON.stringify({
39error: "Server configuration error: Missing API key.",
40}),
41{ status: 500 },
43}
4445// 4. Construct the search query and call the Bing API
46const searchQuery = `${businessName} ${location}`;
47const bingUrl = `https://api.bing.microsoft.com/v7.0/search?q=${
48encodeURIComponent(searchQuery)
49}&count=3`;
5051const bingResponse = await fetch(bingUrl, {
52headers: { "Ocp-Apim-Subscription-Key": BING_API_KEY },
53});
5455if (!bingResponse.ok) {
56throw new Error(
57`Bing API request failed with status: ${bingResponse.status}`,
58);
59}
69}
7071// 6. Send the formatted result back to Vapi
72const vapiResponse = {
73results: [{
74toolCallId: toolCallId,
77};
7879return new Response(JSON.stringify(vapiResponse), {
80headers: { "Content-Type": "application/json" },
81status: 200,
82});
83} catch (error) {
84console.error("Error in Vapi tool handler:", error);
85return new Response(
86JSON.stringify({ error: "An internal server error occurred." }),