/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
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.
Start Auth Flow
Run /auth in Apex and press Enter to begin. Apex requests a device code from the Pensar authentication service.
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.
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.
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
Purchase credits, configure auto-reload, add payment methods, and view invoices from Settings > Billing.
Track Apex inference spend per user and per API key from Settings > Usage.
Create workspaces, invite team members, and control access roles.
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
Setting Up Billing
If Apex reports that billing isn’t configured or your balance is low during /auth:
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.
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:
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
Browser doesn't open automatically
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.
'Billing not ready' after connecting
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.
'Insufficient credits' errors during pentesting
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.
Want to switch workspaces
Press [D] to disconnect, then run /auth again. You’ll be prompted to select a workspace during the new auth flow.
Auth flow times out
Device codes expire after a few minutes. Run /auth again to restart the flow with a fresh code.