Back to blog
AIGuides & Tutorials

How to Get Your OpenRouter API Key

This guide walks you through how to get your OpenRouter API key in just a few minutes. You’ll learn how to create an account, add credits, generate your key, store it securely, and also how to run a quick test to confirm everything is working.

Saurabh RaiSaurabh Rai

Saurabh Rai

2 min read
How to Get Your OpenRouter API Key

How to Get Your OpenRouter API Key 1

OpenRouter is an API gateway that gives you access to multiple AI models (OpenAI, Anthropic, Google, Meta, and more) through a single API. Instead of managing separate API keys for each provider, you pay OpenRouter and route requests to whichever model you need. It’s popular for developers who want model flexibility without maintaining multiple integrations.

Getting an API key takes about 2 minutes.

Step 1: Create Your Account

Go to openrouter.ai and sign up. You can use Google, GitHub, or email authentication.

Step 2: Add Credits

OpenRouter uses a prepaid credit system. Go to the Credits page and add funds to your account. Minimum is usually $5. You’ll need credits before you can use the API.

Step 3: Generate an API Key

How to Get Your OpenRouter API Key 2

  1. Navigate to openrouter.ai/keys
  2. Click “Create Key”
  3. Give it a name (optional, but useful if you create multiple keys)
  4. Copy the key immediately — you won’t see it again

Step 4: Store Your Key Securely

How to Get Your OpenRouter API Key 3

Use environment variables, not hardcoded keys. For terminal/command line:


bash
export OPENROUTER_API_KEY=your-api-key-here

For applications (.env file):


OPENROUTER_API_KEY=your-api-key-here
Add .env to .gitignore.

Quick Test

OpenRouter uses OpenAI-compatible endpoints, so you can test with:


bash
curl https://openrouter.ai/api/v1/chat/completions \
  -H "Authorization: Bearer $OPENROUTER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "meta-llama/llama-3.1-8b-instruct:free",
    "messages": [{"role": "user", "content": "Hello"}]
  }'

Ready to get started?

Scale your integration strategy and deliver the integrations your customers need in record time.

Ready to get started?
Talk to an expert

Trusted by fast-moving product & engineering teams

Nmbrs
Benefex
Invoice2go by BILL
Trengo
Ponto | Isabel Group
Apideck Blog

Insights, guides, and updates from Apideck

Discover company news, API insights, and expert blog posts. Explore practical integration guides and tech articles to make the most of Apideck's platform.

ERP Integration for Fintech and SaaS: Connecting QuickBooks, NetSuite, and Sage the Smart Way
AccountingUnified APIGuides & Tutorials

ERP Integration for Fintech and SaaS: Connecting QuickBooks, NetSuite, and Sage the Smart Way

This guide explains why ERP integration is critical for fintech and SaaS platforms and why it’s often such a bottleneck. You’ll learn the key challenges of connecting QuickBooks, NetSuite, and Sage, common pitfalls that derail projects, best practices for implementation, and how unified APIs can simplify integrations, cut costs, and speed up time to market.

Kateryna Poryvay

Kateryna Poryvay

10 min read
Bank Feeds API Integration: Why You Can’t Afford to Skip This Feature
Unified APIGuides & Tutorials+2 more

Bank Feeds API Integration: Why You Can’t Afford to Skip This Feature

Finance teams reject fintech products without bank feed integrations. Learn how unified APIs let you ship automated accounting sync for Xero, QuickBooks, and 20+ platforms in weeks instead of building direct integrations for 18+ months.

Saurabh Rai

Saurabh Rai

11 min read
Top 15 Accounting APIs to Integrate with in 2025
Unified APIIndustry insights

Top 15 Accounting APIs to Integrate with in 2025

Building SaaS in 2025? The right accounting API can make or break your product. This article breaks down the 15 APIs that matter most—what they’re best at, key features, and real-world use cases. Plus, the trends shaping integrations this year. A must-read for anyone serious about scaling with seamless financial workflows.

Kateryna Poryvay

Kateryna Poryvay

15 min read