2-Line Migration

OpenAI → AI Badgr in 2 Lines (With Real Cost Numbers)

Same API. Same SDK. One base_url change.

Try this with one endpoint. Takes ~2 minutes.

Who this is for

If you're using OpenAI's API and your bill is too high.

Switch in 2 minutes. No code refactoring. Same results.

The 2-Line Migration

Python
openai.api_base = "https://aibadgr.com/v1"
openai.api_key = os.getenv("AIBADGR_API_KEY")
JavaScript/TypeScript
const openai = new OpenAI({
  apiKey: process.env.AIBADGR_API_KEY,
  baseURL: "https://aibadgr.com/v1"
});

Advanced: Migrate entire codebase

The script is hosted and ready to use:

Quick one-liner (no download needed):

curl -s https://aibadgr.com/tools/migrate-to-aibadgr.py | python - ./src

Or download first to preview changes:

# Download script
curl -O https://aibadgr.com/tools/migrate-to-aibadgr.py

# Preview changes (dry run)
python migrate-to-aibadgr.py ./src --dry-run

# Apply migration
python migrate-to-aibadgr.py ./src

The script automatically finds and replaces OpenAI/Claude URLs in Python, JavaScript, and TypeScript files.

That's it. Your existing OpenAI code works immediately.

If it doesn't work, change the base_url back. Nothing else is touched.

Same Request, Unchanged

Same Endpoint

/v1/chat/completions

Same Prompt

No changes needed

Same Tokens

Identical usage

Cost Comparison

Example: a single agent workflow run at ~1M tokens.

ProviderTokensCostSavings
OpenAI1,000,000$5.00
AI Badgr1,000,000$0.3094% off

Save $4.70 per million tokens with identical quality

What Did NOT Change

  • Same SDK — Use your existing OpenAI Python/JS libraries
  • Same payload — Identical request format, no refactoring
  • Same response shape — Drop-in compatibility, zero code changes

Ready to Try It?

Get your free API key in 30 seconds. No credit card required.

Try this with one endpoint. Takes ~2 minutes.

Free tier includes generous credits to get started