whatisgithub

What is surplus-ai-sdk-provider?

dylsteck/surplus-ai-sdk-provider — explained in plain English

Analysis updated 2026-05-18

0TypeScriptAudience · developerComplexity · 2/5LicenseSetup · easy

In one sentence

A connector library that lets Vercel AI SDK apps route AI model requests through the Surplus Intelligence pricing marketplace.

Mindmap

mindmap
  root((surplus-ai-sdk-provider))
    What it does
      Connects Vercel AI SDK
      Routes to cheaper providers
      Supports many model types
    Tech stack
      TypeScript
      Vercel AI SDK
      x402 payments
    Use cases
      Cheaper text generation
      Anthropic style routing
      Pay per request with crypto
    Audience
      App developers
    Requirements
      API key or wallet
      Node.js and npm

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Swap an existing Vercel AI SDK app to route model calls through the cheaper Surplus Intelligence marketplace.

USE CASE 2

Request only providers offering a minimum price discount for a given model call.

USE CASE 3

Pay per API request with a crypto wallet using x402 instead of holding an API key.

USE CASE 4

Point an existing Anthropic SDK client at Surplus's Anthropic-compatible endpoint.

What is it built with?

TypeScriptNode.jsVercel AI SDKviem

How does it compare?

dylsteck/surplus-ai-sdk-provider0xradioac7iv/tempfs52191314/web-agent-proxy-sdk
Stars000
LanguageTypeScriptTypeScriptTypeScript
Setup difficultyeasymoderatemoderate
Complexity2/53/54/5
Audiencedeveloperdeveloperdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · easy Time to first run · 5min

Needs a Surplus API key, or a crypto wallet and EVM private key for the no-API-key x402 payment path.

Use freely for any purpose, including commercial use, as long as you keep the copyright notice.

So what is it?

This project is a small connector library that lets developers use the Vercel AI SDK, a popular toolkit for building AI powered apps, to talk to a service called Surplus Intelligence. Surplus Intelligence is a marketplace for AI model inference, meaning it routes your request to whichever provider can run a given AI model at a lower price, and this package is the piece of code that plugs that marketplace into the Vercel AI SDK's standard interface. You install it with npm alongside the Vercel AI SDK, then import a function called surplus and pass it a model name, such as a Llama or Claude model, when generating text. With just an API key set as an environment variable, a developer can start generating text, chat completions, embeddings, or images through Surplus using the same generateText style calls the Vercel AI SDK already supports elsewhere. One notable feature is minimum discount routing, where a developer can request that Surplus only route their call to providers offering at least a certain percentage discount, which changes the web address the request is sent to behind the scenes. There is also a set of routing controls that let a developer specify things like a preferred provider or a maximum price per million tokens. The package also supports a payment method called x402, which lets someone use the service without an API key at all by paying for each request directly through a cryptocurrency wallet, using Ethereum-compatible payment code from a library called viem. Separately, there is an Anthropic flavored version of the connector that points Anthropic's own SDK at the Surplus service instead of Anthropic's normal servers. The README also shows a recipe for using OpenAI's Responses API style through Surplus by configuring an existing OpenAI SDK client with a custom base web address. The project includes a folder of runnable examples covering the API key, minimum discount, provider options, x402 payment, and Anthropic use cases, along with build, type check, and test scripts. It is released under the MIT License.

Copy-paste prompts

Prompt 1
Show me how to install surplus-ai-sdk-provider and generate text with the surplus function from its README.
Prompt 2
Explain how minimum discount routing works in surplus-ai-sdk-provider and how to set it with createSurplus.
Prompt 3
Walk me through setting up x402 payment-aware fetch in surplus-ai-sdk-provider using viem and an EVM private key.
Prompt 4
Help me configure the Anthropic skin in surplus-ai-sdk-provider to route Claude calls through Surplus Intelligence.

Frequently asked questions

What is surplus-ai-sdk-provider?

A connector library that lets Vercel AI SDK apps route AI model requests through the Surplus Intelligence pricing marketplace.

What language is surplus-ai-sdk-provider written in?

Mainly TypeScript. The stack also includes TypeScript, Node.js, Vercel AI SDK.

What license does surplus-ai-sdk-provider use?

Use freely for any purpose, including commercial use, as long as you keep the copyright notice.

How hard is surplus-ai-sdk-provider to set up?

Setup difficulty is rated easy, with roughly 5min to a first successful run.

Who is surplus-ai-sdk-provider for?

Mainly developer.

Open on GitHub → Ask about another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.