Back to APIs list

ChatGPT API examples & templates

Use these vals as a playground to view and fork ChatGPT API examples and templates on Val Town. Run any example below or find templates that can be used as a pre-built solution.
xsec avatar
ChatGPTTextDefinitionUserscript
@xsec
Script
Forked from willthereader/ChatGPTTextDefinitionUserscript
willthereader avatar
ChatGPTTextDefinitionUserscript
@willthereader
Script
// @name Improved ChatGPT Text Definition
janpaul123 avatar
valTownChatGPT2
@janpaul123
HTTP (deprecated)
https://x.com/JanPaul123/status/1811801305066651997 Fork it and authenticate with your Val Town API token as the password.
mttlws avatar
valTownChatGPT
@mttlws
HTTP (deprecated)
Forked from simonw/valTownChatGPT
simonw avatar
valTownChatGPT
@simonw
HTTP (deprecated)
Forked from maxm/valTownChatGPT
fadi avatar
promptChatGPT
@fadi
Script
An interactive, runnable TypeScript val by fadi
gtrufitt avatar
handleChatGPTRequest
@gtrufitt
Script
An interactive, runnable TypeScript val by gtrufitt
maxdrake avatar
chatGPTExample
@maxdrake
Script
An interactive, runnable TypeScript val by maxdrake
stevekrouse avatar
openai
@stevekrouse
Script
OpenAI ChatGPT helper function This val uses your OpenAI token if you have one, and the @std/openai if not, so it provides limited OpenAI usage for free. import { chat } from "https://esm.town/v/stevekrouse/openai"; const { content } = await chat("Hello, GPT!"); console.log(content); import { chat } from "https://esm.town/v/stevekrouse/openai"; const { content } = await chat( [ { role: "system", content: "You are Alan Kay" }, { role: "user", content: "What is the real computer revolution?"} ], { max_tokens: 50, model: "gpt-4o" } ); console.log(content);
maxm avatar
selfEditingWebsiteGPT
@maxm
HTTP (deprecated)
Forked from maxm/selfEditingWebsite
toowired avatar
selfEditingWebsiteGPT
@toowired
HTTP (deprecated)
Forked from maxm/selfEditingWebsiteGPT
ktodaz avatar
getGPTResponse
@ktodaz
Script
Get a response from GPT for the player.
bingo16 avatar
newChatGPT35
@bingo16
Script
An interactive, runnable TypeScript val by bingo16
chatgpt avatar
chat
@chatgpt
Script
Forked from webup/chat
bingo16 avatar
getChatgpt
@bingo16
Script
An interactive, runnable TypeScript val by bingo16
stevekrouse avatar
chatGPT
@stevekrouse
HTTP (deprecated)
Forked from maxm/valTownChatGPT