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/$%7Burl%7D?q=openai&page=88&format=json

For typeahead suggestions, use the /typeahead endpoint:

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

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

Found 1653 results for "openai"(1376ms)

preciseScarletHerringmain.tsx2 matches

@stevekrouse•Updated 3 months ago
83 const { messages } = await request.json();
84
85 const { OpenAI } = await import("https://esm.sh/openai");
86 // Cerebras Inference
87 // Very important: do not change this
88 // Keep these comments so we remember not to change this
89 const client = new OpenAI({
90 apiKey: Deno.env.get("CEREBRAS_API_KEY"),
91 baseURL: "https://api.cerebras.ai/v1",

preciseScarletHerringREADME.md2 matches

@stevekrouse•Updated 3 months ago
35Use Cerebras for AI on the backend like so:
36
37const { OpenAI } = await import("https://esm.sh/openai");
38const client = new OpenAI({
39 apiKey: "YOUR_CEREBRAS_API_KEY",
40 baseURL: "https://api.cerebras.ai/v1"

r1README.md1 match

@sboesen•Updated 3 months ago
141. Copy this Val and save it as an Email Val (choose Val type in top-right corner of editor)
15
162. Add your Fireworks (or openai API compatible) API key to line 8 (or use an environment variable: https://docs.val.town/reference/environment-variables/)
17
183. Copy the email address of the Val (click 3 dots in top-right > Copy > Copy email address)

cerebrasTemplatemain.tsx2 matches

@stevekrouse•Updated 3 months ago
83 const { messages } = await request.json();
84
85 const { OpenAI } = await import("https://esm.sh/openai");
86 // Cerebras Inference
87 // Very important: do not change this
88 // Keep these comments so we remember not to change this
89 const client = new OpenAI({
90 apiKey: Deno.env.get("CEREBRAS_API_KEY"),
91 baseURL: "https://api.cerebras.ai/v1",

victoriousGreenLynxmain.tsx4 matches

@stevekrouse•Updated 3 months ago
93 const { messages } = await request.json();
94
95 const { OpenAI } = await import("https://esm.town/v/std/openai");
96 const openai = new OpenAI();
97
98 try {
99 const response = await openai.chat.completions.create({
100 model: "gpt-4o-mini",
101 messages: [
109 return Response.json({ message: generatedMessage });
110 } catch (error) {
111 console.error("Error calling OpenAI API:", error);
112
113 if (error.status === 429) {

victoriousGreenLynxREADME.md2 matches

@stevekrouse•Updated 3 months ago
29Use Cerebras for AI on the backend like so:
30
31const { OpenAI } = await import("https://esm.sh/openai");
32const client = new OpenAI({
33 apiKey: "YOUR_CEREBRAS_API_KEY",
34 baseURL: "https://api.cerebras.ai/v1"

masterfulPeachHookwormmain.tsx2 matches

@stevekrouse•Updated 3 months ago
83 const { messages, sassy } = await request.json();
84
85 const { OpenAI } = await import("https://esm.sh/openai");
86 const client = new OpenAI({
87 apiKey: Deno.env.get("CEREBRAS_API_KEY"),
88 baseURL: "https://api.cerebras.ai/v1",

masterfulPeachHookwormREADME.md2 matches

@stevekrouse•Updated 3 months ago
29Use Cerebras for AI on the backend like so:
30
31const { OpenAI } = await import("https://esm.sh/openai");
32const client = new OpenAI({
33 apiKey: "YOUR_CEREBRAS_API_KEY",
34 baseURL: "https://api.cerebras.ai/v1"

knowledgeableTomatoCrawdadREADME.md2 matches

@stevekrouse•Updated 3 months ago
29Use Cerebras for AI on the backend like so:
30
31const { OpenAI } = await import("https://esm.sh/openai");
32const client = new OpenAI({
33 apiKey: "YOUR_CEREBRAS_API_KEY",
34 baseURL: "https://api.cerebras.ai/v1"

knowledgeableTomatoCrawdadmain.tsx2 matches

@stevekrouse•Updated 3 months ago
91 const { messages } = await request.json();
92
93 const { OpenAI } = await import("https://esm.sh/openai");
94 const client = new OpenAI({
95 apiKey: Deno.env.get("CEREBRAS_API_KEY"),
96 baseURL: "https://api.cerebras.ai/v1"

translateToEnglishWithOpenAI1 file match

@shlmt•Updated 1 week ago

testOpenAI1 file match

@stevekrouse•Updated 1 week ago
lost1991
import { OpenAI } from "https://esm.town/v/std/openai"; export default async function(req: Request): Promise<Response> { if (req.method === "OPTIONS") { return new Response(null, { headers: { "Access-Control-Allow-Origin": "*",