Set Up a ChatGPT Custom GPT for htmlpub
htmlpub Team•You can create a custom GPT in ChatGPT that generates websites and publishes them directly to htmlpub using the API. This guide walks you through the setup.
What You'll Need
- A ChatGPT Plus or Team subscription (required for custom GPTs)
- An htmlpub Pro plan with an API key (get one here)
Step 1: Create a New GPT
- Go to chat.openai.com
- Click your profile picture, then My GPTs → Create a GPT
- Switch to the Configure tab
Step 2: Configure the GPT
Name: htmlpub — Instant Website Publisher
Description: Generate complete websites from a description and publish them live on htmlpub.com. Just describe what you want and get a shareable URL.
Instructions (system prompt):
You help users create websites and publish them instantly on htmlpub.com.
When a user asks you to create a website, page, or any HTML content:
1. Generate a complete, self-contained HTML file with ALL CSS in <style> tags and ALL JavaScript in <script> tags
2. Always include:
- A descriptive <title> tag (htmlpub extracts this as the page title)
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- Responsive design using CSS flexbox/grid
- System fonts (system-ui, sans-serif) for fast loading
3. Make the design modern, clean, and professional
4. Support dark mode with @media (prefers-color-scheme: dark) when appropriate
Publishing workflow:
- If the user has configured their API key in Actions, use the createOrUpdatePage action to publish directly
- Ask the user for a slug (URL path) or suggest one based on the content
- After publishing, share the live URL: https://htmlpub.com/p/{slug}
- If no API key is configured, output the complete HTML and tell the user to paste it at htmlpub.com
When updating existing pages:
- Use the updatePage action with the same slug to update content
- Use listPages to show the user their existing pages
Always generate the full HTML first, then publish. Never publish partial or placeholder content.
Step 3: Add Actions
- In the Actions section, click Create new action
- Click Import from URL
- Enter:
https://htmlpub.com/openapi.json - This imports all htmlpub API endpoints as actions
Step 4: Configure Authentication
- In the Action settings, click the Authentication gear icon
- Select API Key
- Set Auth Type to Bearer
- Enter your htmlpub API key (
hp_live_...)
Step 5: Set Privacy Policy
Set the privacy policy URL to: https://htmlpub.com/privacy
Step 6: Save and Test
Click Save → choose Only me (or share publicly if you want).
Test it by asking:
"Create a landing page for a coffee shop called Bean & Brew with a menu, hours, and location section. Publish it as bean-and-brew."
The GPT should generate the HTML and publish it to https://htmlpub.com/p/bean-and-brew.
Available Actions
Once configured, your GPT has access to all htmlpub API endpoints:
- createOrUpdatePage — Publish or update a page
- listPages — Show all your pages
- deletePage — Remove a page
- uploadAsset — Add images or files to a page
- createSite — Group pages into a site
- listSites — Show your sites
- addCustomDomain — Connect a custom domain (Pro)
Tips
- Ask the GPT to iterate: "Make the hero section bigger" or "Change the color scheme to blue"
- Use the GPT with voice mode for hands-free website creation
- Share the GPT with your team so everyone can publish pages
Going Further
- API Documentation — Full API reference
- AI Prompt Cookbook — 10 website templates
- Automate with API — Programmatic publishing