Never stop coding. Free MIT AI gateway: one endpoint, 375 providers (150+ free), 1,400+ models Kimi, Claude, GPT, Gemini, GLM, DeepSeek, MiniMax. Works with Claude Code, Codex, Cursor, OpenCode, Cline & Copilot. Quota-aware auto-fallback, RTK+Caveman compression saves 15-95% tokens, MCP/A2A, Desktop/PWA. Built by 900+ contributors
TypeScript a2aai-agentsai-gatewayanthropicclaudeclaude-codeclinecodexcopilotcursordeepseekfree-aigeminikimillm-gatewaymcpopenaiopenai-proxyqwentoken-saver
/**
* GET /api/agent-skills/[id]
*
* Returns a single AgentSkill by its canonical ID.
*
* Response: AgentSkill
* 404 if skill not found in catalog.
*/
import { NextResponse } from "next/server";
import { buildErrorBody } from "@omniroute/open-sse/utils/error.ts";
import { getSkillById } from "@/lib/agentSkills/catalog";
export const dynamic = "force-dynamic";
export async function GET(
_request: Request,
{ params }: { params: Promise<{ id: string }> },
) {
try {
const { id } = await params;
if (!id || typeof id !== "string") {
return NextResponse.json(buildErrorBody(400, "Missing skill id"), { status: 400 });
}
const skill = getSkillById(id);
if (!skill) {
return NextResponse.json(buildErrorBody(404, `Skill not found: ${id}`), { status: 404 });
}
return NextResponse.json(skill);
} catch (error) {
console.error("[API] GET /api/agent-skills/[id] error:", error);
return NextResponse.json(buildErrorBody(500, "Failed to load skill"), { status: 500 });
}
}