Skip to content

Welcome to Swytchcode v2

Swytchcode is an execution layer for API integrations — designed for both developers and AI agents.

Instead of letting your code directly call external APIs, Swytchcode acts as a controlled execution authority. It ensures integrations are deterministic, policy-compliant, and resilient to failures — eliminating the unreliability of traditional API calls and AI-generated integrations.

With Swytchcode, integrations are no longer scattered across your codebase. They are versioned, validated, and executed through a single, reliable interface.


Try it now — no install, no account, no setup

Terminal window
npx swytchcode exec stripe.create_payment

That’s it. Swytchcode downloads, runs a simulated payment, and shows you the response in seconds. No API keys, no project init, nothing to configure.

Don’t know the canonical ID? Search by intent:

Terminal window
npx swytchcode exec "charge a customer"
# Swytchcode finds matching integrations and lets you pick one

What’s new in Version 2

Version 2 expands Swytchcode into a complete integration workflow system — combining execution, AI context, and resilience.

One command, three modes

swytchcode exec now handles everything automatically:

SituationWhat happens
Fresh machine, no setupAuto-demo: simulated response instantly
First real runAuto-scaffold: init + fetch + register, then live execution
Credentials availableLive mode: 🔐 Running live — stripe (sandbox)
--demo flagAlways demo, no credentials needed

Intent-based execution

You no longer need to know canonical IDs:

Terminal window
swytchcode exec "send a welcome email"
# → Found 5 capabilities. Select (1-5):
# 1. resend.send_email — Send a transactional email via Resend
# 2. sendgrid.send_email — Send email via SendGrid
# ...

For agents and pipelines, the same command returns a structured options[] JSON response instead of an interactive picker.

Auto-credential injection

Set STRIPE_API_KEY in your environment or .env — it’s injected automatically. No --header flag needed.

Terminal window
export STRIPE_API_KEY=sk_live_xxx
swytchcode exec stripe.create_payment --body '{"amount":5000,"currency":"usd"}'
# Authorization: Bearer sk_live_xxx is injected automatically

Degrade, don’t crash

Every failure has a next step — the CLI never leaves you stuck:

# Network down during setup
⚡ Could not fetch stripe integration — running in demo mode
→ Retry: swytchcode get stripe
# Demo API temporarily unavailable (auto-retried 3×)
⚡ Demo service temporarily unavailable. Try again or set up your own integration.
# Internal error
→ Details saved to .swytchcode/logs/error.log

Structured errors for agents

All errors are JSON with category and retryable fields — agents know exactly what to do next:

{"error": "connection timeout", "category": "network", "retryable": true}

Model Context Protocol (MCP)

Structured API context that enables AI to discover, configure, and execute integrations — not just generate code suggestions. Cursor and Claude Code connect automatically after swytchcode init.

Deterministic execution

Same inputs → same behavior. tooling.json is the allow-list; only registered tools run. No hidden paths, no prompt-based branching.

Built-in testing and inspection

Terminal window
swytchcode exec stripe.create_payment --explain # see what would run, no HTTP call
swytchcode exec stripe.create_payment --dry-run # see the planned request
swytchcode exec stripe.create_payment --demo # simulated run, no credentials
swytchcode doctor # diagnose your local setup

Execution analytics and visibility

Track how integrations run, fail, and evolve across versions through the Swytchcode web application.