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/?q=api&page=519&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 9608 results for "api"(1333ms)

cerebras_codermain.tsx5 matches

@optionsgpt•Updated 3 months ago
217 } catch (error) {
218 Toastify({
219 text: "We may have hit our Cerebras Usage limits. Try again later or fork this and use your own API key.",
220 position: "center",
221 duration: 3000,
970 };
971 } else {
972 const client = new Cerebras({ apiKey: Deno.env.get("CEREBRAS_API_KEY") });
973 const completion = await client.chat.completions.create({
974 messages: [
1095 <meta name="viewport" content="width=device-width, initial-scale=1.0">
1096 <title>CerebrasCoder</title>
1097 <link rel="preconnect" href="https://fonts.googleapis.com" />
1098 <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
1099 <link
1100 href="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"
1101 rel="stylesheet"
1102 />
1111 <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."">
1112 <meta property="og:type" content="website">
1113 <meta property="og:image" content="https://stevekrouse-blob_admin.web.val.run/api/public/CerebrasCoderOG.jpg">
1114
1115

octokitExamplemain.tsx1 match

@BunsDev•Updated 3 months ago
5 username: "stevekrouse",
6 headers: {
7 "X-GitHub-Api-Version": "2022-11-28",
8 },
9 });

postHogAPICapturemain.tsx2 matches

@BunsDev•Updated 3 months ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export async function postHogAPICapture({ key, event, properties, distinct_id }: {
4 key: string;
5 event: string;
8}) {
9 const body = {
10 "api_key": key,
11 "event": event,
12 "properties": properties,

FetchBasicREADME.md1 match

@BunsDev•Updated 3 months ago
1# Framer Fetch: Basic
2
3A basic example of an API endpoint to use with Framer Fetch.

browserbaseUtilsmain.tsx2 matches

@toowired•Updated 3 months ago
7export async function loadPageContent(url: string, options: LoadPageOptions = { textContent: false }) {
8 const browser = await puppeteer.connect({
9 browserWSEndpoint: `wss://connect.browserbase.com?apiKey=${Deno.env.get("BROWSERBASE_API_KEY")}`,
10 });
11
37export async function screenshotPage(url: string, options: ScreenshotOptions = { fullPage: true }) {
38 const browser = await puppeteer.connect({
39 browserWSEndpoint: `wss://connect.browserbase.com?apiKey=${Deno.env.get("BROWSERBASE_API_KEY")}`,
40 });
41

oceanThememain.tsx1 match

@paswan•Updated 3 months ago
1export const oceanTheme = {
2 fontLink:
3 `<link href="https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@0,300..800;1,300..800&display=swap" rel="stylesheet">`,
4 styles: `
5 /* General styles */

terrificIndigoAlbatrossmain.tsx5 matches

@stevekrouse•Updated 3 months ago
217 } catch (error) {
218 Toastify({
219 text: "We may have hit our Cerebras Usage limits. Try again later or fork this and use your own API key.",
220 position: "center",
221 duration: 3000,
970 };
971 } else {
972 const client = new Cerebras({ apiKey: Deno.env.get("CEREBRAS_API_KEY") });
973 const completion = await client.chat.completions.create({
974 messages: [
1095 <meta name="viewport" content="width=device-width, initial-scale=1.0">
1096 <title>CerebrasCoder</title>
1097 <link rel="preconnect" href="https://fonts.googleapis.com" />
1098 <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
1099 <link
1100 href="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"
1101 rel="stylesheet"
1102 />
1111 <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."">
1112 <meta property="og:type" content="website">
1113 <meta property="og:image" content="https://stevekrouse-blob_admin.web.val.run/api/public/CerebrasCoderOG.jpg">
1114
1115

terrificIndigoAlbatrossREADME.md2 matches

@stevekrouse•Updated 3 months ago
6
71. 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`
10
11# Todos

openaiproxyREADME.md2 matches

@charmaine•Updated 3 months ago
1# OpenAI Proxy
2
3This OpenAI API proxy injects Val Town's API keys. For usage documentation, check out https://www.val.town/v/std/openai
4
5# Usage Note
7We have a 10 req/min per user ratelimiting.
8
9If you're looking to use this proxy at a production capacity, please use your own API key by forking this val and removing this snippet of code (unless you want to ratelimit yourself):
10```
11const rlimit = new RateLimit({

openaiproxymain.tsx5 matches

@charmaine•Updated 3 months ago
1import { parseBearerString } from "https://esm.town/v/andreterron/parseBearerString";
2import { API_URL } from "https://esm.town/v/std/API_URL?v=5";
3import { OpenAIUsage } from "https://esm.town/v/std/OpenAIUsage";
4import { RateLimit } from "npm:@rlimit/http";
27 const authHeader = req.headers.get("Proxy-Authorization") || req.headers.get("Authorization");
28 const token = authHeader ? parseBearerString(authHeader) : undefined;
29 const meRes = await fetch(`${API_URL}/v1/me`, { headers: { Authorization: `Bearer ${token}` } });
30 if (!meRes.ok) {
31 return new Response("Unauthorized", { status: 401 });
42
43 // Proxy the request
44 const url = new URL("." + pathname, "https://api.openai.com");
45 url.search = search;
46
47 const headers = new Headers(req.headers);
48 headers.set("Host", url.hostname);
49 headers.set("Authorization", `Bearer ${Deno.env.get("OPENAI_API_KEY")}`);
50 headers.set("OpenAI-Organization", Deno.env.get("OPENAI_API_ORG"));
51
52 const modifiedBody = await limitFreeModel(req, user);

daily-advice-app1 file match

@dcm31•Updated 1 day ago
Random advice app using Advice Slip API

gptApiTemplate1 file match

@charmaine•Updated 2 days ago
api
aquapi