Skip to main content
varg uses a single API key (VARG_API_KEY) for all AI generation. This key authenticates you with the varg API, which routes requests to the right AI provider (Fal, ElevenLabs, Higgsfield, PiAPI, HeyGen, …) and handles billing.

Get your API key

Option 1: Sign up on the web

  1. Go to app.varg.ai
  2. Sign up with your email
  3. Copy your API key from the dashboard

Option 2: Log in from the CLI

This gives you two choices:
  • Email login — enter your email, receive a 6-digit code, verify it. Creates an account and API key automatically.
  • Paste API key — if you already have one from the dashboard.
Your credentials are saved to ~/.varg/credentials (permissions 0600).

Option 3: Agent-driven login (for AI agents)

AI agents can drive the login flow using curl — no interactive CLI needed:

Using your API key

Bun auto-loads .env — no dotenv needed.

As an environment variable

In global credentials

The CLI saves credentials to ~/.varg/credentials:
The SDK automatically checks this file if VARG_API_KEY is not set in the environment.

In code

Or with the REST API:

Credits and billing

Check your balance

Or via API:
1 credit = 1 cent. total_balance: 10000 means 10,000 credits ($100). available is what you can spend right now (total minus credits reserved by in-flight jobs).

Add credits

This opens the billing page in your browser. Or go directly to app.varg.ai. Available packages:

Pricing

Live catalog with all ~80 models: GET https://api.varg.ai/v2/pricing (public, no auth). Estimate any request before running it with POST /v2/estimate. Cache hits are always free. Same prompt + params = $0 instant result.

Managing API keys

Create, rename, and revoke API keys from the dashboard, or via the API with an app session:
Key management endpoints require an app session (JWT from the dashboard login), not an API key — a leaked API key can’t be used to mint new keys.

CLI commands

Bring Your Own Keys (BYOK)

BYOK via the varg API is not available in v2 yet. For local rendering you can use direct provider modules with your own env keys — see the BYOK guide for the current state.