get your claude code tokens here
1# Anthropic API key fetcher
2
3simple cli to fetch an anthropic access token using oauth (pkce), built with bun
4
5## usage
6
7```bash
8bunx anthropic-api-key
9npx anthropic-api-key
10
11# override port
12PORT=9999 bunx anthropic-api-key
13
14# help
15bunx anthropic-api-key --help
16```
17
18## what it does
19
20- starts a local server and auto-opens your browser
21- guides you through anthropic oauth (pkce)
22- prints an access token to stdout and exits
23- caches tokens at `~/.config/crush/anthropic` and reuses them on later runs
24- if a cached token is still valid, it prints immediately and exits
25- if expired and a refresh token exists, it refreshes, saves, prints, and exits
26
27<p align="center">
28 <img src="https://raw.githubusercontent.com/taciturnaxolotl/carriage/master/.github/images/line-break.svg" />
29</p>
30
31<p align="center">
32 <i><code>© 2025-present <a href="https://github.com/taciturnaxolotl">Kieran Klukas</a></code></i>
33</p>
34
35<p align="center">
36 <a href="https://github.com/taciturnaxolotl/anthropic-api-key/blob/main/LICENSE.md"><img src="https://img.shields.io/static/v1.svg?style=for-the-badge&label=License&message=MIT&logoColor=d9e0ee&colorA=363a4f&colorB=b7bdf8"/></a>
37</p>