Skip to main content
Migration Agent

One command.
All your APIs migrated.

Install the agent. It scans your codebase, audits your API infrastructure, generates adapters, and verifies every call — all automatically.

Your code is never modified. Shadow mode verifies 100% before any traffic moves. One-command rollback.

npx @apitree/migrate-agent analyze .

Read-only scan. No code changes. No credit card. Works with any language.

How it works

01

Audit

Free infrastructure diagnosis

Install the agent. It scans your codebase and produces a complete API infrastructure report: which APIs you use, where keys are hardcoded, which calls lack error handling, and what's at risk.

Output: Score: 42/100 Grade: F — 3 security issues, 8 reliability risks
Time: 2 minutes
Zero (read-only scan)
02

Plan

Migration strategy per API

The agent maps every detected API to its apitree equivalent, assigns a confidence score, and generates a migration plan. APIs not yet on apitree are auto-reported for priority addition.

Output: 5 providers detected, 4 migratable (100% confidence), 1 pending
Time: 30 seconds
Zero (read-only analysis)
03

Shadow

Verify before switching

Generated adapters call both your original API and apitree simultaneously. Your app uses the original response — business impact is zero. In the background, responses are compared for structural equivalence.

Output: 247 requests verified, 100% match rate, +23ms avg latency
Time: Runs during normal operation
Zero (original API is always used)
04

Promote

Gradual traffic shift

Once shadow mode hits 100% match rate across 100+ requests, promote to canary: 10% of traffic goes through apitree, 90% through the original. Gradually increase to 100%. Auto-fallback on any error.

Output: Canary 10% → 25% → 50% → 100%. Zero errors. Migration complete.
Time: Days to weeks (your pace)
Auto-fallback to original on any error

Safety guarantees

We built this for companies where API downtime means lost revenue. Every safety mechanism exists because it has to.

Existing code is never modified

The agent creates new adapter files only. Your source code stays untouched. Remove the adapters and you're back to the original state instantly.

One-command rollback

apitree-migrate rollback removes all generated files. Works without git. No version control needed. The agent tracks everything it creates.

Shadow mode verifies first

Every API call is tested against both the original provider and apitree. Only when 100% of responses match structurally does the agent recommend promotion.

Any language, any framework

TypeScript, Python, Java, Go, Ruby, PHP, C#, Rust. The agent detects SDK imports, URL patterns, and environment variables across all languages.

Your code never leaves your server

The agent runs locally. Only provider names and occurrence counts are sent to apitree (for gap reporting). Source code, keys, and business logic stay on your infrastructure.

Auto-fallback on every error

In canary and full mode, if apitree returns an error, the adapter automatically falls back to the original API. Your users never see a failure.

See it in action

Real output from scanning a sample project with 6 API providers.

npx @apitree/migrate-agent analyze .
  Found 12 source files | Language: typescript

  ━━ SCAN REPORT ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

  openai                3 refs  Tier 1   -> apitree: openai-gpt4o
    SDK: openai  |  Files: 3  |  Env: OPENAI_API_KEY

  stripe                2 refs  Tier 1   -> apitree: stripe-payments
    SDK: stripe  |  Files: 2  |  Env: STRIPE_SECRET_KEY

  resend                2 refs  Tier 2   -> apitree: resend-email
    SDK: direct URL  |  Files: 1  |  Env: RESEND_API_KEY

  coingecko             1 refs  Tier 3   -> apitree: coingecko-public
  open-meteo            1 refs  Tier 3   -> apitree: open-meteo-forecast
  github                1 refs  Tier 2   -> apitree: github-api

  ━━ AUDIT ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

  Score: 58/100  Grade: D

  [!!] Hardcoded Stripe key in src/payments.ts:8
  [ !] API call without error handling (3 locations)
  [ !] API call without timeout (2 locations)
  [  ] Same URL hardcoded in 4 files

  ━━ PLAN ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

  [ADAPTER] openai      conf: 100%  -> shadow adapter
  [ADAPTER] stripe      conf: 100%  -> shadow adapter
  [URL SWAP] resend     conf:  90%  -> URL replacement
  [URL SWAP] coingecko  conf:  90%  -> URL replacement
  [URL SWAP] open-meteo conf:  90%  -> URL replacement
  [URL SWAP] github     conf:  90%  -> URL replacement

  Estimated effort: < 5 minutes
  Risk: Zero (shadow mode default)
  Rollback: apitree-migrate rollback

What the audit detects

Security

  • -Hardcoded API keys in source code
  • -Secrets committed to version control
  • -API credentials not using environment variables
  • -Missing key rotation patterns

Reliability

  • -API calls without error handling
  • -Missing timeout configuration
  • -No retry logic for transient failures
  • -No circuit breaker pattern

Architecture

  • -Same URL hardcoded in multiple files
  • -No API abstraction layer
  • -Mixed authentication patterns
  • -No centralized configuration

Cost

  • -Redundant API calls (no caching)
  • -Duplicate requests across services
  • -Over-fetching (requesting unused data)
  • -No usage monitoring or alerting

See your score

Run the free audit. No signup required for the scan. If your score is below 80, we can help.

npx @apitree/migrate-agent analyze .