FRAMEWORK COMPATIBILITY & DROP-IN SETUP

Connect Vercel AI SDK in 1 line.
Get wholesale edge caching automatically.

Newton’s is 100% wire-compatible with the standard OpenAI and Anthropic API specifications. Swap your `baseURL` to get instant access to Claude Opus, Sonnet, and Haiku with up to 95% off cached input.

1. INSTALL DEPENDENCIES
npm install ai @ai-sdk/openai
2. DROP-IN CONFIGURATION
import { createOpenAI } from '@ai-sdk/openai';
import { generateText } from 'ai';

// Initialize client pointing to Newton's Edge Gateway
const newtons = createOpenAI({
  baseURL: 'https://newtons.dev/api/v1',
  apiKey: process.env.NEWTONS_API_KEY,
});

export async function POST(req: Request) {
  const { prompt } = await req.json();

  const { text, usage } = await generateText({
    model: newtons('claude-sonnet-5-5'), // or 'claude-opus-5-5', 'claude-haiku-4-5-20251001'
    prompt,
    // Prompt caching and edge routing happen automatically
  });

  return Response.json({ text, usage });
}

Built for High-Velocity AI Engineering

NO REFACTOR REQUIRED

Standard Wire Protocol

No custom SDK wrappers or vendor lock-in. Keep using official OpenAI and Anthropic client libraries by just modifying your `baseURL`.

CACHE PASS-THROUGH

85% Prompt Discounts

Prompt caching discounts from Anthropic, OpenAI, and DeepSeek are passed through directly at wholesale rates without gatekeeper markups.

UNIFIED BILLING

One API Key for Everything

Eliminate managing multiple enterprise invoices and prepaid balances across separate AI model providers.

Test your app with $1 free starter credit

Generate your Newton’s API key in 10 seconds. No credit card required.

Create Free API Key →