Skip to content

Zchary1106/copilot-api-meter

Repository files navigation

📊 Copilot API Meter

Open-source usage dashboard for copilot-api-proxy. Track requests, tokens, costs, and latency across Claude, GPT, and Gemini — all models routed through your GitHub Copilot API proxy.

Landing Page

Dashboard

Features

  • 📈 Usage Overview — Requests (24h), total tokens, estimated cost, active models
  • 📊 Trends — Request volume over time with 7d / 30d / 90d views
  • 🤖 Model Breakdown — Per-model stats: requests, tokens, latency, cost
  • 💰 Cost Estimation — Daily cost tracking with built-in pricing for 15+ models
  • Latency Analysis — P50/P95/P99 distribution, per-model performance
  • 🔑 API Key Tracking — Usage breakdown per API key
  • 🌙 Dark/Light Mode — Beautiful UI with theme toggle
  • 🔒 Privacy First — Pure frontend, proxy credentials stored in your browser only

How it works

Your App → copilot-api-proxy → GitHub Copilot API
                 ↓
           audit.jsonl (logs every request with token counts)
                 ↓
           /api/usage/* endpoints
                 ↓
           Copilot API Meter (reads & visualizes usage data)

No backend database required. Logs auto-cleanup after 30 days.

Quick Start

Deploy to Vercel (Recommended)

Deploy with Vercel

  1. Click the button above or import this repo in Vercel

  2. Set environment variables:

    Variable Value
    NEXTAUTH_URL https://your-app.vercel.app
    NEXTAUTH_SECRET Run openssl rand -base64 32
    GITHUB_ID Create OAuth App
    GITHUB_SECRET From your OAuth App
  3. GitHub OAuth App settings:

    • Homepage URL: https://your-app.vercel.app
    • Callback URL: https://your-app.vercel.app/api/auth/callback/github
  4. Deploy → Sign in → Go to Settings → Connect your proxy

Run Locally

git clone https://github.com/Zchary1106/copilot-api-meter.git
cd ai-meter
npm install

# Create .env.local
cat > .env.local << EOF
NEXTAUTH_URL=http://localhost:3000
NEXTAUTH_SECRET=$(openssl rand -base64 32)
GITHUB_ID=your_github_oauth_client_id
GITHUB_SECRET=your_github_oauth_client_secret
EOF

npm run dev

Open http://localhost:3000

Connect Your Proxy

  1. Deploy copilot-api-proxy (audit logging is enabled by default)
  2. Sign in to Copilot API Meter
  3. Go to Settings → Enter your proxy URL and API key
  4. Dashboard will show real usage data immediately

Supported Models

All models available through GitHub Copilot:

Provider Models
Anthropic Claude Opus 4.6/4.5, Sonnet 4.6/4.5/4, Haiku 4.5
OpenAI GPT-5.4/5.2/5.1/5-mini, GPT-4o, GPT-4.1
Google Gemini 3.1 Pro, Gemini 3 Flash, Gemini 2.5 Pro

Tech Stack

Related

  • copilot-api-proxy — The API proxy that generates the usage data this dashboard visualizes

Keywords

github-copilot copilot-api usage-dashboard api-proxy token-tracking cost-analysis claude gpt gemini llm-monitoring ai-usage openai anthropic google-gemini nextjs vercel open-source

License

MIT

About

Open-source usage dashboard for copilot-api-proxy. Track requests, tokens, costs, and latency across Claude, GPT, Gemini.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors