Search

4,018 results found for openai (6731ms)

Code
3,914

// @ts-ignore
import { OpenAI } from "https://esm.town/v/std/openai?v=4";
// @ts-ignore
import { blob } from "https://esm.town/v/std/blob?v=11";
const app = new Hono();
let openai: OpenAI;
try {
openai = new OpenAI();
} catch (e) {
console.error("OpenAI Init Error", e);
}
const prompts = getSystemPrompts(genre);
try {
const completion = await openai.chat.completions.create({
model: "gpt-4o",
messages: [
const prompts = getSystemPrompts(genre);
try {
const completion = await openai.chat.completions.create({
model: "gpt-4o",
messages: [
): Promise<AsyncIterable<any>> {
const prompts = getSystemPrompts(genre);
return await openai.chat.completions.create({
model: "gpt-4o",
messages: [
Note: When changing a SQLite table's schema, change the table's name (e.g., add _2 or _3) to cre
### OpenAI
```ts
import { OpenAI } from "https://esm.town/v/std/openai";
const openai = new OpenAI();
const completion = await openai.chat.completions.create({
messages: [
{ role: "user", content: "Say hello in a creative way" },
Note: When changing a SQLite table's schema, change the table's name (e.g., add _2 or _3) to cre
### OpenAI
```ts
import { OpenAI } from "https://esm.town/v/std/openai";
const openai = new OpenAI();
const completion = await openai.chat.completions.create({
messages: [
{ role: "user", content: "Say hello in a creative way" },
import { OpenAI } from "https://esm.town/v/std/openai?v=4";
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
}
const openai = new OpenAI();
const completion = await openai.chat.completions.create({
model: AI_CONFIG.model,
temperature: AI_CONFIG.temperature,
- **Auth env key**: `FATEBOOK_API_KEY`
### With OpenAI Responses API
```typescript
const response = await openai.responses.create({
model: "gpt-4o-mini",
input: "Create a prediction: Will I finish my project by Friday? 70% confident, resolve by 202
- **URL**: `https://dicemcp.val.run`
### With OpenAI Responses API
```typescript
const response = await openai.responses.create({
model: "gpt-4o-mini",
input: "Roll 3 dice for me",
## Quick Start
1. **Add your OpenAI API key** in Environment Variables:
- Key: `OPENAI_API_KEY`
- Value: Your OpenAI API key
2. **Open the app** and click "New Chat"
This MCP server works with any MCP-compatible client:
- **OpenAI Responses API** - Add as an MCP tool
- **Claude Desktop** - Add to your MCP config
- **MCP Chat** - Add via the settings UI
### Example with OpenAI
```typescript
const response = await openai.responses.create({
model: "gpt-4o-mini",
input: "Roll 3 dice for me",
export function renderApp({ chats, servers, currentChat, messages }: AppProps) {
const hasApiKey = !!Deno.env.get("OPENAI_API_KEY");
return (
{!hasApiKey && (
<div class="bg-amber-50 border-b border-amber-200 px-4 py-2 text-sm text-amber-800
⚠️ Add <code class="bg-amber-100 px-1 rounded">OPENAI_API_KEY</code> in Environment V
</div>
)}
import { Hono } from "npm:hono@4";
import OpenAI from "npm:openai";
import {
createChat,
}
const apiKey = Deno.env.get("OPENAI_API_KEY");
if (!apiKey) {
return c.json({ error: "Add OPENAI_API_KEY in Environment Variables" }, 503);
}
}
// Call OpenAI
const openai = new OpenAI({ apiKey });
try {
const response = await openai.responses.create({
model: "gpt-4o-mini",
input: conversationMessages,
// Auto-title on first exchange
if (history.length === 1) {
const titleResponse = await openai.chat.completions.create({
model: "gpt-4o-mini",
messages: [
return c.json({ reply });
} catch (err) {
console.error("OpenAI error:", err);
return c.json({ error: err instanceof Error ? err.message : "AI error" }, 500);
}

Vals

89
View more
ufano
hello-realtime
Sample app for the OpenAI Realtime API
Public
toowired
openaiproxy
 
Public
marcaureledubois
editImageWithOpenAI
 
Public
toowired
ttsGeneration
Text-to-speech generation using OpenAI TTS API
Public
jubertioai
hello-realtime
Sample app for the OpenAI Realtime API
Public

Docs

12
View more
OpenAI. Copy page Copy page. Copy this page as Markdown for LLMs. View as Markdown View this page as plain text. Open in ChatGPT Ask questions about this page. Use
OpenAI Codex. Copy page Copy page. Copy this page as Markdown for LLMs. View as Markdown View this page as plain text. Open in ChatGPT Ask questions about this page.
= $("p:nth-of-type(2)").first().text(); console.log(intro); Logs OpenAI is an American artificial intelligence (AI) research organization consisting of the non-profit OpenAI, Inc.[5] registered in Delaware and its for-profit subsidiary OpenAI Global, LLC.[6] One
await browser.close(); console.log(intro); Logs "OpenAI is an American artificial intelligence (AI) research laboratory consisting of the non-profit OpenAI Incorporated and its for-profit subsidiary corporation OpenAI Limited Partnership. OpenAI conducts AI
AI. SQLite Store and retrieve structured data Blob Storage Store and retrieve any data OpenAI Use the OpenAI API Email Send emails API and SDK. Section titled “API and SDK”
Val Town + Claude Web/Desktop ChatGPT Web/Desktop Val Town + ChatGPT Codex Val Town + OpenAI Codex Cursor Val Town + Cursor GitHub Copilot Val Town + GitHub Copilot Warp
else—just send it to a val. Val. Section titled “Val” AI enrichment, browser automation: std/openai Prompt an OpenAI model Clay Enrich user data with Clay Browserbase Search the web with
“Popular tools” Claude Code Val Town CLI + Claude Code Codex Val Town CLI + OpenAI Codex Cursor Val Town CLI + Cursor GitHub Copilot Val Town CLI + GitHub
code. Receiving an attachment and then sending it along. Receiving an attachment, sending it to OpenAI, and then emailing it. Headers. Section titled “Headers” You can set custom headers in
} from "https://esm.town/v/patrickjm/gpt3?v=4"; export let librarySecret = gpt3({ prompt: "what is the meaning of life?", openAiKey: Deno.env.get("openai"), }); Import security. If you’re importing someone else’s code, read the code first