diff --git a/apps/vend/crates/vend-server/assets/landing.html b/apps/vend/crates/vend-server/assets/landing.html index 9c34ce2a..b728a3ac 100644 --- a/apps/vend/crates/vend-server/assets/landing.html +++ b/apps/vend/crates/vend-server/assets/landing.html @@ -4,7 +4,9 @@ + + @@ -136,6 +138,7 @@ diff --git a/apps/vend/crates/vend-server/assets/landing.md b/apps/vend/crates/vend-server/assets/landing.md new file mode 100644 index 00000000..0ef46850 --- /dev/null +++ b/apps/vend/crates/vend-server/assets/landing.md @@ -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) diff --git a/apps/vend/crates/vend-server/src/lib.rs b/apps/vend/crates/vend-server/src/lib.rs index bf5965e9..eb21882b 100644 --- a/apps/vend/crates/vend-server/src/lib.rs +++ b/apps/vend/crates/vend-server/src/lib.rs @@ -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 `, 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 `` and are per-operator/