You can access search results via JSON API by adding format=json
to your query:
https://codesearch.val.run//%22$%7Bconfig.siteUrl%7D/%22?q=openai&page=5&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 3228 results for "openai"(2076ms)
94Note: When changing a SQLite table's schema, change the table's name (e.g., add _2 or _3) to create a fresh table.
9596### OpenAI
9798```ts
99import { OpenAI } from "https://esm.town/v/std/openai";
100const openai = new OpenAI();
101const completion = await openai.chat.completions.create({
102messages: [
103{ role: "user", content: "Say hello in a creative way" },
113apiKeyInput: '',
114// Model selection
115selectedModel: 'openai/gpt-oss-120b',
116// Browser search tool toggle
117useBrowserSearch: true,
1432model: this.selectedModel,
1433reasoning_effort: this.reasoningEffort,
1434tools: (() => { const list = []; const isOss = !!(this.selectedModel && this.selectedModel.startsWith('openai/gpt-oss')); if (isOss) { if (this.useBrowserSearch) list.push({ type: 'browser_search' }); if (this.useCodeInterpreter) list.push({ type: 'code_interpreter' }); } return list; })(),
1435temperature: this.temperature,
1436...(this.maxTokens ? { max_tokens: this.maxTokens } : {}),
1577model: this.selectedModel,
1578reasoning_effort: this.reasoningEffort,
1579tools: (() => { const list = []; const isOss = !!(this.selectedModel && this.selectedModel.startsWith('openai/gpt-oss')); if (isOss) { if (this.useBrowserSearch) list.push({ type: 'browser_search' }); if (this.useCodeInterpreter) list.push({ type: 'code_interpreter' }); } return list; })(),
1580temperature: this.temperature,
1581...(this.maxTokens ? { max_tokens: this.maxTokens } : {}),