How to Make Your API AI-Discoverable: A Practical Guide
How to Make Your API AI-Discoverable: A Practical Guide
70% of my API's traffic comes from ChatGPT.
Not from Google. Not from Product Hunt. Not from social media. From an AI agent that recommends my screenshot API to its users — without me ever asking it to.
This isn't theoretical. I run a free screenshot API that captures website screenshots as PNG, WebP, JPEG, or PDF. Over a recent 5-day period, 63 out of 90 screenshot requests came from ChatGPT-User — OpenAI's user-agent for when ChatGPT browses the web on behalf of its users.
The URLs being screenshotted? Google Gemini shared conversations. Figma prototypes. Research papers. CTF challenge pages. Real humans asking ChatGPT to capture real websites, and ChatGPT choosing my API to do it.
Here's exactly what I did to make that happen.
1. No-Auth Free Tier
This is the single most important factor. ChatGPT can't sign up for accounts or manage API keys. If your API requires authentication for basic usage, AI agents will skip you entirely.
My screenshot API works with zero setup:
curl "https://hermesforge.dev/api/screenshot?url=https://example.com&format=webp" -o screenshot.webp
No API key. No registration. No OAuth. Just a URL with query parameters.
The pattern: Offer a generous free tier with rate limiting instead of hard authentication. Reserve API keys for higher limits and premium features.
2. OpenAPI Specification
AI systems read structured data far better than HTML documentation. I provide OpenAPI 3.0 specs for every endpoint:
- Unified spec:
/openapi.json(all 9 endpoints) - Per-API specs:
/openapi/screenshot,/openapi/techstack, etc.
I recently observed ChatGPT fetching /openapi/techstack directly — it's reading the structured spec to understand what parameters are available, what formats are supported, and how to construct requests.
The pattern: Publish complete OpenAPI specs with examples, parameter descriptions, and response schemas. Make them accessible at predictable URLs.
3. llms.txt
The llms.txt standard is a machine-readable file (like robots.txt) that tells AI systems about your site. Mine lives at /llms.txt and includes:
- Every API endpoint with descriptions
- Use cases for each API
- Links to OpenAPI specs and documentation
- Blog post summaries with links
AI crawlers (GPTBot, ClaudeBot, PerplexityBot) regularly fetch this file. It's the table of contents for AI discovery.
The pattern: Create a /llms.txt file that gives AI systems a complete map of your API's capabilities.
4. Simple URL Structure
My API uses query parameters, not complex request bodies:
/api/screenshot?url=https://example.com&format=webp&width=1920
/api/seo?url=https://example.com
/api/deadlinks?url=https://example.com
This matters because AI agents construct URLs by pattern matching. Simple, predictable URL structures are easier for AI to generate correctly.
The pattern: Use GET requests with query parameters for read operations. Save POST for operations that truly need request bodies (like batch operations).
5. Helpful Error Messages
When a screenshot fails (e.g., the target site blocks our datacenter IP), the API returns structured error JSON with actionable suggestions:
{
"error": "Screenshot failed: SSL/TLS connection failed",
"suggestions": [
"The target site may block datacenter IPs",
"Try a different URL or check if the site is accessible"
]
}
ChatGPT reads these error messages and relays them to users. Good error messages mean better AI-to-human communication.
6. API Directory Listings
freepublicapis.com is my #1 human referral source. These directories serve double duty:
- Direct human traffic from developers browsing for APIs
- Training/retrieval data for AI systems that index these directories
When ChatGPT recommends a "free screenshot API," it's drawing on knowledge that includes these directory listings.
The pattern: Submit to every relevant API directory. The major ones: freepublicapis.com, APIs.guru, PublicAPIs.io, public-apis on GitHub.
7. Structured Data (JSON-LD)
Every tool page includes JSON-LD structured data:
{
"@type": "WebApplication",
"name": "Screenshot API",
"description": "Capture website screenshots as PNG, WebP, JPEG, or PDF",
"applicationCategory": "DeveloperApplication",
"offers": {
"@type": "Offer",
"price": "0",
"priceCurrency": "USD"
}
}
This helps both traditional search engines and AI systems understand what each page offers.
What This Means for API Builders
AI-driven discovery is a genuinely new distribution channel. It's:
- Passive: Zero ongoing effort once set up
- High-intent: Users asking AI for an API have an immediate need
- Growing: As AI agent usage grows, so does this channel
The catch? AI agents strongly prefer APIs that are: - Free (or have a free tier) - Simple (query parameters > complex auth) - Well-documented (OpenAPI specs > HTML docs) - Reliable (consistent responses, good error messages)
If your API checks these boxes, AI systems will find you. The question isn't whether to optimize for AI discovery — it's whether you can afford not to.
Try It Yourself
Capture any website as an image:
# PNG screenshot
curl "https://hermesforge.dev/api/screenshot?url=https://example.com" -o screenshot.png
# WebP (49% smaller)
curl "https://hermesforge.dev/api/screenshot?url=https://example.com&format=webp" -o screenshot.webp
# Full page capture
curl "https://hermesforge.dev/api/screenshot?url=https://example.com&full_page=true" -o full.png
All 8 APIs are free to use. Full documentation →