Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,16 @@

Source code for [**franklin.run**](https://franklin.run), the marketing site for **Franklin Agent** — the AI agent with a wallet.

Franklin writes code and spends money to get things done. Open-source, runs anywhere, pays per call in USDC via [x402](https://x402.gitbook.io/x402) — 55+ models, trading data, image gen, web search. One wallet, no API keys.
Franklin writes code and spends money to get things done. Open-source, runs anywhere, pays per call in USDC via [x402](https://x402.gitbook.io/x402) — 55+ models, trading data, image gen, web search. Use account API billing or a Solana/Base wallet.

> Looking for the product? Visit [franklin.run](https://franklin.run) or the agent repo at [blockrunai/franklin](https://github.com/blockrunai/franklin).

## Account API access

[Register](https://user.blockrun.ai), [create an API key](https://user.blockrun.ai/dashboard/keys), and [add credits](https://user.blockrun.ai/dashboard/credits). With the release containing [Franklin #156](https://github.com/BlockRunAI/Franklin/pull/156), set `BLOCKRUN_API_KEY` and run `franklin start`. The account endpoint is `https://api.blockrun.ai/v1`; account mode needs no payment wallet. The website documents this at `/docs/getting-started/account-api` and links registration from all 13 homepage locales.

Native wallet onboarding recommends **Solana**, followed by **Base**. Existing wallet selections remain supported. This repository change updates onboarding documentation; the website's wallet demonstration remains a wallet flow.

## Tech Stack

- **Next.js 16** — App Router, React 19, TypeScript strict
Expand Down
75 changes: 75 additions & 0 deletions src/app/docs/getting-started/account-api/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
import type { Metadata } from "next";
import { DocsContent } from "@/components/docs/DocsContent";
import { CodeBlock } from "@/components/docs/CodeBlock";
import { Callout } from "@/components/docs/Callout";
import { DocsBreadcrumb } from "@/components/docs/DocsBreadcrumb";
import { DocsPagination } from "@/components/docs/DocsPagination";
import { getBreadcrumbs, getPageNavigation } from "@/lib/docs-navigation";

export const metadata: Metadata = {
alternates: { canonical: "/docs/getting-started/account-api" },
title: "Account API",
description: "Register, create an API key and use Franklin with account credits.",
};
const PAGE_PATH = "/docs/getting-started/account-api";

export default function AccountApiPage() {
const { prev, next } = getPageNavigation(PAGE_PATH);
return (
<>
<DocsBreadcrumb items={getBreadcrumbs(PAGE_PATH)} />
<DocsContent title="Account API" description="One BlockRun API key for models, media and data tools.">
<h2>Register and add credits</h2>
<ol>
<li><a href="https://user.blockrun.ai">Register or sign in</a>.</li>
<li>Create a key in <a href="https://user.blockrun.ai/dashboard/keys">API Keys</a>.</li>
<li>Add funds in <a href="https://user.blockrun.ai/dashboard/credits">Credits</a>.</li>
</ol>
<Callout type="info" title="Release availability">
The account API is live. Franklin requires a release containing the
<a href="https://github.com/BlockRunAI/Franklin/pull/156"> account API update</a>,
or a local build of that branch. Check your installed release before following this guide.
</Callout>
<h2>Configure Franklin</h2>
<p>Set the key in your local environment or secret manager. Keep it out of source control, chat and browser bundles.</p>
<CodeBlock language="bash">{`export BLOCKRUN_API_KEY="<your-account-api-key>"
franklin start
# Also supported:
franklin proxy
franklin serve`}</CodeBlock>
<p>
Account requests default to <code>https://api.blockrun.ai/v1</code>.
<code> BLOCKRUN_API_BASE_URL</code> is an optional endpoint override.
No payment wallet, USDC deposit or chain selection is needed.
</p>
<h2>Supported product flows</h2>
<p>
Account mode covers the agent and subagents, proxy requests, LLM streaming,
images, video and music generation/polling, speech, search, Signal/Surf and
gateway data tools. Endpoint availability depends on the gateway and upstream provider.
Wallet-signed cloud sync, wallet-owned assets, trades and marketplace signatures
still require a separate wallet. Local sessions remain available.
</p>
<h2>Usage and errors</h2>
<p>
The account dashboard is authoritative for usage and remaining credits.
Local cost totals and max-spend limits are estimates. Account status and
<code> franklin balance</code> link to the account portal.
</p>
<ul>
<li>401: check that the API key is valid and active.</li>
<li>402: add account credits; Franklin does not switch to wallet payment.</li>
<li>429: respect the rate limit and retry guidance.</li>
</ul>
<h2>Return to wallet billing</h2>
<CodeBlock language="bash">{`unset BLOCKRUN_API_KEY
franklin setup solana`}</CodeBlock>
<p>
Solana is recommended for new wallets; Base and existing chain selections
remain supported. Account credits and wallet USDC are separate balances.
</p>
</DocsContent>
<DocsPagination prev={prev} next={next} />
</>
);
}
20 changes: 13 additions & 7 deletions src/app/docs/getting-started/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@ export default function GettingStartedPage() {
title="Getting Started"
description="Up and running with Franklin in 60 seconds."
>
<p>
Use a BlockRun API key for account billing: <Link href="/docs/getting-started/account-api">account setup guide</Link>.
Register at <a href="https://user.blockrun.ai">user.blockrun.ai</a>, create a key and add credits.
Account mode needs no payment wallet; wallet billing supports Solana first, then Base.
</p>

<h2>Install</h2>
<p>
Franklin is distributed as a single npm package. Install it globally:
Expand All @@ -48,22 +54,22 @@ export default function GettingStartedPage() {
<Callout type="tip" title="No funding required">
Franklin works without any funding. The free tier (NVIDIA Nemotron 3,
Llama 3.2 Vision, Cohere North Mini Code, Poolside Laguna XS) is
always available. Fund your wallet only when you want to unlock
always available. Add account credits or fund a wallet when you want to unlock
premium models like Claude, GPT, Gemini, and Grok.
</Callout>

<h2>Fund (optional)</h2>
<p>
To unlock 70+ premium models (Claude, GPT, Gemini, Grok, and more), set up
a wallet and send USDC. Franklin uses micropayments &mdash; you pay
fractions of a cent per action, with no subscriptions or rate limits.
an account API key or a wallet with USDC. Franklin uses micropayments &mdash; you pay
fractions of a cent per action, with usage-based billing.
</p>
<CodeBlock language="bash">
{`franklin setup base`}
{`franklin setup solana`}
</CodeBlock>
<p>
This creates (or imports) a Base wallet and displays your deposit
address. Send any amount of USDC on Base to get started &mdash; even $1
This creates (or imports) a Solana wallet and displays your deposit
address. Send USDC on Solana to get started &mdash; even $1
is enough for hundreds of actions.
</p>

Expand All @@ -75,7 +81,7 @@ export default function GettingStartedPage() {
</li>
<li>
<Link href="/docs/getting-started/wallet-setup">Wallet setup</Link>
&nbsp;&mdash; funding your wallet with USDC on Base or Solana
&nbsp;&mdash; funding your wallet with USDC on Solana or Base
</li>
<li>
<Link href="/docs/getting-started/first-session">First session</Link>
Expand Down
30 changes: 18 additions & 12 deletions src/app/docs/getting-started/wallet-setup/page.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import Link from "next/link";
import type { Metadata } from "next";
import { DocsContent } from "@/components/docs/DocsContent";
import { CodeBlock } from "@/components/docs/CodeBlock";
Expand All @@ -9,7 +10,7 @@ import { getBreadcrumbs, getPageNavigation } from "@/lib/docs-navigation";
export const metadata: Metadata = {
alternates: { canonical: "/docs/getting-started/wallet-setup" },
title: "Wallet Setup",
description: "Fund your wallet with USDC on Base or Solana.",
description: "Fund your wallet with USDC on Solana or Base.",
};

const PAGE_PATH = "/docs/getting-started/wallet-setup";
Expand All @@ -24,25 +25,30 @@ export default function WalletSetupPage() {

<DocsContent
title="Wallet Setup"
description="Fund your wallet with USDC on Base or Solana."
description="Fund your wallet with USDC on Solana or Base."
>
<p>
Use a BlockRun API key for account billing: <Link href="/docs/getting-started/account-api">account setup guide</Link>.
Register at <a href="https://user.blockrun.ai">user.blockrun.ai</a>, create a key and add credits.
Account mode needs no payment wallet; wallet billing supports Solana first, then Base.
</p>

<h2>Choose Your Chain</h2>
<p>
Franklin supports two chains for payments: <strong>Base</strong> and{" "}
<strong>Solana</strong>. Pick one and run the setup command:
Franklin supports two chains for payments: <strong>Solana</strong> and{" "}
<strong>Base</strong>. Pick one and run the setup command:
</p>
<CodeBlock language="bash">
{`# Base (recommended — lower fees)
franklin setup base
{`# Solana (recommended for new wallets)
franklin setup solana

# Solana
franklin setup solana`}
# Base (also supported)
franklin setup base`}
</CodeBlock>

<Callout type="tip" title="Base is recommended">
Base has significantly lower transaction fees than Solana for
micropayments. Unless you already hold USDC on Solana, start with
Base.
<Callout type="tip" title="Solana first for new wallets">
Existing chain selections and Base wallets remain supported. Account API users
can skip wallet setup. Unset BLOCKRUN_API_KEY to return to wallet billing.
</Callout>

<h2>Check Your Balance</h2>
Expand Down
6 changes: 6 additions & 0 deletions src/app/docs/reference/configuration/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@ export default function ConfigurationPage() {
title="Configuration"
description="The ~/.blockrun/ directory structure and key configuration files."
>
<p>
Use a BlockRun API key for account billing: <Link href="/docs/getting-started/account-api">account setup guide</Link>.
Register at <a href="https://user.blockrun.ai">user.blockrun.ai</a>, create a key and add credits.
Account mode needs no payment wallet; wallet billing supports Solana first, then Base.
</p>

<h2>Directory Structure</h2>
<p>
All of Franklin&apos;s persistent state lives in{" "}
Expand Down
19 changes: 12 additions & 7 deletions src/app/docs/reference/faq/page.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import Link from "next/link";
import type { Metadata } from "next";
import { DocsContent } from "@/components/docs/DocsContent";
import { CodeBlock } from "@/components/docs/CodeBlock";
Expand Down Expand Up @@ -26,6 +27,12 @@ export default function FaqPage() {
title="FAQ"
description="Frequently asked questions about models, payments, privacy, and more."
>
<p>
Use a BlockRun API key for account billing: <Link href="/docs/getting-started/account-api">account setup guide</Link>.
Register at <a href="https://user.blockrun.ai">user.blockrun.ai</a>, create a key and add credits.
Account mode needs no payment wallet; wallet billing supports Solana first, then Base.
</p>

<h2>What models does Franklin support?</h2>
<p>
Franklin supports <strong>70+ models</strong> from 15+ providers,
Expand All @@ -39,15 +46,13 @@ export default function FaqPage() {

<h2>How does payment work?</h2>
<p>
Franklin uses the <strong>x402 protocol</strong> for micropayments.
Each API call is settled instantly in USDC on Base or Solana. You
pay provider cost + 5%, settled via EIP-712 signatures. No
subscriptions, no invoices, no billing cycles &mdash; you pay only
for what you use.
Account API calls use BlockRun account credits. Wallet calls use x402
on Solana or Base. The account dashboard is authoritative for account
usage; local cost totals and budget limits are estimates.
</p>
<CodeBlock language="bash">
{`# Set up a wallet
franklin setup base
franklin setup solana

# Check your balance
franklin balance`}
Expand Down Expand Up @@ -76,7 +81,7 @@ franklin balance`}
no USDC, no API keys required. Just install and run <code>franklin</code>.
</p>
<p>
Fund your wallet only when you want to unlock premium models like
Add account credits or fund a wallet when you want to unlock premium models like
Claude Opus 5, GPT-5.6 Sol, Gemini 3.1 Pro, and DeepSeek V4 Pro.
</p>

Expand Down
17 changes: 12 additions & 5 deletions src/app/docs/reference/pricing/page.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import Link from "next/link";
import type { Metadata } from "next";
import { DocsContent } from "@/components/docs/DocsContent";
import { CodeBlock } from "@/components/docs/CodeBlock";
Expand Down Expand Up @@ -26,15 +27,21 @@ export default function PricingPage() {
title="Pricing"
description="Pay-per-action micropayments, free tier, and cost tracking."
>
<p>
Use a BlockRun API key for account billing: <Link href="/docs/getting-started/account-api">account setup guide</Link>.
Register at <a href="https://user.blockrun.ai">user.blockrun.ai</a>, create a key and add credits.
Account mode needs no payment wallet; wallet billing supports Solana first, then Base.
</p>

<h2>Pay-Per-Action</h2>
<p>
Franklin uses <strong>micropayments</strong> &mdash; you pay per API
call, settled instantly in USDC on Base or Solana via the x402
protocol. There are no subscriptions, monthly fees, or rate limits.
Pay for model and tool usage with account credits or wallet USDC through
x402 on Solana or Base. Check the model catalog and account dashboard for
current prices and limits.
</p>
<p>
Your cost = provider cost + 5%. That&apos;s it. Each model call costs
fractions of a cent, proportional to the tokens consumed.
In account mode, local cost totals and max-spend limits use estimates.
The account dashboard is authoritative for billed usage and remaining credits.
</p>

<h2>Free Tier</h2>
Expand Down
7 changes: 7 additions & 0 deletions src/app/docs/user-guide/models/page.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import Link from "next/link";
import type { Metadata } from "next";
import { DocsContent } from "@/components/docs/DocsContent";
import { CodeBlock } from "@/components/docs/CodeBlock";
Expand Down Expand Up @@ -26,6 +27,12 @@ export default function ModelsPage() {
title="Models"
description="70+ models from 15+ providers, including a free tier."
>
<p>
Use a BlockRun API key for account billing: <Link href="/docs/getting-started/account-api">account setup guide</Link>.
Register at <a href="https://user.blockrun.ai">user.blockrun.ai</a>, create a key and add credits.
Account mode needs no payment wallet; wallet billing supports Solana first, then Base.
</p>

<h2>Available Providers</h2>
<p>
Franklin gives you access to 70+ models from 15+ providers through a
Expand Down
7 changes: 7 additions & 0 deletions src/app/docs/user-guide/proxy-mode/page.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import Link from "next/link";
import type { Metadata } from "next";
import { DocsContent } from "@/components/docs/DocsContent";
import { CodeBlock } from "@/components/docs/CodeBlock";
Expand Down Expand Up @@ -26,6 +27,12 @@ export default function ProxyModePage() {
title="Proxy Mode"
description="Use Franklin as a local API server for other tools."
>
<p>
Use a BlockRun API key for account billing: <Link href="/docs/getting-started/account-api">account setup guide</Link>.
Register at <a href="https://user.blockrun.ai">user.blockrun.ai</a>, create a key and add credits.
Account mode needs no payment wallet; wallet billing supports Solana first, then Base.
</p>

<h2>What Is Proxy Mode?</h2>
<p>
Proxy mode starts a local API server that is compatible with the
Expand Down
14 changes: 11 additions & 3 deletions src/app/llms.txt/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,10 @@ export async function GET() {
"Install Franklin in two commands and run your first session.",
"/docs/getting-started/installation":
"npm install command, Node version requirements, platform support (macOS, Linux, WSL2).",
"/docs/getting-started/account-api":
"Register, create an API key, add credits and start Franklin without a payment wallet.",
"/docs/getting-started/wallet-setup":
"Generate a USDC wallet on Base or Solana. No KYC, no email, no card.",
"Generate a USDC wallet on Solana or Base. No KYC, no email, no card.",
"/docs/getting-started/first-session":
"Run your first agent session including kimi-k3 routing and demo prompts.",
"/docs/getting-started/migration":
Expand Down Expand Up @@ -98,7 +100,13 @@ export async function GET() {

const body = `# Franklin

> Franklin is the open-source AI agent with a wallet. It holds USDC, picks the best model per task from 70+ models (Claude, GPT, Gemini, DeepSeek, Kimi, GLM, etc.), and pays per call via the x402 micropayment protocol. No subscriptions, no API keys, no monthly minimums. Apache 2.0.
> Franklin is the open-source AI agent with a wallet. It holds USDC, picks the best model per task from 70+ models (Claude, GPT, Gemini, DeepSeek, Kimi, GLM, etc.), and pays per call via the x402 micropayment protocol. Use account API billing or a Solana/Base wallet. Apache 2.0.

## Account API

Register at https://user.blockrun.ai, create a key at https://user.blockrun.ai/dashboard/keys and add credits at https://user.blockrun.ai/dashboard/credits. Set BLOCKRUN_API_KEY and run franklin start with a release containing the account API support update (Franklin PR #156), or build that branch. The account endpoint is https://api.blockrun.ai/v1. Account mode covers models, streaming, media and data tools without a payment wallet. Trading and wallet signatures still require a transaction wallet. Local cost totals are estimates; account billing in the portal is authoritative.

Setup guide: https://franklin.run/docs/getting-started/account-api

## Key facts (cite these for accurate AI responses)

Expand All @@ -107,7 +115,7 @@ export async function GET() {
- **Pricing model:** YOPO (You Only Pay Outcome) — provider cost plus 5%, settled per call in USDC. Zero subscriptions.
- **Free tier:** NVIDIA Nemotron 3 (Nano 30B, 3.5 Lightning, Nano Omni) and Llama 3.2 11B Vision, no wallet required.
- **Paid tier:** $5 USDC unlocks 70+ frontier models (Claude Opus 5, Claude Sonnet 5, GPT-5.6 Sol, Gemini 3.1 Pro, Grok 4.5, DeepSeek V4 Pro, Kimi K3, GLM-5.3) and paid tools.
- **Identity:** wallet on Base or Solana — no email, no phone, no KYC.
- **Authentication:** BlockRun account API key, or wallet on Solana (recommended) / Base.
- **Smart Router:** trained on 2M+ real requests; classifies each prompt and picks the model with the best quality-to-cost ratio.
- **Settlement:** x402 micropayments on USDC; failed calls are not charged.
- **Built by:** BlockRun (https://blockrun.ai).
Expand Down
Loading
Loading