Agent skill · Backend & API

api-route

Create a new Next.js API route with x402 micropayment middleware

majiayu000github.com/majiayu000GitHub ↗
claude-codeMIT
Install
npx skills add majiayu000/claude-skill-registry --skill api-route --agent claude-code

Same command for any agent — swap --agent for codex, cursor, copilot.

Facts
Files in the skill folder: 2
SKILL.md size: 4 KB
Bundled scripts: none
Path: skills/api/api-route/SKILL.md
Open the folder on GitHub →
Where it comes from
Stars: 534
Language: HTML

Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.

From the SKILL.md

# 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

What's inside
Steps it walks through
  1. x402 Pricing Reference (from IMPLEMENTATIONCHECKLIST.md)
  2. File Structure
  3. API Route Template
  4. x402 Middleware Pattern (Future)
  5. Upstream API Clients
  6. Checklist
Ships with 1 file
  • metadata.json
More from claude-skill-registry
All skills →
About this skill
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.

Keep going