An open API service indexing awesome lists of open source software.

https://github.com/flexiondotorg/tokentank

A delightful Go terminal application that displays remaining credit balances for AI providers in a gorgeous, human-friendly interface.
https://github.com/flexiondotorg/tokentank

Last synced: 10 months ago
JSON representation

A delightful Go terminal application that displays remaining credit balances for AI providers in a gorgeous, human-friendly interface.

Awesome Lists containing this project

README

          

# TokenTank đŸŽ¯

A delightful Go terminal application that displays remaining credit balances for AI providers in a gorgeous, human-friendly interface.

## Features

- **Single command**: `tokentank` checks all configured providers
- **Beautiful terminal UI** with colors, spinners, and smooth animations
- **Graceful error handling** with helpful, non-punishing messages
- **Multi-provider support**:
- ✅ **OpenRouter**: Full balance checking via API
- âš ī¸ **OpenAI**: API key validation (no balance API available)
- âš ī¸ **Anthropic**: API key validation (no balance API available)

## Installation

```bash
# Download and build from source
git clone https://github.com/flexiondotorg/tokentank
cd tokentank
go mod tidy
just build

# Or use go install
go install github.com/flexiondotorg/tokentank/cmd/tokentank@latest
```

## Usage

Set your API keys (only configure the providers you use):

```bash
export TT_OPENAI_API_KEY="your-openai-key"
export TT_ANTHROPIC_API_KEY="your-anthropic-key"
export TT_OPENROUTER_API_KEY="your-openrouter-key"
```

Then run:

```bash
tokentank
```

## Example Output

```
Checking balances for: OpenRouter, OpenAI, Anthropic

OpenRouter $42.50
OpenAI â„šī¸ ✓ API key valid - OpenAI doesn't provide balance checking via API. Check usage at platform.openai.com
Anthropic â„šī¸ ✓ API key valid - Anthropic doesn't provide balance checking via API. Check usage at console.anthropic.com
```

## Development

TokenTank is built using [Tessl](https://tessl.io) AI Native Development:

- **Specification-driven**: Natural language specs drive code generation
- **AI-generated code**: All implementation generated from `tokentank.spec.md`
- **Real-world tested**: APIs verified against working implementations

### Build Commands

```bash
# Build
just build

# Run directly
just run

# Test
just test

# Cross-compile for multiple platforms
just cross
```

## License

MIT License - see [LICENSE](LICENSE) file for details.

## Acknowledgments

- Inspired by [token-tongs](https://github.com/utensils/token-tongs) for OpenRouter API implementation
- Built with [Charm](https://charm.sh/) libraries for beautiful terminal UI
- Generated using [Tessl](https://tessl.io) AI Native Development platform