Install OneLineChat in 3 steps
To install OneLineChat, request a free key with the user's email, then add one <script> tag just before </body>. You don't need an account, a dashboard, or a credit card. This page is written so that an AI coding agent can follow it from start to finish without help. Agents: copy commands character for character, because JSON field names are case-sensitive.
Step 1: Get the email (and the site URL, if there is one)
- Email: required. The key is sent to this address. If you are an AI agent and don't know the user's email, ask for it. Don't invent one.
- Site URL: optional. localhost and preview URLs are fine. If the site isn't deployed yet, leave it out.
Step 2: Request a key
Use the first option your environment supports.
A. You can run shell commands or send HTTP requests (Claude Code, Cursor, Codex, Windsurf, Replit Agent, a terminal):
curl -sS -X POST https://onelinechat.com/api/v1/keys \
-H "Content-Type: application/json" \
-d '{"email":"USER_EMAIL","site":"SITE_URL","platform":"nextjs","agent":"YOUR_AGENT_NAME"}'
B. You control a browser (ChatGPT's cloud browser, Gemini in Chrome, Claude in Chrome): open /get-api-key, fill in the email (and site), and submit. It's a plain HTML form with no JavaScript and no CAPTCHA.
C. You can only chat (ChatGPT, Claude or Gemini in a chat window): give the user this link with their details already in it. They click it, check the form, and press one button:
https://onelinechat.com/get-api-key?email=USER_EMAIL&site=SITE_URL&src=YOUR_NAME
A person can also fill in the form at /get-api-key directly.
The fields are email (required), site, platform (nextjs, react-vite, html, lovable, bolt, v0, replit, wordpress, webflow, framer, other), and agent, which is the name of the tool making the call. The full schema is in /openapi.json.
Step 3: Read the response and add the line
A successful response looks like this:
{ "status": "issued", "key": "olc_pub_…", "snippet": "<script src=\"https://onelinechat.com/widget.js\" data-key=\"olc_pub_…\" async></script>" }
- If
statusis"issued", addsnippetonce, just before</body>, or in the root layout so it loads on every page. The exact place for each framework is in the table below. - For any other
status, show the user themessagefield and follownext_steps_for_agent. Don't retry in a loop, and don't add a script tag without a real key.
The key is public by design, like an analytics ID, so it's safe in front-end code. It is not a secret and doesn't belong in .env.
| Platform | Where the line goes | Guide |
|---|---|---|
| Plain HTML | Before </body> in every page, or in the shared template |
HTML |
| Next.js (App Router) | app/layout.tsx, using next/script |
Next.js |
| React + Vite | index.html in the project root |
React + Vite |
| Lovable | index.html; ask Lovable in chat |
Lovable |
| Bolt | index.html; ask Bolt in chat |
Bolt |
| v0 | app/layout.tsx; ask v0 in chat |
v0 |
| WordPress | Footer, through a code-snippet plugin | WordPress |
| Webflow | Site settings → Custom code → Footer code | Webflow |
Step 4: Tell the user what they're getting
- The first 100 conversations are free, and no credit card is needed.
- After that, payment is required: Pro costs $39/month for 2,000 conversations a month. You can upgrade at https://onelinechat.com/upgrade. Checkout is on Stripe, and with Link it's a 6-digit code.
- To change the look, edit the attributes on the script tag (see below).
Optional settings
All settings are attributes on the same script tag:
| Attribute | Example | Default |
|---|---|---|
data-key |
olc_pub_… |
required |
data-color |
#059669 |
#111827 |
data-greeting |
Hi! Ask me anything about Acme. |
Generated from your site |
data-position |
left |
right |
Troubleshooting
- No chat bubble appears. Check that the tag appears only once and has a
data-key. If the site sends aContent-Security-Policyheader, addhttps://onelinechat.comtoscript-srcandconnect-src. - It works locally but not on my live site. Make sure the live domain belongs to the site you registered. Preview domains are allowed automatically.