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/%22script.js/%22https:/editorjs.io/configuration//%22?q=openai&page=1&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 3251 results for "openai"(1729ms)

val-town-http-mcp-servervalley.txt4 matches

@charmaine•Updated 26 mins ago
86Note: When changing a SQLite table's schema, change the table's name (e.g., add _2 or _3) to create a fresh table.
87
88### OpenAI
89
90```ts
91import { OpenAI } from "https://esm.town/v/std/openai";
92const openai = new OpenAI();
93const completion = await openai.chat.completions.create({
94 messages: [
95 { role: "user", content: "Say hello in a creative way" },

val-town-http-mcp-servervalley_local.txt4 matches

@charmaine•Updated 26 mins ago
71```
72
73### OpenAI Integration
74```typescript
75import { OpenAI } from "https://esm.town/v/std/openai";
76const openai = new OpenAI();
77const completion = await openai.chat.completions.create({
78 messages: [{ role: "user", content: "Say hello" }],
79 model: "gpt-4o-mini",

val-town-http-mcp-servertownie.txt7 matches

@charmaine•Updated 26 mins ago
83
84 <library>
85 ## OpenAI
86
87 Val Town includes a free, proxied OpenAI:
88
89 ```ts
90 import { OpenAI } from "https://esm.town/v/std/openai";
91 const openai = new OpenAI();
92 const completion = await openai.chat.completions.create({
93 messages: [
94 { role: "user", content: "Say hello in a creative way" },
99 ```
100
101 OpenAI only works on the server. If the val includes client-side code, use dynamic imports to import this module in the server function, e.g.:
102 `const { OpenAI } = await import "https://esm.town/v/std/openai");`
103 </library>
104

val-town-http-mcp-serveropentownie.txt4 matches

@charmaine•Updated 26 mins ago
143Note: When changing a SQLite table's schema, change the table's name (e.g., add _2 or _3) to create a fresh table.
144
145### OpenAI
146```ts
147import { OpenAI } from "npm:openai";
148const openai = new OpenAI();
149const completion = await openai.chat.completions.create({
150 messages: [
151 { role: "user", content: "Say hello in a creative way" },
Gemini-Nano-Banana-03

Gemini-Nano-Banana-03main.tsx3 matches

@aibotcommander•Updated 40 mins ago
2
3import process from "node:process";
4import { OpenAI } from "npm:openai";
5const IMAGE_COST = 500;
6
28].filter(Boolean);
29
30function createPoeClient(apiKey: string): OpenAI {
31 return new OpenAI({
32 apiKey: apiKey || "YOUR_POE_API_KEY",
33 baseURL: "https://api.poe.com/v1",
Gemini-Nano-Banana-01

Gemini-Nano-Banana-01main.tsx3 matches

@aibotcommander•Updated 43 mins ago
2
3import process from "node:process";
4import { OpenAI } from "npm:openai";
5const IMAGE_COST = 500;
6
28].filter(Boolean);
29
30function createPoeClient(apiKey: string): OpenAI {
31 return new OpenAI({
32 apiKey: apiKey || "YOUR_POE_API_KEY",
33 baseURL: "https://api.poe.com/v1",
Gemini-2-5-Pro-O-01

Gemini-2-5-Pro-O-01main.tsx3 matches

@aibotcommander•Updated 1 hour ago
1import process from "node:process";
2import { OpenAI } from "npm:openai";
3
4const IMAGE_COST = 400;
110}
111
112function createPoeClient(apiKey: string): OpenAI {
113 return new OpenAI({
114 apiKey: apiKey || "YOUR_POE_API_KEY",
115 baseURL: "https://api.poe.com/v1",
Gemini-2-5-Pro-O-02

Gemini-2-5-Pro-O-02main.tsx3 matches

@aibotcommander•Updated 1 hour ago
1import process from "node:process";
2import { OpenAI } from "npm:openai";
3
4const IMAGE_COST = 400;
110}
111
112function createPoeClient(apiKey: string): OpenAI {
113 return new OpenAI({
114 apiKey: apiKey || "YOUR_POE_API_KEY",
115 baseURL: "https://api.poe.com/v1",

zoomtest.cursorrules4 matches

@yawnxyz•Updated 2 hours ago
94Note: When changing a SQLite table's schema, change the table's name (e.g., add _2 or _3) to create a fresh table.
95
96### OpenAI
97
98```ts
99import { OpenAI } from "https://esm.town/v/std/openai";
100const openai = new OpenAI();
101const completion = await openai.chat.completions.create({
102 messages: [
103 { role: "user", content: "Say hello in a creative way" },

chatterchatStream.js2 matches

@yawnxyz•Updated 3 hours ago
37 language,
38 offset = 0,
39 model = 'openai/gpt-oss-120b',
40 reasoning_effort = 'medium',
41 tools,
54 }
55
56 const isGptOss = typeof model === 'string' && model.startsWith('openai/gpt-oss');
57 const supportsReasoning = isGptOss;
58 const supportsTools = isGptOss;

openai-usage1 file match

@nbbaier•Updated 1 day ago

hello-realtime5 file matches

@jubertioai•Updated 4 days ago
Sample app for the OpenAI Realtime API
reconsumeralization
import { OpenAI } from "https://esm.town/v/std/openai"; import { sqlite } from "https://esm.town/v/stevekrouse/sqlite"; /** * Practical Implementation of Collective Content Intelligence * Bridging advanced AI with collaborative content creation */ exp
kwhinnery_openai