openrouter-typescript-sdk
Complete reference for integrating with 300+ AI models through the OpenRouter TypeScript SDK and Agent packages using the callModel pattern
Skill by clawdsolana
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/clawdsolana-openrouter-typescript-sdk
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: agent-building
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/openrouter-typescript-sdk
What's inside
- Skill name
openrouter-typescript-sdk- Description
- Complete reference for integrating with 300+ AI models through the OpenRouter TypeScript SDK and Agent packages using the callModel pattern
- License
- MIT
- Instructions
- 1,263 lines in SKILL.md · view on GitHub
Agent Skills spec issues
- body: 1263 lines (spec recommends under 500)
Files (2)
- SKILL.md
- metadata.json
SKILL.md (first lines)
# OpenRouter TypeScript SDK
A comprehensive TypeScript SDK for interacting with OpenRouter's unified API, providing access to 300+ AI models through a single, type-safe interface. This skill enables AI agents to leverage the `callModel` pattern for text generation, tool usage, streaming, and multi-turn conversations.
The SDK is split into two packages:
- **`@openrouter/agent`** — Agent features: `callModel`, `tool()`, stop conditions, streaming, format converters
- **`@openrouter/sdk`** — Platform features: model listing, chat completions, credits, OAuth, API key management
---
## Installation
```bash
# For agent features (callModel, tools, stop conditions)
npm install @openrouter/agent
# For platform features (models, credits, OAuth, API keys)
npm install @openrouter/sdk
```
## Setup
Get your API key from [openrouter.ai/settings/keys](https://openrouter.ai/settings/keys), then initialize:
```typescript
import { OpenRouter } from '@openrouter/agent';
const client = new OpenRouter({
apiKey: process.env.OPENROUTER_API_KEY
});
```
---
## Authentication
The SDK supports two authentication methods: API keys for server-side applications and OAuth PKCE flow for user-facing applications.
### API Key Authentication
The primary authentication method uses API keys from your OpenRouter account.
#### Obtaining an API Key
1. Visit [openrouter.ai/settings/keys](https://openrouter.ai/settings/keys)
2. Create a new API key
3. Store securely in an environment variable
#### Environment Setup
```bash
export OPENROUTER_API_KEY=sk-or-v1-your-key-here
```
#### Client Initialization
```typescript
import { OpenRouter } from '@openrouter/agent';
const client = new OpenRouter({
apiKey: process.env.OPENROUTER_API_KEY
});
```
The client automatically uses this key for all subsequent requests:
```typescript
// API key is automatically included
const result = client.callModel({
model: 'openai/gpt-5-nano',
input: 'Hello!'
});
```
#### Get Current Key Metadata
Retrieve information about the currently configured API key (requires `@openrouter/sdk`):
```typescript
import OpenRouter from '@openrouter/sdk';
const sdkClient = new OpenRouter({ apiKey: process.env.OPENROUTER_API_KEY });
const keyInfo = await sdkClient.apiKeys.getCurrentKeyMetadata();
console.log('Key name:', keyInfo.name);
console.log('Created:', keyInfo.createdAt);
```
#### API Key Management
Programmatically manage API keys:
```typescript
// List all keys
const keys = await client.apiKeys.list();
// Create a new key
const newKey = await client.apiKeys.create({
name: 'Production API Key'
});
// Get a specific key by hash
const key = await client.apiKeys.get({
hash: 'sk-or-v1-...'
});
// Update a key
await client.apiKeys.update({
hash: 'sk-or-v1-...',
requestBody: {
name: 'Updated Key Name'
}
});
// Delete a key
await client.apiKeys.delete({
hash: 'sk-or-v1-...'
});
```From clawdsolana/OpenClawd, MIT.
More from clawdsolana/OpenClawd
- 0.512score
openrouter-images
clawdsolana
Generate images from text prompts and edit existing images using OpenRouter's image generation models.
SkillCFreshness: C★ 2Claude Code +9 - 0.512score
pay
clawdsolana
User-authorized paid HTTP/API access for agents through local Pay MCP and TouchID gated payments (x402 MPP HTTP 402) SERVICES: search web, scrape, enrich…
SkillCFreshness: C★ 2Claude Code +9 - 0.512score
openrouter-models
clawdsolana
Query OpenRouter for available AI models, pricing, capabilities, throughput, and provider performance.
SkillCFreshness: C★ 2Claude Code +9 - 0.507score
honcho-cli
clawdsolana
Inspect and debug Honcho workspaces via the `honcho` CLI.
SkillCFreshness: C★ 2Claude Code +9 - 0.507score
migrate-honcho-ts
clawdsolana
Migrates Honcho TypeScript SDK code from v1.6.0 to v2.1.1.
SkillCFreshness: C★ 2Claude Code +9 - 0.507score
openrouter-oauth
clawdsolana
Implement "Sign In with OpenRouter" using OAuth PKCE — framework-agnostic, no SDK or client registration required.
SkillCFreshness: C★ 2Claude Code +9 - 0.504score
crossmint-agentic-wallet
clawdsolana
Create non-custodial Solana wallets for AI agents with e-commerce, Jupiter swaps, faucet funding, and agent-to-agent payments
SkillCFreshness: C★ 2Claude Code +9 - 0.504score
openrouter-agent-migration
clawdsolana
Migration guide from @openrouter/sdk to @openrouter/agent for callModel, tool(), stop conditions, and agent features.
SkillCFreshness: C★ 2Claude Code +9 - 0.503score
create-agent-tui
clawdsolana
Scaffolds a complete agent TUI in TypeScript using @openrouter/agent — like create-react-app for terminal agents.
SkillCFreshness: C★ 2Claude Code +9 - 0.503score
honcho-memory
plastic-labs
Gives AI agents persistent memory across conversations using Honcho.
SkillCFreshness: C★ 2Claude Code +9 - 0.503score
migrate-honcho
clawdsolana
Migrates Honcho Python SDK code from v1.6.0 to v2.1.1.
SkillCFreshness: C★ 2Claude Code +9 - 0.501score
competitive-analysis
clawdsolana
Perform competitive market analysis with comparisons and strategic recommendations.
SkillCFreshness: C★ 2Claude Code +9
Signals
- Stars
- 2
- Forks
- 3
- Open issues
- 2
- Last commit (this folder)
- May 7, 2026 (5 months ago)
- Last release
- Apr 30, 2026 (6 months ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- MIT
- Repository
- github.com/clawdsolana/OpenClawd
- Website
- solanaclawd.com/openclawd
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
Same skill elsewhere
Copies of this SKILL.md published by others; search shows only one of them.
More from clawdsolana
- 0.512score
openrouter-images
clawdsolana
Generate images from text prompts and edit existing images using OpenRouter's image generation models.
SkillCFreshness: C★ 2Claude Code +9 - 0.512score
openrouter-models
clawdsolana
Query OpenRouter for available AI models, pricing, capabilities, throughput, and provider performance.
SkillCFreshness: C★ 2Claude Code +9 - 0.512score
pay
clawdsolana
User-authorized paid HTTP/API access for agents through local Pay MCP and TouchID gated payments (x402 MPP HTTP 402) SERVICES: search web, scrape, enrich…
SkillCFreshness: C★ 2Claude Code +9 - 0.507score
honcho-cli
clawdsolana
Inspect and debug Honcho workspaces via the `honcho` CLI.
SkillCFreshness: C★ 2Claude Code +9 - 0.507score
migrate-honcho-ts
clawdsolana
Migrates Honcho TypeScript SDK code from v1.6.0 to v2.1.1.
SkillCFreshness: C★ 2Claude Code +9 - 0.507score
openrouter-oauth
clawdsolana
Implement "Sign In with OpenRouter" using OAuth PKCE — framework-agnostic, no SDK or client registration required.
SkillCFreshness: C★ 2Claude Code +9
Cite this page
openrouter-typescript-sdk skill. Agent Mart. https://agentmart.dev/skills/clawdsolana-openrouter-typescript-sdk (last updated 2026-10-24)