Public
Like
ContentGen
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.
Viewing readonly version of main branch: v6View latest version
An HTTP Val that generates creative social media captions for the Jeropay team using OpenAI's GPT-4o-mini model.
- Generates 5 catchy, audience-friendly captions based on any topic
- Tailored for young professionals and creatives
- Helpful, positive tone aligned with Jeropay's brand
- Uses Val Town's free OpenAI integration
POST /
{ "topic": "your topic here" }
{ "topic": "your topic here", "captions": "Generated captions content..." }
curl -X POST https://your-val-url.web.val.run \ -H "Content-Type: application/json" \ -d '{"topic": "summer productivity tips"}'
{ "topic": "summer productivity tips", "captions": "1. 🌞 **Summer Vibes, Productive Minds!** ☀️ Embrace the warmth and transform your sunny days into a productivity powerhouse! Check out our top tips to keep you focused and thriving all summer long! #SummerSuccess\n\n2. 🚀 **Beat the Summer Slump!** From morning coffee on the patio to afternoon brainstorming at the beach, discover how to maximize your productivity while soaking up the sun! ☕🏖️ #WorkHardPlayHard\n\n..." }
- 400 Bad Request: Missing topic parameter
- 405 Method Not Allowed: Non-POST requests
- 500 Internal Server Error: OpenAI API errors
- Uses Val Town's
std/openai
for free OpenAI access - Model:
gpt-4o-mini
- Temperature: 0.8 (for creative variation)
- Max tokens: 500
The generated captions are optimized for:
- Young professionals and creatives
- Engaging hooks and action-oriented copy
- Positive, helpful tone
- Avoiding generic phrases
- Social media best practices