HN 표시: OpenRouter 기술 – OpenRouter를 사용하는 AI 에이전트를 위한 재사용 가능한 통합
hackernews
|
|
🔬 연구
#ai 에이전트
#openai
#openrouter
#review
#개발
#재사용
#통합
원문 출처: hackernews · Genesis Park에서 요약 및 분석
요약
HN 토론 게시판 작성자가 사이드 프로젝트에서 반복되는 OpenRouter 연동 작업을 줄이기 위해 AI 코딩 에이전트가 참고할 수 있는 재사용 가능한 '스킬' 패키지를 공개했습니다. 이 스킬은 모델 발견, 이미지 생성, 비용 추적 등의 기능을 구현하는 코드 패턴과 Next.js 및 Express 시작 템플릿을 포함하고 있습니다. 개발자가 아닌 PM이 Claude를 통해 작성한 이 도구는, 에이전트가 코드를 작성하기 전에 참조하여 응답 파싱 오류나 헤더 누락 같은 문제를 방지하는 것을 목표로 합니다.
본문
Stop rebuilding the same OpenRouter integration every project. A reusable skill that gives your AI coding agent ready-made patterns for model discovery, image generation, cost lookup, routing, and production playbooks — so the agent writes better OpenRouter code instead of starting from scratch. Landing page: bnishit.github.io/openrouter-skill npx skills add bnishit/openrouter-skill Works with any AI agent that supports the skills install flow. After install, invoke it as $openrouter-integration . Direct git clone: git clone https://github.com/bnishit/openrouter-skill.git Install from openrouter-skill . Use $openrouter-integration in prompts. - Model Discovery — search 300+ models by capability, price, or provider and build a picker in minutes - Image Generation — generate images via chat completions with presets for icons, OG images, and social assets - Multimodal Chat — send text, images, and PDFs in the same conversation and parse any response type - Cost Tracking — look up exact cost per generation with real billing data, not estimates - Routing & Fallbacks — route to cheapest provider and fall back automatically when one goes down - Tool Calling — agentic loops with safety limits and structured output with Zod validation - Provider & Free Models — filter by provider and find zero-cost models automatically - Starter Templates — Next.js and Express routes ready to copy, not configure - Asset Workflows — icons, OG images, banners — generate, preview, and persist with metadata - Production Playbooks — fallback rules, logging, audit trails — encoded, not remembered - Safer Defaults — proxies block untrusted URLs unless you explicitly allowlist trusted hosts - Verification — smoke tests and doc-check scripts that detect when OpenRouter changes Use $openrouter-integration to add an OpenRouter model picker to this app. Use $openrouter-integration to add image generation plus image and PDF chat support through an OpenRouter server route. Use $openrouter-integration to make this OpenRouter workflow production-safe with the built-in best-practice playbooks for routing, tools, and observability. . ├── SKILL.md ├── agents/openai.yaml ├── references/ ├── scripts/ ├── assets/ └── docs/ SKILL.md : trigger metadata plus the core OpenRouter workflowagents/openai.yaml : UI-facing metadata for supported agent skill systemsreferences/ : targeted reference material for image generation, requests, routing, troubleshooting, and docs checksreferences/catalog-routing-best-practices.md : production rules for model catalogs, provider filters, and fallbacksreferences/image-generation-best-practices.md : concrete icon, OG image, social asset, preview, and storage rulesreferences/tool-calling-and-structured-output-best-practices.md : production rules for tools, schemas, and validation loopsreferences/operations-and-observability-best-practices.md : logging, generation id, cost audit, and artifact-traceability rulesscripts/ : helper scripts for documentation checks and starter installationassets/ : reusable templates, shared helpers, and smoke-test fixturesdocs/ : static landing page and search-facing metadata for GitHub Pages - Templates: Next.js and Express starter routes for models, chat, image generation, and cost lookup — plus UI components like a model picker and image workbench - Shared helpers: TypeScript utilities for streaming (SSE), response parsing, generated-image extraction, asset persistence, and structured output validation - Tests: Curl-based smoke tests and fixtures covering text, JSON, tools, image analysis, image generation, and PDFs The starter proxies default to data: URLs for uploaded assets and block arbitrary remote http(s) image/PDF URLs unless you set OPENROUTER_ALLOWED_REMOTE_ASSET_HOSTS . catalog-routing-best-practices.md : how to build searchable model pickers, provider-aware routing, and sane fallback behavior without stale hardcoded assumptionsimage-generation-best-practices.md : how to generate icons, OG images, and social assets with preview plus storage-ready metadatatool-calling-and-structured-output-best-practices.md : how to keep tool loops and JSON extraction reliable instead of fragileoperations-and-observability-best-practices.md : how to persist generation ids, log the right fields, and answer later cost/debug questions cleanly The SDK is the transport layer — HTTP calls and auth. This skill is the decision layer — which model to pick, how to route, what to do on failure, how to audit costs. They complement each other. No. Works with any agent supporting skills install. Templates produce standard Next.js/Express code. Stop using the skill, keep all generated code. The skill fetches catalogs live from the OpenRouter API — it never ships hardcoded model lists. Run check_openrouter_docs.py --quick to detect API drift. The skill enforces server-side key management. Proxy route templates handle auth headers plus OpenRouter attribution headers. Keys never touch the browser. Yes. Every capability is
Genesis Park 편집팀이 AI를 활용하여 작성한 분석입니다. 원문은 출처 링크를 통해 확인할 수 있습니다.
공유