agentskit.js
Providers

openrouter

OpenRouter — one API to route across 100+ providers with transparent pricing.

import { openrouter } from '@agentskit/adapters'

const adapter = openrouter({
  apiKey: process.env.OPENROUTER_API_KEY!,
  model: 'anthropic/claude-sonnet-4',
  appUrl: 'https://www.agentskit.io',
  appName: 'AgentsKit',
})

Options

OptionTypeDefault
apiKeystringrequired
modelstringrequired
baseUrlstringhttps://openrouter.ai/api/v1
appUrlstring— (optional attribution)
appNamestring
fetchtypeof fetchglobal

Why openrouter

  • Single key, many providers. Good for experimentation.
  • Transparent per-model pricing; automatic fallbacks.
  • Pair with createFallbackAdapter for extra resilience.

Env

VarPurpose
OPENROUTER_API_KEYAPI key
✎ Edit this page on GitHub·Found a problem? Open an issue →·How to contribute →

On this page