# Generate AI text and images with Claude and Stripe metered billing

> Quick overview This workflow exposes a POST webhook that authenticates requests against Stripe customer metadata, checks an active subscription and metered usage limits, generates text with Anthropic Claude or images via an external image API, records Stripe usage, and returns a synchronous JSON response. How it works 1. Receives a POST webhook request containing an apiKey, contentType (text or image), a prompt, and optional generation parameters. 2. Searches Stripe for a customer whose metadata.apiKey matches the incoming key and returns a 401 JSON error if no customer is found. 3. Fetches the customer’s active Stripe subscription, reads the metered subscription item, and pulls current-period usage summaries for that item. 4. Compares current usage to a per-plan monthly limit (based on the subscription’s Stripe price ID) and returns a 402 JSON error if there is no active subscription or the limit is exceeded. 5. Generates content by calling the Anthropic Messages API for text requests

- **Domain**: `n8n-workflow-19670.n8n.io`
- **Provider**: n8n.io (https://n8n.io)
- **Kind**: workflow
- **Live-responds (last probe)**: None
- **Signed card**: False
- **Streaming**: False
- **Quality score**: 40%

## URLs
- Agent card: https://n8n.io/workflows/19670
- Page (HTML): https://agenstry.com/agents/n8n-workflow-19670.n8n.io
- Documentation: https://n8n.io/workflows/19670
