// v2.4.1 — Developer Preview

The missing piece between
API and production.

Production-ready integrations.
Typed, authenticated, deployable.

Dr. Pieces generates production-ready code directly from your API specifications.

01
TypeScript output, fully typed Auto-generated interfaces, generics, and return types. Zero any — always.
02
Authentication handled Bearer tokens, API keys, OAuth — pulled from your spec and wired correctly.
03
Structured HTTP requests Headers, query params, body serialization — built precisely to spec.
04
Built-in error handling Status code checks, typed error surfaces, and structured failure paths.
05
Clean, readable architecture Code you can maintain, audit, and extend. Not code you need to rewrite tomorrow.

From spec to deploy
in four steps.

// No boilerplate. No guesswork. Just working code.

Step 01

Select API
& Endpoint

Point Dr. Pieces at any REST or GraphQL spec — OpenAPI, Swagger, or a raw URL.

01
Step 02

Configure Auth
& Inputs

Define your authentication strategy, map inputs, and set response handling preferences.

02
Step 03

Generate
Implementation

Dr. Pieces outputs typed, authenticated, production-ready TypeScript in under a second.

03
Step 04

Review
& Ship

Inspect clean, readable output. Drop it in. Deploy with confidence.

04

This is what
Dr. Pieces generates.

// Stripe · payment_intents.create
Typed. Authenticated. Error-handled.
Ready to ship.

createPaymentIntent.ts — Dr. Pieces v2.4.1
// dr-pieces generate --api stripe --endpoint payment_intents.create
// Generated: 2026-03-30 · TypeScript 5.4 · v2.4.1

import type { Stripe } from './stripe.types';

interface CreatePaymentIntentParams {
  amount:   number;
  currency: 'usd' | 'eur' | 'gbp';
  customer?:  string;
  metadata?:  Record<string, string>;
}

export async function createPaymentIntent(
  params: CreatePaymentIntentParams
): Promise<Stripe.PaymentIntent> {
  const { STRIPE_SECRET_KEY } = process.env;

  if (!STRIPE_SECRET_KEY) {
    throw new Error('STRIPE_SECRET_KEY is not configured');
  }

  const body = new URLSearchParams({
    amount:   params.amount.toString(),
    currency: params.currency,
    ...(params.customer && { customer: params.customer }),
    ...(params.metadata && Object.fromEntries(
      Object.entries(params.metadata).map(([k, v]) => [`metadata[${k}]`, v])
    )),
  });

  const response = await fetch('https://api.stripe.com/v1/payment_intents', {
    method:  'POST',
    headers: {
      'Authorization': `Bearer ${STRIPE_SECRET_KEY}`,
      'Content-Type':  'application/x-www-form-urlencoded',
    },
    body,
  });

  if (!response.ok) {
    const error: Stripe.ApiError = await response.json();
    throw new Error(`Stripe [${error.error.code}]: ${error.error.message}`);
  }

  return response.json() as Promise<Stripe.PaymentIntent>;
}

Built for every
integration scenario.

→ 01

SaaS Integrations

Connect Stripe, Twilio, SendGrid, or any third-party API with production-quality code from day one.

→ 02

Internal Tooling

Wire internal APIs to dashboards and services. Typed, error-resilient, and easy to maintain.

→ 03

API Onboarding

Reduce time-to-first-call from hours to seconds. New integrations, same high standards.

→ 04

Rapid Prototyping

Spin up integrations for demos, MVPs, or proof-of-concepts — without cutting corners.

// Ready when you are

Start
generating.

From API spec to working code.
No boilerplate. No guesswork.