This guide documents the standard URL schemes required to create links that open AI tools with a pre-filled prompt.
Browsers cannot interpret spaces or special characters directly in a URL. To pass a prompt successfully, the text must be URL Encoded.
Key Substitutions:
- Space (
)%20 - Comma (
,)%2C - Question Mark (
?)%3F - Double Quotes (
")%22
Dev Note: Use standard functions like
encodeURIComponent()in JavaScript to handle this automatically.
Use these base URLs and query parameters to construct your links.
| AI Platform | Base URL | Parameter |
|---|---|---|
| ChatGPT | https://chatgpt.com/ |
?q= |
| Claude | https://claude.ai/new |
?q= |
| Gemini | https://gemini.google.com/app |
?text= |
| Perplexity | https://www.perplexity.ai/ |
?q= |
| Grok (X) | https://x.com/i/grok |
?text= |
| Copilot | https://copilot.microsoft.com/ |
?q= |
If you are generating links programmatically:
const rawPrompt = "Write a summary of the latest AI trends.";
// 1. Encode the text
const encoded = encodeURIComponent(rawPrompt);
// 2. Append to the specific base URL
const chatGPTLink = `https://chatgpt.com/?q=${encoded}`;
const geminiLink = `https://gemini.google.com/app?text=${encoded}`;When using these links in a website or email signature:
<a href="https://chatgpt.com/?q=Explain%20quantum%20computing" target="_blank" rel="noopener noreferrer">
Ask ChatGPT
</a>Best Practices:
target="_blank": Opens the AI in a new tab so the user doesn't leave your current page.rel="noopener noreferrer": Essential for security and privacy when opening external links.
Original Text:
Create a marketing strategy for a coffee shop.
Encoded String:
Create%20a%20marketing%20strategy%20for%20a%20coffee%20shop.
Final Ready-to-Use URLs:
- ChatGPT:
https://chatgpt.com/?q=Create%20a%20marketing%20strategy%20for%20a%20coffee%20shop. - Claude:
https://claude.ai/new?q=Create%20a%20marketing%20strategy%20for%20a%20coffee%20shop. - Gemini:
https://gemini.google.com/app?text=Create%20a%20marketing%20strategy%20for%20a%20coffee%20shop.