AgentStack
Browse Sign in
Browse Why AgentStack Sell Docs
Sign in
SKILL verified MIT Self-run

Add Ai Provider

skill-nikandr-surkov-ai-saas-starter-add-ai-provider · by nikandr-surkov

Implement the image-generation provider interface for a new provider (fal, Replicate, direct OpenAI, ...). Use when swapping or adding an AI provider.

No reviews yet
0 installs
0 views
view→install

Install

$ agentstack add skill-nikandr-surkov-ai-saas-starter-add-ai-provider

✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • Prompt-injection patterns
  • Secret / credential exfiltration
  • Dangerous shell & filesystem operations
  • Untrusted network calls
  • Known-malicious package signatures

What it can access

  • Network access No
  • Filesystem access No
  • Shell / process execution No
  • Environment & secrets Used
  • Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

View the full security report →

Verified badge

Passed review? Show it. Paste this badge into your README, it links to the public security report.

AgentStack Verified badge Links to your public security report.
[![AgentStack Verified](https://agentstack.voostack.com/badges/verified.svg)](https://agentstack.voostack.com/security/report/skill-nikandr-surkov-ai-saas-starter-add-ai-provider)

Reliability & compatibility

Security review passed
0 installs to date
no reviews yet
17d ago

Declared compatibility

Claude CodeClaude Desktop

Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.

Preview Execution monitoring

We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.

How agent discovery & health will work →
Are you the author of Add Ai Provider? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

Add an AI provider

The contract lives in src/lib/ai/provider.ts:

generateImage({ prompt, userId }): Promise;

The default implementation is src/lib/ai/gateway.ts (Vercel AI Gateway). Read both files before writing anything.

Steps

  1. Ask the user first — a new provider almost always means a new

dependency, and dependencies need approval (AGENTS.md).

  1. Create src/lib/ai/.ts exporting an object that satisfies the

ImageProvider interface. Keep it thin: call the API, normalize the response to { url, width, height, model }, throw on failure.

  1. Config comes from env. Add the new vars to:
  • src/lib/env.ts (Zod schema, optional unless the provider is active)
  • .env.example (with a comment and a link to where keys come from)
  1. Wire selection where the provider is chosen (see how gateway.ts and the

AI_MOCK flag are dispatched) — selection stays env-driven, no provider conditionals in UI or actions.

  1. Do not touch the credits flow. The generate action already spends

before calling the provider and refunds on failure. Your provider just throws on error; the action handles money.

  1. Test: unit-test the response normalization with a mocked HTTP layer.

Then run the e2e generate flow with the real provider once, manually.

Scope note

This repo intentionally ships one provider. Multi-provider image/video/audio with job queues, auto-refunds and gallery storage is what the Pro version is for (https://nikandr.com) — don't rebuild it ad hoc here.

Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet, be the first.

Versions

  • v0.1.0 Imported from the upstream source.