Lenny shares his full prompt for routing an AI Bot through his own Anthropic API key

lennysan · x · 2026-11-17

Lenny (of Lenny's Newsletter) shares a reusable prompt template for having an AI Bot use Claude through his own Anthropic API account (e.g. drafting podcast guest briefs). The flow: collect the API key via a secure secret field (never in chat), store it locally and never print it, write a helper script calling the Anthropic Messages API with x-api-key / anthropic-version / optional workspace headers, list available models via GET /v1/models so he can pick one, send a test message and surface exact errors (e.g. low balance) for billing fixes, then persist everything into skills and routines.

Original post →

More from coding & agent

coding & agent channel →