AI News HubLIVE
In-site rewrite2 min read

Open Source AI Harness Profiler – discover where tf your tokens are going

Rekon is an open-source transparent proxy for Anthropic and OpenAI APIs that records token usage and displays it in a dashboard. It offers zero added latency, no key storage, session tree reconstruction, and tool-level attribution, built on Cloudflare Workers.

SourceHacker News AIAuthor: TreDub

Uh oh!

There was an error while loading. Please reload this page.

Notifications You must be signed in to change notification settings

Fork 0

Star 1

BranchesTags

Open more actions menu

Folders and files

NameName

Last commit message

Last commit date

Latest commit

History

2 Commits

2 Commits

.claude

.claude

migrations

migrations

scripts

scripts

shared

shared

src

src

web

web

.dev.vars.example

.dev.vars.example

.env.example

.env.example

.gitignore

.gitignore

.stylelintrc.cjs

.stylelintrc.cjs

AGENTS.md

AGENTS.md

CLAUDE.md

CLAUDE.md

DCO

DCO

LICENSE

LICENSE

NOTICE

NOTICE

README.md

README.md

drizzle.config.ts

drizzle.config.ts

eslint.config.js

eslint.config.js

index.html

index.html

package-lock.json

package-lock.json

package.json

package.json

tsconfig.json

tsconfig.json

vite.config.ts

vite.config.ts

wrangler.jsonc

wrangler.jsonc

Repository files navigation

A transparent proxy for the Anthropic and OpenAI APIs that records token usage and shows it in a dashboard. Point your client at it, keep working as normal, and see per-request tokens, reconstructed sessions, tool-level attribution, and estimated cost.

Built on Cloudflare Workers, D1, Hono, and React.

A hosted instance runs at tryrekon.com.

Features

Zero added latency — responses stream straight through; recording happens off the critical path.

Keys never stored — auth headers are forwarded, never held, so usage is always spent on the caller's own key or subscription.

Session trees — the chat APIs are stateless, so the proxy rebuilds each conversation from client signals, forks and all.

Tool-level attribution — see which tools actually burn the tokens.

How it works

Create a system in the dashboard and it gets its own proxy URL. Point your client at it with one environment variable:

export ANTHROPIC_BASE_URL=https:///s/

OpenAI clients add /openai/v1:

export OPENAI_BASE_URL=https:///s//openai/v1

Requests are forwarded untouched (auth headers included) and usage is recorded on the way back. The system id doubles as the ingest key — unknown ids are rejected, so a deployment is never an open relay. Treat the URL as a secret.

Quick start

git clone https://github.com/TryRekon/Rekon.git cd Rekon npm install

cp .dev.vars.example .dev.vars # set SESSION_SECRET + one OAuth provider (Google or GitHub) npm run typegen npm run db:migrate:local npm run dev # http://localhost:5173

Sign in, copy your system's URL from the onboarding screen, and point a client at it. Recording starts with the first request.

To deploy your own: create a D1 database (wrangler d1 create token-profiler-db) and paste its id into wrangler.jsonc as database_id, then change the routes custom-domain pattern to a zone you control (or remove it for a free workers.dev URL). Set your secrets with wrangler secret put (SESSION_SECRET, an OAuth provider pair, and POSTHOG_KEY if you want analytics), run npm run db:migrate:remote, then npm run deploy. Note that deploy does not run migrations.

Costs are estimates from list prices in shared/pricing.ts; unknown models show no cost.

Docs

The architecture — session reconstruction, token attribution, the endpoint list, and a file-by-file layout — is in AGENTS.md.

License

Apache 2.0. This repository is, and will remain, fully open source; the commercial model is a hosted deployment, not a paywall over this code.

Contributions are accepted under the DCO — sign off your commits with git commit -s.

About

No description, website, or topics provided.

Resources

Readme

License

Apache-2.0 license

Uh oh!

There was an error while loading. Please reload this page.

Activity

Custom properties

Stars

1 star

Watchers

0 watching

Forks

0 forks

Report repository

Releases

No releases published

Packages 0

Uh oh!

There was an error while loading. Please reload this page.

Contributors

Uh oh!

There was an error while loading. Please reload this page.

Languages

TypeScript 91.4%

HTML 3.9%

JavaScript 3.3%

Other 1.4%