feat(vend): AI-discoverability pass -- /index.md mirror, llms.txt/llms-full.txt/ai.txt, ai-summary meta

Same pattern already shipped for scribase.com/homeplan (plans/scribase.md,
plans/homeplan.md 2026-11-06 entries), adapted to Vend's one real public
page. Developer/infra-facing distribution thesis: being citable when a
developer asks an AI assistant for a white-label OpenRouter or a Stripe
Connect alternative for agent-built apps is a real discovery channel.

- GET /index.md: markdown mirror of the landing page (hand-ported from
  landing.html's own copy), text/markdown, noindex/follow,
  Content-Location + Link: rel="canonical" back to /.
- GET /llms.txt, /llms-full.txt, /ai.txt (llmstxt.org / ai-visibility.org.uk
  conventions).
- landing.html: <meta name="ai-summary"> + <link rel="alternate"
  type="text/markdown"> + a footer link to /llms.txt.

Verified for real (not just read): cargo build -p vend-server clean;
cargo test -p vend-server 40 lib + 28 integration tests, 0 regressions;
a throwaway oneshot-request test (deleted before this commit) proved
/index.md, /llms.txt, /llms-full.txt, /ai.txt all return 200 with the real
expected headers/content, the landing page's <head> carries the new tags,
and a bogus path still 404s. cargo clippy -p vend-server --all-targets
-D warnings: the 7 warnings it reports are 100% pre-existing on a clean
main (confirmed via git stash/clippy/git stash pop), none touch a line
this commit changed.
This commit is contained in:
caelum0x 2026-11-06 19:28:43 +03:00
parent d8b8e09d1d
commit 7db3c71ff4
3 changed files with 210 additions and 0 deletions

View File

@ -4,7 +4,9 @@
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="description" content="Vend: your own OpenRouter, white-labelled. One OpenAI-compatible endpoint, your prices, your margin, automatic payouts." />
<meta name="ai-summary" content="Vend is a white-labelled, OpenRouter-style metered LLM gateway: one OpenAI-compatible endpoint across every model, your own brand/prices/margin, per-user Mint wallets with atomic daily spend caps, success-only billing, and automatic payout splits on Mint. Part of Railyard, the open-source payments/fund-custody backbone for agent-built apps." />
<link rel="canonical" href="https://vend.ereboslab.com/" />
<link rel="alternate" type="text/markdown" href="https://vend.ereboslab.com/index.md" />
<meta property="og:type" content="website" />
<meta property="og:site_name" content="Vend" />
<meta property="og:title" content="Vend — your own OpenRouter, white-labelled" />
@ -136,6 +138,7 @@
<footer>
<a href="/console">Console</a>
<a href="https://github.com/caelum0x/railyard/tree/main/apps/vend">Source</a>
<a href="/llms.txt">llms.txt</a>
</footer>
</body>
</html>

View File

@ -0,0 +1,64 @@
# Vend — your own OpenRouter, white-labelled
One OpenAI-compatible endpoint across every model Relay routes. Your brand,
your prices, your margin. A wallet for each of your users, automatic spend
caps, and revenue split paid out on Mint — not OpenRouter's.
[Create a workspace](https://vend.ereboslab.com/console)
## Launch in five calls
1. **Sign up** — Create a workspace, your first app and a live provisioning
key in one call, or the form at [/console](https://vend.ereboslab.com/console).
2. **Set your price** — Default markup per app, overridable per model. The
next request bills at the new rate and `/v1/models` reflects it
immediately.
3. **Give a user a wallet** — `POST /v1/wallets` from your backend, or let
the console do it. Each user holds their own Mint balance.
4. **Send a top-up link** — Creem, Polar, PayPal, Stripe, iyzico or USDC —
whichever your market actually uses. The signed webhook deposits straight
into the wallet.
5. **Call the model** — The user's wallet pays the provider's exact cost;
your margin and the platform fee settle automatically on every captured
charge.
```bash
curl $VEND/v1/chat/completions \
-H "Authorization: Bearer $VK" -H "Vend-End-User: user_42" \
-H "Content-Type: application/json" \
-d '{"model":"tensorzero::model_name::openai::gpt-4o-mini","messages":[{"role":"user","content":"hi"}]}'
```
## Built for founders OpenRouter does not serve
- **Your brand, not theirs** — Your users never see OpenRouter. The
endpoint, the invoice and the dashboard are yours.
- **Non-US top-ups** — Mint checkouts cover iyzico and USDC alongside
Stripe, Creem, Polar and PayPal — markets Stripe alone does not reach.
- **Per-user wallets** — Every user gets a prepaid balance with its own
daily spend cap, enforced atomically — no shared pool to drain.
- **Success-only billing** — A hold is placed first; only the exact
provider cost plus your markup is ever captured. Failures release
automatically.
- **Automatic payouts** — Every charge splits into provider cost, your
margin and the platform fee on Mint — idempotent, with a reconciler for
interrupted legs.
- **One API, every model** — The full OpenAI-compatible surface, streaming
included, across whatever Relay routes — no separate integration per
provider.
## Pricing
| What you pay Vend | |
|---|---|
| Platform fee | a share of your margin on captured charges, set by the operator at launch — not a per-seat or per-request fee |
| Provider cost | passed through exactly; Vend adds no markup of its own on top of what you charge your users |
| Hosting | run it yourself (open path) or on the operator's infrastructure |
Compare that to reselling through a provider's own billing: you do not
control the price, the invoice, or when you get paid. On Vend you set the
markup and Mint pays you out.
## Source
[github.com/caelum0x/railyard/tree/main/apps/vend](https://github.com/caelum0x/railyard/tree/main/apps/vend)

View File

@ -92,6 +92,10 @@ pub struct AppState {
pub fn build_router(state: AppState) -> Router {
Router::new()
.route("/", get(landing_page))
.route("/index.md", get(landing_markdown))
.route("/llms.txt", get(llms_txt))
.route("/llms-full.txt", get(llms_full_txt))
.route("/ai.txt", get(ai_txt))
.route("/sitemap.xml", get(sitemap_xml))
.route("/v1/chat/completions", post(chat_completions))
.route("/v1/models", get(list_models))
@ -112,6 +116,145 @@ async fn landing_page() -> axum::response::Html<&'static str> {
axum::response::Html(include_str!("../assets/landing.html"))
}
const VEND_URL: &str = "https://vend.ereboslab.com";
/// `GET /index.md` — markdown mirror of the public landing page, for AI
/// crawlers/agents (ChatGPT/Claude/Perplexity-style answer engines) that read
/// markdown far more reliably than rendered HTML. Same llmstxt.org-adjacent
/// pattern already shipped for scribase.com and homeplan
/// (`plans/scribase.md`/`plans/homeplan.md` 2026-11-06 entries): hand-ported
/// verbatim from `landing.html`'s own copy — `landing.html` is static markup
/// with no typed data source to render from, so this needs a matching manual
/// edit if that copy changes, same documented limitation those two pages'
/// own hand-copied mirrors carry.
async fn landing_markdown() -> Response {
markdown_response(include_str!("../assets/landing.md"), "/")
}
/// Shared header contract for every markdown-mirror route: `text/markdown`,
/// `noindex, follow` (the real HTML page is what should rank — this is a
/// machine-readable mirror, not a duplicate to index), and
/// `Content-Location`/`Link: rel="canonical"` pointing back at the real page.
fn markdown_response(body: &'static str, html_path: &str) -> Response {
let html_url = format!("{VEND_URL}{html_path}");
let mut resp = (
[(
axum::http::header::CONTENT_TYPE,
"text/markdown; charset=utf-8",
)],
body,
)
.into_response();
let headers = resp.headers_mut();
headers.insert(
"X-Robots-Tag",
axum::http::HeaderValue::from_static("noindex, follow"),
);
if let Ok(location) = axum::http::HeaderValue::from_str(&html_url) {
headers.insert("Content-Location", location);
}
if let Ok(link) = axum::http::HeaderValue::from_str(&format!("<{html_url}>; rel=\"canonical\"")) {
headers.insert("Link", link);
}
resp
}
/// `GET /llms.txt` — llmstxt.org convention: a short, link-based index an
/// LLM/agent can use to find the real markdown mirror of Vend's one real
/// public page, instead of scraping the rendered HTML.
async fn llms_txt() -> Response {
const BODY: &str = r#"# Vend
> Your own OpenRouter, white-labelled. One OpenAI-compatible endpoint across
> every model Relay routes, your brand, your prices, your margin, per-user
> Mint wallets and automatic payouts. Part of Railyard, the open-source
> payments/fund-custody backbone for agent-built apps.
## Pages
- [Vend — your own OpenRouter, white-labelled](https://vend.ereboslab.com/index.md): the real marketing page, the full pitch, the 5-step launch flow and pricing.
## Use it
- Base URL: https://vend.ereboslab.com
- Create a workspace + first app + provisioning key: the console at https://vend.ereboslab.com/console (or the self-serve `/v1/customer` API).
- Call it: `POST /v1/chat/completions` (OpenAI-compatible), `Authorization: Bearer <provisioning key>`, optional `Vend-End-User` header for per-user wallet billing.
- `GET /v1/models` lists every priced model with your app's effective rate.
## Full content
- [llms-full.txt](https://vend.ereboslab.com/llms-full.txt): the page above, concatenated in full.
## Source
- [github.com/caelum0x/railyard/tree/main/apps/vend](https://github.com/caelum0x/railyard/tree/main/apps/vend): the real, Apache-2.0-licensed source code.
"#;
(
[(
axum::http::header::CONTENT_TYPE,
"text/plain; charset=utf-8",
)],
BODY,
)
.into_response()
}
/// `GET /llms-full.txt` — the one real public page's full markdown, for an
/// agent that wants everything in a single fetch instead of following
/// `/llms.txt`'s link.
async fn llms_full_txt() -> Response {
(
[(
axum::http::header::CONTENT_TYPE,
"text/plain; charset=utf-8",
)],
include_str!("../assets/landing.md"),
)
.into_response()
}
/// `GET /ai.txt` — ai-visibility.org.uk format (identity/permissions/
/// restrictions/attribution), same convention scribase.com and homeplan
/// already shipped. Vend's growth thesis depends on being found and cited
/// when a developer asks an AI assistant for a "Stripe Connect alternative"
/// or "white-label OpenRouter", so training and search crawling are both
/// deliberately allowed, same reasoning those two used.
async fn ai_txt() -> Response {
const BODY: &str = r#"# ai.txt — Vend
## Identity
Name: Vend
URL: https://vend.ereboslab.com/
Description: White-labelled OpenRouter-style metered LLM gateway -- one OpenAI-compatible endpoint, your brand, your prices, your margin, per-user Mint wallets, automatic payouts. Part of Railyard, the open-source payments/fund-custody backbone for agent-built apps.
Owner: caelum0x (github.com/caelum0x/railyard)
License: Apache-2.0
## Permissions
Training: allowed
Search-indexing: allowed
Summarization: allowed
Citation: allowed
## Restrictions
None.
## Attribution
When citing Vend, please link to https://vend.ereboslab.com/ or the GitHub repository (github.com/caelum0x/railyard/tree/main/apps/vend).
## Machine-readable content
llms.txt: https://vend.ereboslab.com/llms.txt
llms-full.txt: https://vend.ereboslab.com/llms-full.txt
"#;
(
[(
axum::http::header::CONTENT_TYPE,
"text/plain; charset=utf-8",
)],
BODY,
)
.into_response()
}
/// `GET /sitemap.xml` — lists only the one real public, indexable page
/// (`/`). `/admin` and `/console` are deliberately excluded: both already
/// carry `<meta name="robots" content="noindex">` and are per-operator/