n8n Webhook: Claude Text & Image Gen with Stripe Metered Billing
n8n Webhook: Claude Text & Image Gen with Stripe Metered Billing
Regular price
£21.99
Regular price
£21.99
Sale price
Unit price
/
per
⬇
Instant Digital Download
∞
Unlimited Downloads
★
Lifetime Access in Your Account
Couldn't load pickup availability
🔥
128+ Sold
Popular with n8n builders
⚡
23 people viewing
High interest right now
✅
9 added today
Fast-moving digital product
n8n Webhook: Claude Text & Image Gen with Stripe Metered Billing
Regular price
£21.99
Regular price
£21.99
Sale price
Unit price
/
per
Control Claude Text & Image Generation with Stripe Metered Billing
This n8n workflow exposes a secure POST webhook that authenticates requests with Stripe customer metadata, enforces metered subscription limits, generates content with Anthropic Claude (text) or a configurable image-generation HTTP endpoint (images), records usage in Stripe, and returns a synchronous JSON response.
What this workflow does
- Receives a POST webhook with an apiKey, contentType (text or image), a prompt, and optional generation parameters.
-
Authenticates against Stripe by searching for a Stripe customer whose
metadata.apiKeymatches the incoming key. If no customer is found, it returns a 401 JSON error. - Validates subscription + metered usage by retrieving the customer’s active Stripe subscription and reading the metered subscription item’s current-period usage summaries.
- Enforces plan limits using the subscription’s Stripe price ID to determine the per-plan monthly cap. If there’s no active subscription or the limit is exceeded, it returns a 402 JSON error.
-
Generates output:
- Text: calls the Anthropic Messages API.
- Images: calls a configured image-generation HTTP endpoint.
- Records Stripe usage by incrementing the metered subscription item and returns a success JSON payload including the generated content and updated usage counters.
Use cases
- SaaS operators offering API-based AI generation with pay-per-use limits.
- Teams building a “Claude-powered” feature where every request must be billed via Stripe metered subscriptions.
- Automation engineers creating a webhook-based content service that immediately responds with generated text or images.
Technical details
-
Webhook: POST endpoint accepting
apiKey,contentType, andprompt. - Integrations: Stripe (Customers, Subscriptions, Subscription Items, Usage Records) + Anthropic Claude (Messages API) + an external image-generation HTTP API.
-
n8n nodes used:
if,set,code,merge,switch,webhook.
Best for teams who need Claude text & image generation tightly coupled to Stripe billing, limits, and usage tracking.
