Val Town Code SearchReturn to Val Town

API Access

You can access search results via JSON API by adding format=json to your query:

https://codesearch.val.run/$%7Bart_info.art.src%7D?q=api&page=51&format=json

For typeahead suggestions, use the /typeahead endpoint:

https://codesearch.val.run/typeahead?q=api

Returns an array of strings in format "username" or "username/projectName"

Found 17652 results for "api"(2318ms)

myApi1 file match

@phlβ€’Updated 1 year ago

myApi1 file match

@daveliepmannβ€’Updated 1 year ago

api5001 file match

@matthamlinβ€’Updated 1 year ago

api4001 file match

@matthamlinβ€’Updated 1 year ago

myApi1 file match

@jfixβ€’Updated 1 year ago

myApi1 file match

@sanderβ€’Updated 1 year ago

myApi1 file match

@pmenzeβ€’Updated 1 year ago

myApi1 file match

@sarincasmβ€’Updated 1 year ago

myApi1 file match

@pjlamb12β€’Updated 1 year ago

myApi1 file match

@andycoupeβ€’Updated 1 year ago

ChatStreamingChat.tsx8 matches

@c15rβ€’Updated 46 mins ago
55 const fetchPrompts = async () => {
56 try {
57 const response = await fetch("/api/mcp-prompts", {
58 method: "POST",
59 headers: { "Content-Type": "application/json" },
125 /** Dispatch user input */
126 const fireSend = async () => {
127 if (!input.trim() || status !== "idle" || !config.anthropicApiKey) return;
128
129 const userText = input.trim();
232 };
233
234 const canSend = input.trim() && status === "idle" && config.anthropicApiKey;
235
236 /* ── UI ─────────────────────────────────────────────────────── */
238 <>
239 <div className="chat-messages">
240 {!config.anthropicApiKey && (
241 <div className="message system">
242 Please configure your Anthropic API key in settings to start chatting
243 </div>
244 )}
289 onChange={(e) => setInput(e.target.value)}
290 onKeyDown={handleKeyDown}
291 placeholder={config.anthropicApiKey
292 ? streaming
293 ? "Press Enter to stop streaming…"
294 : "Type your message…"
295 : "Configure API key in settings first"}
296 className="chat-input"
297 disabled={!config.anthropicApiKey || thinking}
298 rows={1}
299 />

ChatuseAnthropicStream.tsx7 matches

@c15rβ€’Updated 47 mins ago
86 /* Anthropic SDK instance – memoised so we don't recreate each render */
87 const anthropic = React.useMemo(() => {
88 if (!config.anthropicApiKey) return null;
89 return new Anthropic({
90 dangerouslyAllowBrowser: true,
91 apiKey: config.anthropicApiKey,
92 baseURL: "https://api.anthropic.com", // explicit so it works with CORS pre‑flights
93 defaultHeaders: {
94 "anthropic-version": "2023-06-01",
95 // Allow calling the API directly from the browser – you accept the risk!
96 "anthropic-dangerous-direct-browser-access": "true",
97 },
98 });
99 }, [config.anthropicApiKey]);
100
101 /* Abort helper */
110 const send = React.useCallback(
111 async (history: Message[], userText: string): Promise<AssistantMsg> => {
112 if (!anthropic) throw new Error("API key missing");
113 if (status !== "idle") throw new Error("Stream already in progress");
114
135 })) as AsyncIterable<MessageStreamEvent>;
136 } catch (err: any) {
137 console.error("Failed to call Anthropic API", err);
138 throw err;
139 }
Kapil01
apiv1