Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
A Val Town template for building AI agents using the OpenAI Agents SDK.
Want model flexibility? Check out the Vercel AI SDK Agent template — same agent pattern, but you can swap in Anthropic, Google, or any other provider by changing one line.
An agent is inference in a loop with tools: an LLM receives a system prompt, reads from and writes to an environment through tools, and loops until it decides it's done.
Rendering mermaid diagram...
- Fork this val
- Set the
OPENAI_API_KEYenvironment variable. Get your OpenAI API key here: https://platform.openai.com/api-keys - Customize your agent: Edit the agent configuration in
main.ts. You can provide custominstructions, choose a different model, or add custom tools. - Use your agent: Click
Runonmain.ts
- OpenAI Agents SDK Documentation
- OpenAI Agents Quickstart
- Vercel AI SDK Agent Template — the model-agnostic version of this template
- Val Town Documentation