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=openai&page=28&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 347 results for "openai"(228ms)

Open-Toowniesystem_prompt.txt4 matches

@toowired•Updated 3 weeks ago
137Note: When changing a SQLite table's schema, change the table's name (e.g., add _2 or _3) to create a fresh table.
138
139### OpenAI
140```ts
141import { OpenAI } from "https://esm.town/v/std/openai";
142const openai = new OpenAI();
143const completion = await openai.chat.completions.create({
144 messages: [
145 { role: "user", content: "Say hello in a creative way" },

OpenTowniesystem_prompt.txt4 matches

@neverstew•Updated 3 weeks ago
137Note: When changing a SQLite table's schema, change the table's name (e.g., add _2 or _3) to create a fresh table.
138
139### OpenAI
140```ts
141import { OpenAI } from "https://esm.town/v/std/openai";
142const openai = new OpenAI();
143const completion = await openai.chat.completions.create({
144 messages: [
145 { role: "user", content: "Say hello in a creative way" },

bhaavsynthlandipgpagemain.tsx2 matches

@prashamtrivedi•Updated 3 weeks ago
408 const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
409 const { email: sendEmail } = await import("https://esm.town/v/std/email");
410 const { OpenAI } = await import("https://esm.town/v/std/openai");
411 const openai = new OpenAI();
412
413 const KEY = "bhaavsynthlandipgpage";

trAIderAgentagent.ts5 matches

@kamalnrf•Updated 3 weeks ago
1import { readFile } from "https://esm.town/v/std/utils@71-main/index.ts";
2import { createOpenAI } from "npm:@ai-sdk/openai";
3import { streamText, tool } from "npm:ai";
4import { z } from "npm:zod";
56});
57
58const openai = createOpenAI({
59 baseURL: "https://std-openaiproxy.web.val.run/v1",
60 apiKey: Deno.env.get("valtown"),
61 organization: undefined,
79 try {
80 const result = await streamText({
81 model: openai("gpt-4o-mini"),
82 messages,
83 tools: {
111 });
112 } catch (error) {
113 console.error("OpenAI API error:", error);
114 return new Response("An error occurred during the analysis.");
115 }

OpenTowniesystem_prompt.txt4 matches

@k7d•Updated 3 weeks ago
137Note: When changing a SQLite table's schema, change the table's name (e.g., add _2 or _3) to create a fresh table.
138
139### OpenAI
140```ts
141import { OpenAI } from "https://esm.town/v/std/openai";
142const openai = new OpenAI();
143const completion = await openai.chat.completions.create({
144 messages: [
145 { role: "user", content: "Say hello in a creative way" },
4
5import { email } from "https://esm.town/v/std/email";
6import { OpenAI } from "https://esm.town/v/std/openai";
7import { Project, EmailSubscriber } from "../shared/types.ts";
8import { logger } from "./utils.ts";
9
10const openai = new OpenAI();
11
12/**
44
45 try {
46 // Generate welcome email content using OpenAI
47 const prompt = `
48 You are writing a personalized welcome email to someone who just subscribed to "${project.name}".
59 `;
60
61 const completion = await openai.chat.completions.create({
62 messages: [
63 { role: "system", content: "You are a helpful assistant that writes excellent, personalized emails." },

groqAudioChattts.ts1 match

@arfan•Updated 4 weeks ago
26 console.log("🔊 Sending request to Groq Speech API");
27 const start = Date.now();
28 const response = await fetch("https://api.groq.com/openai/v1/audio/speech", {
29 method: "POST",
30 headers: {

groqAudioChatchat.ts1 match

@arfan•Updated 4 weeks ago
20 console.log("🔵 Sending request to Groq API");
21 const start = Date.now();
22 const response = await fetch("https://api.groq.com/openai/v1/chat/completions", {
23 method: "POST",
24 headers: {

groqAudioChataudio.ts1 match

@arfan•Updated 4 weeks ago
63 console.log("🎤 Sending request to Groq Whisper API");
64 const start = Date.now();
65 const response = await fetch("https://api.groq.com/openai/v1/audio/transcriptions", {
66 method: "POST",
67 headers: {

OpenTowniesystem_prompt.txt4 matches

@jxnblk•Updated 4 weeks ago
137Note: When changing a SQLite table's schema, change the table's name (e.g., add _2 or _3) to create a fresh table.
138
139### OpenAI
140```ts
141import { OpenAI } from "https://esm.town/v/std/openai";
142const openai = new OpenAI();
143const completion = await openai.chat.completions.create({
144 messages: [
145 { role: "user", content: "Say hello in a creative way" },

stevens-openai5 file matches

@yash_ing•Updated 2 days ago

openaiPricing9 file matches

@nbbaier•Updated 1 week ago
Project created from val URLs