api-route
Create a new Next.js API route with x402 micropayment middleware
npx skills add majiayu000/claude-skill-registry --skill api-route --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# Create API Route with x402 Create a new API route: **$ARGUMENTS** ## x402 Pricing Reference (from IMPLEMENTATION_CHECKLIST.md) | Endpoint | Price | Description | |----------|-------|-------------| | `/api/solar/irradiance` | 0.001 USDC | Real-time solar data | | `/api/grid/carbon` | 0.002 USDC | Carbon intensity | | `/api/buildings/area` | 0.005 USDC | Building footprints | | `/api/geocode/search` | 0.001 USDC | Address geocoding | | `/api/premium/analytics` | 0.01 USDC | Premium aggregated data | ## File Structure ``` src/pages/api/ ├── solar/ │ └── irradiance.ts ├── grid/ │ └── carbon.ts ├── buildings/ │ └── area.ts ├── geocode/ │ └── search.ts └── premium/ └── analytics.ts ``` ## API Route Template ```typescript // src/pages/api/{path}.ts import type { NextApiRequest, NextApiResponse } from "next"; // Types for this endpoint interface ResponseData { // Define response shape } interface ErrorResponse { error: string; message: string; } export default async function handler( req: NextApiRequest, res: NextApiResponse<ResponseData | ErrorResponse> ) { // Only allow GET requests (or POST if needed) if (req.method !== "GET") { return res.status(405).json({ error: "Method not allowed
- x402 Pricing Reference (from IMPLEMENTATIONCHECKLIST.md)
- File Structure
- API Route Template
- x402 Middleware Pattern (Future)
- Upstream API Clients
- Checklist
What does the api-route skill do?
Create a new Next.js API route with x402 micropayment middleware
How do I install it?
Run `npx skills add majiayu000/claude-skill-registry --skill api-route --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From majiayu000/claude-skill-registry, a repository with 534 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
