Documentation

Setup guide

Everything you need to point a client at LightningDeals: install, configure your IDE, and call the API. If you already have a key, the whole thing takes about a minute.

Drop-in compatible

No SDK changes

Permanent Prepaid Balance

No Expiry Reset

Built-in tools

Search and image analysis

13 models

One base URL

Prerequisites

Node.js 18 or newer Download from nodejs.org

A LightningDeals API key — Issued by your admin or reseller

A supported client — Claude Code, VS Code, Cursor, Windsurf, Cline, or Roo Code

Quick install

The fastest path. The wizard asks for your key, configures the clients you pick, and verifies the connection before it exits.

terminal
npx lightningdeals

What it does

  1. 01Asks for your API key
  2. 02Lets you choose which clients to configure
  3. 03Writes the correct settings for each one
  4. 04Verifies the connection

Web search and image analysis need no setup at all — they run server-side.

Windows — PowerShell

If you would rather run the setup script directly:

powershell (administrator)
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
irm https://lightningapi.pro/setup.ps1 | iex

macOS and Linux

The shell equivalent:

terminal
curl -fsSL https://lightningapi.pro/setup.sh | bash

Claude Code CLI

Point the Claude Code CLI at LightningDeals and every model in the lineup becomes selectable from the same session.

Automatic — recommended

Run npx lightningdeals and select Claude Code CLI.

Manual configuration

Create or edit ~/.claude/settings.json:

~/.claude/settings.json
{
  "env": {
    "ANTHROPIC_AUTH_TOKEN": "YOUR_API_KEY",
    "ANTHROPIC_BASE_URL": "https://lightningapi.pro",
    "ANTHROPIC_MODEL": "claude-fable-5[1m]",
    "ANTHROPIC_SMALL_FAST_MODEL": "claude-haiku-4-5-20251001",
    "ANTHROPIC_DEFAULT_SONNET_MODEL": "claude-sonnet-5",
    "ANTHROPIC_DEFAULT_OPUS_MODEL": "claude-opus-4-8[1m]",
    "ANTHROPIC_DEFAULT_HAIKU_MODEL": "claude-haiku-4-5-20251001",
    "CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": "1"
  },
  "hasCompletedOnboarding": true
}

Replace YOUR_API_KEY with your actual key. The [1m] suffix asks for the 1M-token context tier — drop it to use the model's standard window.

VS Code

The VS Code Claude extension reads the same configuration as the CLI.

Automatic — recommended

Run npx lightningdeals and select VS Code.

Manual configuration

Same file as Claude Code CLI above. Restart VS Code once you have saved it.

Cursor

Route Cursor's AI features through LightningDeals.

Automatic — recommended

Run npx lightningdeals and select Cursor.

API routing

Open Settings → Models → add a Claude-compatible model with:

  • Base URL: https://lightningapi.pro/v1
  • API key: your LightningDeals key
  • Model: claude-sonnet-5

Windsurf

Route Windsurf's AI provider through LightningDeals.

Automatic — recommended

Run npx lightningdeals and select Windsurf.

API routing

Open Settings → AI Provider → set the base URL to:

Base URL
https://lightningapi.pro/v1

Cline

Configure the Cline VS Code extension to use LightningDeals.

Automatic — recommended

Run npx lightningdeals and select Cline.

Manual configuration

Add to your VS Code settings.json:

settings.json
{
  "cline.apiProvider": "anthropic",
  "cline.anthropicBaseUrl": "https://lightningapi.pro",
  "cline.apiKey": "YOUR_API_KEY"
}

Roo Code

Configure the Roo Code VS Code extension to use LightningDeals.

Automatic — recommended

Run npx lightningdeals and select Roo Code.

Manual configuration

Add to your VS Code settings.json:

settings.json
{
  "roo-cline.apiProvider": "anthropic",
  "roo-cline.anthropicBaseUrl": "https://lightningapi.pro",
  "roo-cline.apiKey": "YOUR_API_KEY"
}

API Reference — Authentication

All requests to the LightningDeals Gateway require a valid assigned API key passed in the x-api-key or Authorization: Bearer HTTP headers.

API Reference — Messages

POST/v1/messagesAPI key

Primary Anthropic-compatible message completion endpoint.

API Reference — Models

GET/v1/modelsAPI key

Returns active LLM model catalog supported by LightningDeals.

API Reference — 5-Hour Rolling Token Window & First-Request Activation

Every LightningDeals API key operates on an automated 5-hour rolling token allowance system. Your full token quota (e.g. 20M tokens for Claude Max 20x) automatically refreshes every 5 hours for the validity duration of your plan.

⚡ First-Request Activation Rule:

Your 5-hour usage window begins when your API key makes its first successful API request. Before that, the window remains inactive (Window Inactive — Starts on 1st API request). Creating a key in the admin panel does not start the timer.

API Reference — Token counting

POST/v1/messages/count_tokens

Calculates input token count before sending full completions.

API Reference — Key status

GET/api/key-status

Returns token balance, expiration date, and status for any assigned API key.

Image analysis

POST/tools/understand_imageAPI key

Analyse an image. Accepts an HTTP URL, a local path, or a base64 data URL. 18MB maximum.

Built-in tools

Both tools run server-side. There is nothing to install on your machine and no MCP server to configure.

Web search

Live web results for up-to-date information. Available automatically in every connected client.

Image analysis

Understands JPEG, PNG and WebP. Works out of the box with no extra configuration.

Available models

Every model below answers on the same key and the same base URL. Pass the ID exactly as written.

Claude Fable 5Newclaude-fable-51M
Claude Opus 5Newclaude-opus-51M
Claude Sonnet 5Newclaude-sonnet-51M
Claude Opus 4.8claude-opus-4-81M
Claude Opus 4.7claude-opus-4-71M
Claude Opus 4.6claude-opus-4-61M
Claude Sonnet 4.6claude-sonnet-4-61M
Claude Opus 4.5claude-opus-4-5200K
Claude Sonnet 4.5claude-sonnet-4-5-20250929200K
Claude Haiku 4.5claude-haiku-4-5-20251001200K
Claude Opus 4.1claude-opus-4-1-20250805200K
Claude Opus 4claude-opus-4-20250514200K
Claude Sonnet 4claude-sonnet-4-20250514200K

Context tier. Append [1m] to a model ID — e.g. claude-opus-4-8[1m] — to request the 1M-token window.

Troubleshooting

Connection errors

Check the key is active and has remaining balance — the Check a key page tells you in one look.

Web search or image tools not responding

They are server-side, so there is nothing local to fix. Confirm the key is valid and retry.

Model not found

Use an exact ID from the models list above. Display names are not accepted, only IDs and family aliases.

Rate limited

Your allocated RPM rate limit has been reached. Slow down requests or upgrade your tier.