/auth

Overview

The /auth command connects your Apex CLI to Pensar Console for managed inference. Once connected, Apex uses Pensar-hosted AI models — no API key configuration required. Inference costs are tracked and deducted from your workspace’s credit balance.

Usage

$/auth

How It Works

The /auth command uses a device authorization flow — similar to how you link a streaming device to your account. Apex displays a code, you verify it in your browser, and the CLI is automatically authenticated.

1

Start Auth Flow

Run /auth in Apex and press Enter to begin. Apex requests a device code from the Pensar authentication service.

2

Verify in Browser

A browser window opens automatically to the verification URL. If it doesn’t open, copy the URL displayed in the terminal and open it manually. Enter the user code shown in Apex to confirm the connection.

3

Select Workspace

If your account belongs to multiple workspaces, Apex presents a list showing each workspace name and current credit balance. Use the arrow keys to select a workspace and press Enter.

4

Billing Check

Apex verifies that the selected workspace has billing configured and sufficient credits. If billing isn’t set up or the balance is low, you’ll see a prompt with a link to the Console billing page.

5

Connected

On success, Apex displays your connected workspace and credit balance. You can now use Pensar-hosted models for pentesting without configuring any API keys.

Pensar Console

Pensar Console is the web platform where you manage workspaces, projects, billing, and more. When you authenticate Apex with /auth, you’re linking it to a Console workspace.

If you don’t have an account yet, the verification URL will guide you through sign-up and workspace creation.

What You Can Do in Console

Manage Billing

Purchase credits, configure auto-reload, add payment methods, and view invoices from Settings > Billing.

Monitor Usage

Track Apex inference spend per user and per API key from Settings > Usage.

Manage Workspaces

Create workspaces, invite team members, and control access roles.

Run Pentests

Launch whitebox and blackbox pentests from the Console UI with full reporting.

For full billing documentation, see the Console Billing & Usage guide.

Billing

Apex inference through the Pensar gateway uses a pre-paid credits model. Credits are purchased in your Console workspace and deducted per inference request.

Key Billing Concepts

ConceptDescription
CreditsPre-paid balance (in USD) shared across your workspace
CategoryApex inference is billed under the “Apex Inference” category, separate from CI pentest usage
Per-identity trackingEach request is attributed to the authenticated user, visible in Console’s Usage page
Pre-flight checksRequests are rejected with a 402 error if credits are insufficient
Auto-reloadOptional automatic top-up when balance drops below a threshold

Setting Up Billing

If Apex reports that billing isn’t configured or your balance is low during /auth:

1

Open Billing Page

Press the key shown in Apex to open the billing page in your browser, or navigate to Settings > Billing in Console manually.

2

Add Payment Method

Add a credit or debit card via the inline form on the Billing page.

3

Purchase Credits

Buy credits via a one-time purchase (10/10 / 30 / 50/50 / 100 or custom) or set up a monthly subscription.

4

Enable Apex Inference

On the Settings > Usage page, ensure the “Apex Inference” toggle is enabled. This is turned on automatically when you add your first payment method.

For detailed billing documentation including auto-reload, invoices, and usage tracking, see Console Billing & Usage.

Disconnecting

When connected, press [D] on the /auth screen to disconnect. This clears the stored authentication tokens from your local Apex configuration. You can reconnect at any time by running /auth again.

Configuration

Authentication state is stored in your local Apex configuration at ~/.pensar/. The following values are managed by the /auth flow:

Config KeyDescription
accessTokenShort-lived access token for API requests
refreshTokenLong-lived token used to refresh the access token
workspaceIdSelected workspace ID
workspaceSlugSelected workspace slug

Tokens are automatically refreshed when they expire. You do not need to re-run /auth unless you want to switch workspaces or have explicitly disconnected.

Troubleshooting

Copy the verification URL displayed in the terminal and open it in your browser manually. The URL and user code remain valid for several minutes.

Navigate to Settings > Billing in Console and add a payment method. Then purchase credits and ensure the Apex Inference category is enabled on the Usage page. See Console Billing & Usage for step-by-step instructions.

Your workspace balance is too low. Purchase additional credits from Settings > Billing in Console, or enable auto-reload to prevent future interruptions. See Console Billing & Usage.

Press [D] to disconnect, then run /auth again. You’ll be prompted to select a workspace during the new auth flow.

Device codes expire after a few minutes. Run /auth again to restart the flow with a fresh code.