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=135&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 1576 results for "openai"(1726ms)

gpt3Examplemain.tsx2 matches

@ktodaz•Updated 1 year ago
2
3const gpt3Example = async () => {
4 const response = await fetch("https://api.openai.com/v1/completions", {
5 method: "POST",
6 headers: {
7 "Content-Type": "application/json",
8 "Authorization": "Bearer " + process.env.OPENAI_API_KEY, // Replace with your OpenAI API Key
9 },
10 body: JSON.stringify({

googlesearchmain.tsx1 match

@lolocoo•Updated 1 year ago
25
26 const getSearch = async (data) => {
27 const response = await fetch("https://api.openai.com/v1/completions", {
28 method: "GET",
29 body: JSON.stringify(data),

browserlessScrapeExamplemain.tsx1 match

@fab1an•Updated 1 year ago
8 method: "POST",
9 body: JSON.stringify({
10 "url": "https://en.wikipedia.org/wiki/OpenAI",
11 "elements": [{
12 // The second <p> element on the page

openAiFreeUsagemain.tsx1 match

@patrickjm•Updated 1 year ago
1// set at Sat Dec 09 2023 01:45:57 GMT+0000 (Coordinated Universal Time)
2export let openAiFreeUsage = {"used_quota":12709400,"used_quota_usd":1.27094,"exceeded":false};

weatherGPTmain.tsx3 matches

@treb0r•Updated 1 year ago
1import { email } from "https://esm.town/v/std/email?v=11";
2import { fetch } from "https://esm.town/v/std/fetch";
3import { OpenAI } from "npm:openai";
4
5let location = "Halifax UK";
9).then(r => r.json());
10
11const openai = new OpenAI();
12let chatCompletion = await openai.chat.completions.create({
13 messages: [{
14 role: "user",

weatherGPTREADME.md1 match

@treb0r•Updated 1 year ago
1If you fork this, you'll need to set `OPENAI_API_KEY` in your [Val Town Secrets](https://www.val.town/settings/secrets).
2
3

weatherGPTmain.tsx3 matches

@ellenchisa•Updated 1 year ago
1import { email } from "https://esm.town/v/std/email?v=11";
2import { fetch } from "https://esm.town/v/std/fetch";
3import { OpenAI } from "npm:openai";
4
5let location = "san francisco ca";
9).then(r => r.json());
10
11const openai = new OpenAI();
12let chatCompletion = await openai.chat.completions.create({
13 messages: [{
14 role: "user",

weatherGPTREADME.md1 match

@ellenchisa•Updated 1 year ago
1If you fork this, you'll need to set `OPENAI_API_KEY` in your [Val Town Secrets](https://www.val.town/settings/secrets).
2
3

annoymain.tsx2 matches

@rcurtiss•Updated 1 year ago
50 `;
51 console.log({ prompt });
52 const response = await fetch("https://api.openai.com/v1/completions", {
53 method: "POST",
54 headers: {
55 "Content-Type": "application/json",
56 "Authorization": "Bearer " + process.env.OPENAI_API_KEY, // Replace with your OpenAI API Key
57 },
58 body: JSON.stringify({

modelSampleChatCallmain.tsx1 match

@bluemsn•Updated 1 year ago
4 const builder = await getModelBuilder({
5 type: "chat",
6 provider: "openai",
7 });
8 const model = await builder();

testOpenAI1 file match

@stevekrouse•Updated 5 hours ago

testOpenAI1 file match

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