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=openai&page=73&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 1629 results for "openai"(945ms)

priyanshAIToolmain.tsx3 matches

@Priyansh•Updated 2 months ago
81export default async function server(request: Request): Promise<Response> {
82 if (request.method === "POST" && new URL(request.url).pathname === "/chat") {
83 const { OpenAI } = await import("https://esm.town/v/std/openai");
84 const openai = new OpenAI();
85
86 try {
87 const { messages } = await request.json();
88 const completion = await openai.chat.completions.create({
89 messages: messages,
90 model: "gpt-4o-mini",

victoriousAmberRabbitmain.tsx3 matches

@Priyansh•Updated 2 months ago
12 setLoading(true);
13 try {
14 const { OpenAI } = await import("https://esm.town/v/std/openai");
15 const openai = new OpenAI();
16
17 const completion = await openai.chat.completions.create({
18 messages: [
19 { role: "system", content: "You are a pro-level AI assistant combining DeepSweek and ChatGPT capabilities. Provide comprehensive, nuanced responses." },

deepsweekAIToolmain.tsx3 matches

@Priyansh•Updated 2 months ago
96export default async function server(request: Request): Promise<Response> {
97 if (request.method === "POST" && new URL(request.url).pathname === "/analyze") {
98 const { OpenAI } = await import("https://esm.town/v/std/openai");
99 const openai = new OpenAI();
100
101 const { text } = await request.json();
102
103 const completion = await openai.chat.completions.create({
104 messages: [
105 {

VALLEREADME.md1 match

@anupd912•Updated 2 months ago
6* Fork this val to your own profile.
7* Make a folder for the temporary vals that get generated, take the ID from the URL, and put it in `tempValsParentFolderId`.
8* If you want to use OpenAI models you need to set the `OPENAI_API_KEY` [env var](https://www.val.town/settings/environment-variables).
9* If you want to use Anthropic models you need to set the `ANTHROPIC_API_KEY` [env var](https://www.val.town/settings/environment-variables).
10* Create a [Val Town API token](https://www.val.town/settings/api), open the browser preview of this val, and use the API token as the password to log in.

autoGenerateAppmain.tsx6 matches

@genius•Updated 2 months ago
27
28 const { email } = await import("https://esm.town/v/std/email");
29 const { OpenAI } = await import("https://esm.town/v/std/openai");
30 const openai = new OpenAI();
31
32 // Import document parsing libraries
88 }
89
90 // Generate CV using OpenAI with formatting preservation
91 const cvResponse = await openai.chat.completions.create({
92 model: "gpt-4o-mini",
93 messages: [
116 });
117
118 // Generate Cover Letter using OpenAI
119 const coverLetterResponse = await openai.chat.completions.create({
120 model: "gpt-4o-mini",
121 messages: [

agileApricotPossummain.tsx2 matches

@Koka•Updated 2 months ago
149// Server-side rendering
150export default async function server(request: Request): Promise<Response> {
151 // Future: Integrate OpenAI for AI-powered task breakdown
152 // const { OpenAI } = await import("https://esm.town/v/std/openai");
153
154 return new Response(

Translation_Trends_Monitor_2025main.tsx3 matches

@AyaMekki8•Updated 2 months ago
198 if (new URL(request.url).pathname === '/skill-trends') {
199 try {
200 const { OpenAI } = await import("https://esm.town/v/std/openai");
201 const openai = new OpenAI();
202
203 // Process skills sequentially to avoid rate limiting
206 try {
207 // Try to generate AI definition with exponential backoff
208 const definitionResponse = await openai.chat.completions.create({
209 messages: [{
210 role: "user",

chatGPTClonemain.tsx3 matches

@Samvic11•Updated 2 months ago
93 if (request.method === 'POST') {
94 try {
95 const { OpenAI } = await import("https://esm.town/v/std/openai");
96 const openai = new OpenAI();
97
98 const { messages } = await request.json();
99
100 const completion = await openai.chat.completions.create({
101 messages: messages,
102 model: "gpt-4o-mini",

SmartQuizmain.tsx4 matches

@webmonk•Updated 2 months ago
2import React, { useState, useEffect, useCallback } from "https://esm.sh/react@18.2.0";
3import { createRoot } from "https://esm.sh/react-dom@18.2.0/client";
4import { OpenAI } from "https://esm.town/v/std/openai";
5
6// Enhanced subjects with more detailed metadata
394
395export default async function server(request: Request): Promise<Response> {
396 const { OpenAI } = await import("https://esm.town/v/std/openai");
397 const openai = new OpenAI();
398
399 if (request.method === 'POST') {
402 if (request.url.includes('/generate-question')) {
403 try {
404 const completion = await openai.chat.completions.create({
405 messages: [
406 {

jobPostChatAppmain.tsx4 matches

@Hend•Updated 2 months ago
204export default async function server(request: Request): Promise<Response> {
205 if (request.method === 'POST' && new URL(request.url).pathname === '/generate') {
206 const { OpenAI } = await import("https://esm.town/v/std/openai");
207 const openai = new OpenAI();
208
209 const { jobDetails, cvText } = await request.json();
210
211 // Generate Cover Letter
212 const coverLetterCompletion = await openai.chat.completions.create({
213 messages: [
214 {
237
238 // Optimize CV
239 const cvOptimizationCompletion = await openai.chat.completions.create({
240 messages: [
241 {

translateToEnglishWithOpenAI1 file match

@shlmt•Updated 5 days 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": "*",