openrouter-hello-world

Featured

Send your first OpenRouter API request and understand the response. Use when learning OpenRouter, testing setup, or verifying connectivity. Triggers: 'openrouter hello world', 'openrouter first request', 'test openrouter', 'openrouter quickstart'.

AI & Automation 2,940 stars 439 forks Updated today MIT

Install

View on GitHub

Quality Score: 99/100

Stars 20%
100
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# 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`. ## Minimal Request (cURL) ```bash curl -s https://openrouter.ai/api/v1/chat/completions \ -H "Authorization: Bearer $OPENROUTER_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "google/gemma-2-9b-it:free", "messages": [{"role": "user", "content": "Say hello in three languages"}], "max_tokens": 100 }' | jq . ``` ## Response Format ```json { "id": "gen-abc123xyz", "model": "google/gemma-2-9b-it:free", "object": "chat.completion", "created": 1711234567, "choices": [{ "index": 0, "message": { "role": "assistant", "content": "Hello! Bonjour! Hola!" }, "finish_reason": "stop" }], "usage": { "prompt_tokens": 12, "completion_tokens": 8, "total_tokens": 20 } } ``` Key fields: - `id` (`gen-...`) -- use this to query generation stats via `GET /api/v1/generation?id=gen-abc123xyz` - `model` -- confirms which model actually served the request - `usage` -- token counts for cost calculation - `finish_reason` -- `stop` (complete), `length` (hit max_tokens), `tool_calls` (function call) ## Python Example ```python from openai import OpenAI import os client = OpenAI( base_url="https://openrouter.ai/api/v1", api_...

Details

Author
jeremylongshore
Repository
jeremylongshore/claude-code-plugins-plus-skills
Created
1 years ago
Last Updated
today
Language
Python
License
MIT

Integrates with

Bundled in these plugins

Similar Skills

Semantically similar based on skill content — not just same category