Files
llmgw/internal/web/templates/landing.html
T
Ilker ManapandClaude Opus 5 8d35faf6f8 Give the landing page somewhere to send people
The page explained the API, said keys come from an operator, and left the
reader there. Someone who reaches the address without a key had no route to
getting one, which is where onboarding stopped.

`landing.contact` is that route, because the gateway cannot guess who to ask.
An address becomes a mailto link, an http(s) URL stays a link, and anything
else — a channel, a queue, a person — is shown as text. Other schemes are
never linked: this string comes from configuration, configuration is not
always written by whoever runs the gateway, and a javascript: href on a page
served to every visitor is a short path to a stored XSS. Escaping the text
does not make a scheme safe.

Unconfigured, it now says something rather than nothing, and the page explains
that a key arrives as a one-time link so the reader knows what to expect
before it lands.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-16 09:22:42 +02:00

60 lines
2.3 KiB
HTML

{{define "landing"}}<!doctype html>
<html lang="en"><head>
<meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1">
<title>llmgw</title><link rel="stylesheet" href="/_static/base.css">
</head><body><div class="wrap">
<header>
<h1>llmgw</h1>
<p class="sub">An OpenAI-compatible endpoint in front of self-hosted models.</p>
</header>
<p>Point any OpenAI client at this address. The API is the one you already have a
client for; only the base URL changes.</p>
<h2>Base URL</h2>
<pre>{{.BaseURL}}/v1</pre>
<h2>Example</h2>
<pre>curl {{.BaseURL}}/v1/chat/completions \
-H "Authorization: Bearer $LLMGW_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model": "MODEL", "messages": [{"role":"user","content":"hello"}]}'</pre>
<pre>from openai import OpenAI
client = OpenAI(base_url="{{.BaseURL}}/v1", api_key=os.environ["LLMGW_API_KEY"])</pre>
<h2>Which models</h2>
{{if .AuthEnabled}}
<p><code>GET /v1/models</code> lists what is available to your key. It needs the key,
which is why this page does not list them: this page is served to anyone who can
reach the address.</p>
{{else}}
<p><code>GET /v1/models</code> lists what is available.</p>
<p class="note">This gateway has no API keys configured, so it serves anyone who can
reach it. That is a deployment choice and only safe on a trusted network.</p>
{{end}}
<h2>Getting a key</h2>
{{if .Contact}}
<p>Ask {{if .ContactHref}}<a href="{{.ContactHref}}">{{.Contact}}</a>{{else}}<strong>{{.Contact}}</strong>{{end}}
for one.</p>
{{else}}
<p>Keys are issued by whoever operates this gateway. If you do not know who that
is, the address you reached this page at is the place to start asking.</p>
{{end}}
<p>You will be sent a one-time link. Opening it shows the key once and then the
link stops working, so the key never has to travel through a chat window. Put it
in a password manager straight away — nothing can produce it again, because only
its hash is kept here.</p>
{{if .Notice}}<p class="note">{{.Notice}}</p>{{end}}
<h2>Once you have one</h2>
<ul>
<li><code>GET {{.BaseURL}}/v1/models</code> — what your key may use</li>
<li><code>GET {{.BaseURL}}/me</code> — its limits, and what it has spent</li>
</ul>
<footer><span>llmgw {{.Version}}</span><span>{{.Now}}</span></footer>
</div></body></html>{{end}}