openrouter-hello-world

Installation
SKILL.md

OpenRouter Hello World

Overview

Send a minimal chat completion request through OpenRouter, understand the response format, try different models, and verify the full round-trip works. All requests go to the single endpoint POST https://openrouter.ai/api/v1/chat/completions.

Prerequisites

  • An OpenRouter API key (sk-or-v1-...) exported as OPENROUTER_API_KEY — see the openrouter-install-auth skill for setup
  • curl and jq for the command-line request, or Python 3.8+ / Node.js 18+ with the OpenAI SDK (pip install openai / npm install openai)
  • A free-tier model works for every step here (no credits required for :free models)

Instructions

  1. Export your key: export OPENROUTER_API_KEY="sk-or-v1-...".
  2. Send the minimal cURL request below and confirm you get a choices[0].message.content back.
  3. Read the Response Format section to identify the four key fields (id, model, usage, finish_reason).
  4. Repeat the same request from your app language using the Python or TypeScript example.
  5. Swap model IDs per Try Different Models to confirm multi-model access works with the same code.
  6. Query GET /api/v1/generation?id=gen-... per Check Generation Cost to verify cost tracking on the request you just sent.
Installs
1
GitHub Stars
2.8K
First Seen
13 days ago
openrouter-hello-world — jeremylongshore/tons-of-skills-marketplace