프로젝트
GitHub에서 보기
OpenRouterTeam/openrouter-examples
소개
OpenRouter API 연동 예제
AI 및 머신러닝측정된 스타 증가
- in 24h
- 0
- in 7 days
- 0
- in 15 days
- 0
- in 1 month
- 기록 수집 중
서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.
README.md
OriginalOpenRouter Examples
Comprehensive, tested, executable examples demonstrating OpenRouter features across multiple ecosystems.
Quick Start
# Set your API key
export OPENROUTER_API_KEY="your-key-here"
# Run all examples
make examples
# Or run specific ecosystems
make curl # Run curl examples
make typescript # Run TypeScript monorepo examples
Repository Structure
.
├── curl/ - Shell script examples
├── typescript/ - TypeScript monorepo (Bun workspaces)
│ ├── shared/ - Shared constants and types
│ ├── fetch/ - Raw fetch API examples
│ ├── ai-sdk-v5/ - Vercel AI SDK v5 examples
│ ├── effect-ai/ - Effect-TS examples
│ └── openrouter-sdk/ - OpenRouter SDK examples (TODO)
├── docs/ - Feature documentation
└── Makefile - Unified command interface
Features
Prompt Caching
- Documentation: docs/prompt-caching.md
- Examples:
Prerequisites
- Bun runtime:
curl -fsSL https://bun.sh/install | bash - OpenRouter API key: https://openrouter.ai/keys
- For curl examples:
jq(JSON processor)
Installation
# Install TypeScript dependencies
make install
# Or manually
cd typescript && bun install
Running Examples
All Examples
make examples
By Ecosystem
make curl # Shell scripts with curl + jq
make typescript # All TypeScript examples (fetch, AI SDK, Effect)
Individual Examples
# curl
bash curl/prompt-caching.sh
# TypeScript
cd typescript/fetch && bun examples
cd typescript/ai-sdk-v5 && bun examples
cd typescript/effect-ai && bun examples
Benefits
For Users
- Copy-paste ready - All examples are runnable as-is
- Tested and proven - Every example has been verified to work
- Evidence-based - Examples show expected outputs and verification
- Multiple ecosystems - Choose the one that matches your stack
For Developers
- Single source of truth - Constants defined once in
typescript/shared/ - Type safety - Shared types across all TypeScript examples
- Consistent patterns - Each ecosystem follows its own idioms
- Easy maintenance - Bun monorepo for TypeScript workspaces
Contributing
See individual ecosystem READMEs:
License
See LICENSE.md
관련 프로젝트 살펴보기
불러오는 중…