Docs
Up and running in five minutes.
Start locally with your own credentials, then deploy to AWS when you're ready.
Quick start (local)
Nothing is deployed to AWS. You need Node 22.13+ and AWS credentials with access to the Anthropic models on Bedrock.
git clone https://github.com/uurtech/tokener.git && cd tokener/gateway
npm ci && npm run build
cp .env.example .env # AWS_BEARER_TOKEN_BEDROCK (or IAM keys), AWS_REGION, ADMIN_TOKEN
npm run local
The output prints a one-click login link to the admin console. If ADMIN_TOKEN is empty, a random one is generated and printed. Or run it with Docker:
cd gateway && ADMIN_TOKEN=secret AWS_PROFILE=myprofile docker compose up --build
Developer setup
Create a developer in the console. Each developer adds this block to ~/.claude/settings.json:
{
"env": {
"ANTHROPIC_BASE_URL": "https://claude-gw.archeon.dev",
"ANTHROPIC_AUTH_TOKEN": "cgw_...",
"CLAUDE_CODE_GATEWAY_HINT_HEADERS": "1",
"CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS": "1",
"CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY": "1",
"ANTHROPIC_DEFAULT_HAIKU_MODEL": "claude-haiku-4-5"
}
}
CLAUDE_CODE_GATEWAY_HINT_HEADERS matters most: without it, every request counts as the main conversation and routing has nothing to work with.
Deploy to AWS
Requires AWS CLI v2, Node.js 22+, Docker and AWS CDK v2. A domain and ACM certificate are optional; without them the ALB serves HTTP, which is fine for a POC only.
cd gateway && npm ci && npm test
cd ../infra && npm ci
npx cdk bootstrap # first time per account/region
npx cdk deploy # ~8 min
./scripts/create-dev-key.sh <KeysTableName> alice 25 backend 5000000
# name USD/day team tokens/day
Configuration
The env block in infra/gateway.config.json sets the initial behavior. Policy saved from the console overrides it.
| Variable | Default | Description |
|---|---|---|
BRIDGE_BEDROCK | true | Strips fields Bedrock rejects. Keep it on. |
ROUTE_SUBAGENT_MODEL | empty | Model for subagent requests. |
ROUTE_AUXILIARY_MODEL | empty | Model for titles and summaries. |
EFFORT_MODE | off | fill or override. |
TOOL_RESULT_MAX_CHARS | 0 | 20000 is recommended. |
BUDGET_ACTION | warn | warn, downgrade or block. |
UPSTREAM_MODE | mantle | mantle or runtime. Switchable live. |
The full list is in the README.
Testing
cd gateway
npm test # unit tests (vitest)
npm run smoke # end-to-end against a fake Bedrock upstream
Limitations
Bridging needs ongoing maintenance as Claude Code adds beta fields. Prices are estimates; Cost Explorer is the source of truth. Budgets reset daily at UTC midnight. Structured outputs and server-side tools are not available on Bedrock.