Skip to content

Instantly share code, notes, and snippets.

@ChakshuGautam
Created December 13, 2025 08:51
Show Gist options
  • Select an option

  • Save ChakshuGautam/5a647bf1efdaaf966001ffc7c0f34922 to your computer and use it in GitHub Desktop.

Select an option

Save ChakshuGautam/5a647bf1efdaaf966001ffc7c0f34922 to your computer and use it in GitHub Desktop.
Claude Code OAuth Configuration - Client ID & Endpoints (from cli.js v2.0.69)
/**
* Claude Code OAuth Configuration
* Extracted and deobfuscated from @anthropic-ai/claude-code v2.0.69
* Source: https://unpkg.com/@anthropic-ai/claude-code/cli.js
*/
// =============================================================================
// Original Source (cli.js lines 58770-58810, prettified)
// =============================================================================
/*
OR9;
var eJ = L(() => {
rQ();
((LR9 = [qR9, "user:profile"]),
(EK1 = ["user:profile", E9A, "user:sessions:claude_code"]),
(Ng0 = Array.from(new Set([...LR9, ...EK1]))),
(Ug0 = {
BASE_API_URL: "https://api.anthropic.com",
CONSOLE_AUTHORIZE_URL: "https://console.anthropic.com/oauth/authorize",
CLAUDE_AI_AUTHORIZE_URL: "https://claude.ai/oauth/authorize",
TOKEN_URL: "https://console.anthropic.com/v1/oauth/token",
API_KEY_URL:
"https://api.anthropic.com/api/oauth/claude_cli/create_api_key",
ROLES_URL: "https://api.anthropic.com/api/oauth/claude_cli/roles",
CONSOLE_SUCCESS_URL:
"https://console.anthropic.com/buy_credits?returnUrl=/oauth/code/success%3Fapp%3Dclaude-code",
CLAUDEAI_SUCCESS_URL:
"https://console.anthropic.com/oauth/code/success?app=claude-code",
MANUAL_REDIRECT_URL: "https://console.anthropic.com/oauth/code/callback",
CLIENT_ID: "9d1c250a-e61b-44d9-88ed-5944d1962f5e",
OAUTH_FILE_SUFFIX: "",
}),
(OR9 = {
BASE_API_URL: "http://localhost:3000",
CONSOLE_AUTHORIZE_URL: "http://localhost:3000/oauth/authorize",
CLAUDE_AI_AUTHORIZE_URL: "http://localhost:4000/oauth/authorize",
TOKEN_URL: "http://localhost:3000/v1/oauth/token",
API_KEY_URL: "http://localhost:3000/api/oauth/claude_cli/create_api_key",
ROLES_URL: "http://localhost:3000/api/oauth/claude_cli/roles",
CONSOLE_SUCCESS_URL:
"http://localhost:3000/buy_credits?returnUrl=/oauth/code/success%3Fapp%3Dclaude-code",
CLAUDEAI_SUCCESS_URL:
"http://localhost:3000/oauth/code/success?app=claude-code",
MANUAL_REDIRECT_URL:
"https://console.staging.ant.dev/oauth/code/callback",
CLIENT_ID: "22422756-60c9-4084-8eb7-27705fd5cf9a",
OAUTH_FILE_SUFFIX: "-local-oauth",
}));
});
import { accessSync as RR9 } from "fs";
import { join as DK1 } from "path";
*/
// =============================================================================
// Readable Version - Production OAuth Configuration
// =============================================================================
const PRODUCTION_CONFIG = {
BASE_API_URL: "https://api.anthropic.com",
// Authorization endpoints
CONSOLE_AUTHORIZE_URL: "https://console.anthropic.com/oauth/authorize",
CLAUDE_AI_AUTHORIZE_URL: "https://claude.ai/oauth/authorize",
// Token exchange
TOKEN_URL: "https://console.anthropic.com/v1/oauth/token",
// API key creation (for console auth flow)
API_KEY_URL: "https://api.anthropic.com/api/oauth/claude_cli/create_api_key",
// Roles endpoint
ROLES_URL: "https://api.anthropic.com/api/oauth/claude_cli/roles",
// Success redirect URLs
CONSOLE_SUCCESS_URL: "https://console.anthropic.com/buy_credits?returnUrl=/oauth/code/success%3Fapp%3Dclaude-code",
CLAUDEAI_SUCCESS_URL: "https://console.anthropic.com/oauth/code/success?app=claude-code",
// Manual redirect (for CLI copy-paste flow)
MANUAL_REDIRECT_URL: "https://console.anthropic.com/oauth/code/callback",
// The magic client ID
CLIENT_ID: "9d1c250a-e61b-44d9-88ed-5944d1962f5e",
OAUTH_FILE_SUFFIX: "",
};
// =============================================================================
// Readable Version - Local Development OAuth Configuration
// =============================================================================
const LOCAL_DEV_CONFIG = {
BASE_API_URL: "http://localhost:3000",
CONSOLE_AUTHORIZE_URL: "http://localhost:3000/oauth/authorize",
CLAUDE_AI_AUTHORIZE_URL: "http://localhost:4000/oauth/authorize",
TOKEN_URL: "http://localhost:3000/v1/oauth/token",
API_KEY_URL: "http://localhost:3000/api/oauth/claude_cli/create_api_key",
ROLES_URL: "http://localhost:3000/api/oauth/claude_cli/roles",
CONSOLE_SUCCESS_URL: "http://localhost:3000/buy_credits?returnUrl=/oauth/code/success%3Fapp%3Dclaude-code",
CLAUDEAI_SUCCESS_URL: "http://localhost:3000/oauth/code/success?app=claude-code",
// Staging redirect URL
MANUAL_REDIRECT_URL: "https://console.staging.ant.dev/oauth/code/callback",
// Different client ID for local development
CLIENT_ID: "22422756-60c9-4084-8eb7-27705fd5cf9a",
OAUTH_FILE_SUFFIX: "-local-oauth",
};
export { PRODUCTION_CONFIG, LOCAL_DEV_CONFIG };
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment