Agent skill

Openrouter Hello World

by jeremylongshore in jeremylongshore/tons-of-skills-marketplace

Send your first OpenRouter API request and understand the response.

MITAuto-check passedAI & LLM Engineering

Install Openrouter Hello World

skills CLI
$ npx skills add jeremylongshore/tons-of-skills-marketplace --skill openrouter-hello-world -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install jeremylongshore/tons-of-skills-marketplace openrouter-hello-world --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/jeremylongshore/tons-of-skills-marketplace.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/.curated/openrouter-hello-world .claude/skills/openrouter-hello-world && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
openrouter-hello-world
GitHub stars
2.8k
Token cost
~1.8k tokens
SKILL.md length
421 words
Files
7 (incl. references)
Skills in repo
3,342
Repo updated
First seen
Licence
MIT

At a glance

Send your first OpenRouter API request and understand the response.

  • Works in 6 steps: Export your key: export… → Send the minimal cURL request below and… → Read the Response Format section to… → …
  • Learning OpenRouter
  • SKILL.md covers Overview, Prerequisites, Instructions and Minimal Request (cURL), plus 10 more sections
  • Calls curl, jq and pip; reaches openrouter.ai; needs OPENROUTER_API_KEY

What it does

Openrouter Hello World is an agent skill from jeremylongshore/tons-of-skills-marketplace. 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'.

Its SKILL.md is about 1.8k tokens, which your agent loads only when the skill is triggered. The skill folder holds 7 other files, including reference files (for example `references/errors.md`, `references/examples.md` and `references/python-example.md`). Compatibility notes: Designed for Claude Code

It sits in AI & LLM Engineering, covering Model routing and gateways. It works with OpenRouter, Python, TypeScript and OpenAI. The repository describes itself as: Model-agnostic agent-skills platform with a harness-free canonical layer, verified adapters, and the ccpi package manager. Explore at tonsofskills.com. The licence is MIT.

When your agent uses it

  • Learning OpenRouter
  • Verifying connectivity

Example prompts

  • “openrouter hello world”
  • “openrouter first request”
  • “test openrouter”
  • “/openrouter-hello-world”

Requirements

  • Python 3
  • Node.js
  • A credential in OPENROUTER_API_KEY
  • Compatibility (from SKILL.md): Designed for Claude Code
  • Pre-approved tools (allowed-tools): Read, Write, Edit, Grep, Bash(curl:*), Bash(python3:*), Bash(node:*), Bash(jq:*)

Workflow steps

6 steps, taken from the first numbered list in SKILL.md.

  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.

What it can do on your machine

Read from SKILL.md and the folder at commit cfae287. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • Read
    • Write
    • Edit
    • Grep
    • Bash(curl:*)
    • Bash(python3:*)
    • Bash(node:*)
    • Bash(jq:*)

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • curl
    • jq
    • pip
    • npm

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Hosts in commands or code, which the agent is likely to contact:

    • openrouter.ai

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names these keys or tokens, usually read from environment variables:

    • OPENROUTER_API_KEY

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

  • Compatibility

    Designed for Claude Code

    From compatibility in the SKILL.md frontmatter.

Context cost

Openrouter Hello World loads about 1.8k tokens when it runs, and up to ~3.4k if it reads all its reference files. Until then it costs about 68 tokens; SKILL.md has 421 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~68
When it runs · the whole SKILL.md, loaded when a task matches
~1.8k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~3.4k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from jeremylongshore/tons-of-skills-marketplace at commit cfae287, republished under its MIT licence (© jeremylongshore). 421 words, ~1,821 tokens.

Download SKILL.mdSave it as .claude/skills/openrouter-hello-world/SKILL.md (or your agent's skills folder). This skill also uses 6 other files; get the full folder from GitHub.
name
openrouter-hello-world
description
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'.
allowed-tools
Read, Write, Edit, Grep, Bash(curl:*), Bash(python3:*), Bash(node:*), Bash(jq:*)
compatibility
Designed for Claude Code
version
1.20.0
license
MIT
author
Jeremy Longshore <jeremy@intentsolutions.io>
tags
saas, openrouter, api, quickstart

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.

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_key=os.environ["OPENROUTER_API_KEY"],
    default_headers={"HTTP-Referer": "https://your-app.com", "X-Title": "My App"},
)

# Basic completion
response = client.chat.completions.create(
    model="google/gemma-2-9b-it:free",
    messages=[
        {"role": "system", "content": "You are a helpful assistant."},
        {"role": "user", "content": "What is OpenRouter in one sentence?"},
    ],
    max_tokens=100,
)

print(response.choices[0].message.content)
print(f"Model: {response.model}")
print(f"Tokens: {response.usage.prompt_tokens} prompt + {response.usage.completion_tokens} completion")

TypeScript Example

typescript
import OpenAI from "openai";

const client = new OpenAI({
  baseURL: "https://openrouter.ai/api/v1",
  apiKey: process.env.OPENROUTER_API_KEY,
  defaultHeaders: { "HTTP-Referer": "https://your-app.com", "X-Title": "My App" },
});

const res = await client.chat.completions.create({
  model: "google/gemma-2-9b-it:free",
  messages: [{ role: "user", content: "What is OpenRouter in one sentence?" }],
  max_tokens: 100,
});

console.log(res.choices[0].message.content);
console.log(`Model: ${res.model} | Tokens: ${res.usage?.total_tokens}`);

Try Different Models

python
# Swap model ID to access any of 400+ models
models_to_try = [
    "google/gemma-2-9b-it:free",         # Free tier
    "meta-llama/llama-3.1-8b-instruct",  # Open-source
    "anthropic/claude-3.5-sonnet",        # Anthropic
    "openai/gpt-4o",                      # OpenAI
    "openrouter/auto",                    # Auto-router (picks best model)
]

for model_id in models_to_try:
    try:
        r = client.chat.completions.create(
            model=model_id,
            messages=[{"role": "user", "content": "Hi"}],
            max_tokens=10,
        )
        print(f"{model_id}: {r.choices[0].message.content}")
    except Exception as e:
        print(f"{model_id}: {e}")

Check Generation Cost

bash
# After a request, query the generation endpoint for cost details
curl -s "https://openrouter.ai/api/v1/generation?id=gen-abc123xyz" \
  -H "Authorization: Bearer $OPENROUTER_API_KEY" | jq '{
    model: .data.model,
    tokens_prompt: .data.tokens_prompt,
    tokens_completion: .data.tokens_completion,
    total_cost: .data.total_cost
  }'
Show full SKILL.md (198 more words)Show less

Output

A successful round-trip produces:

  • A chat completion JSON with choices[0].message.content holding the model's reply, a gen-... request id, the model that actually served the request, and usage token counts
  • Console output from the Python/TypeScript examples: the reply text plus model name and prompt/completion token counts
  • A cost record from the generation endpoint: tokens_prompt, tokens_completion, and total_cost for the request

Examples

End-to-end run with the minimal cURL request:

text
$ curl -s https://openrouter.ai/api/v1/chat/completions ... | jq .choices[0].message.content
"Hello! Bonjour! Hola!"

The Python and TypeScript sections above are the same request in SDK form; expected console output:

text
OpenRouter is a unified API gateway that routes requests to 400+ LLMs.
Model: google/gemma-2-9b-it:free
Tokens: 21 prompt + 17 completion

More worked examples (cURL with full expected response, SDK variants): references/examples.md.

Error Handling

HTTPCauseFix
401Invalid or missing API keyVerify sk-or-v1-... key is exported
402Insufficient credits for paid modelAdd credits or use a :free model
404Wrong base URL or invalid model IDUse https://openrouter.ai/api/v1; check model ID at /api/v1/models
400Malformed JSON or missing messagesEnsure messages array has objects with role and content

Enterprise Considerations

  • Always set max_tokens to prevent unbounded completions
  • Use HTTP-Referer and X-Title headers for usage attribution in dashboards
  • Query /api/v1/generation?id= for async cost auditing
  • Test with free models first, then switch to paid models for production

References

© jeremylongshore, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 6 other files (references) in skills/.curated/openrouter-hello-world of jeremylongshore/tons-of-skills-marketplace.

  • SKILL.md
  • references/errors.md
  • references/examples.md
  • references/python-example.md
  • references/try-different-models.md
  • references/typescript-example.md
  • references/your-first-request.md

Open the folder on GitHubat commit cfae287

Compare with similar skills

Openrouter Hello World next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Openrouter Hello World compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Openrouter Hello World this skilljeremylongshore/tons-of-skills-marketplace2.8k—~1.8kAutomated safety check: PassMIT
Agent Squad Python Guide2FastLabs/agent-squad7.8k—~4.7kAutomated safety check: PassApache-2.0
Add Example AgentGetBindu/Bindu10k—~1.1kAutomated safety check: NotesCustom licence
Embeddings via 9Routerdecolua/9router31k—~604Automated safety check: PassMIT
Using Ccproxy Inspectorstarbaser/ccproxy350—~2.7kAutomated safety check: PassCustom licence
Duel Agents2aronS/Duel-Agents745—~228Automated safety check: PassMIT

Similar skills

  • Agent Squad Python Guide

    2FastLabs/agent-squad

    Map of the agent-squad Python framework for async multi-agent orchestration: which agent, classifier, storage and tool provider to pick, and the pitfalls to avoid.

    7.8k GitHub stars~4.7k tokensUpdated 3 days ago
    AI & LLM EngineeringAuto-check passed
  • Add Example Agent

    GetBindu/Bindu

    Add a new self-contained example agent under examples/. An agent skill from GetBindu/Bindu.

    10k GitHub stars~1.1k tokensUpdated 1 mo ago
    AI & LLM EngineeringAuto-check: notes
  • Embeddings via 9Router

    decolua/9router

    Generates vector embeddings through the 9Router /v1/embeddings endpoint, using models from providers such as OpenAI, Gemini, Mistral and Voyage for RAG and semantic search.

    31k GitHub stars~604 tokensUpdated 3 days ago
    AI & LLM EngineeringAuto-check passed
  • Using Ccproxy Inspector

    starbaser/ccproxy

    Operates the ccproxy inspector MITM system for intercepting, inspecting, and transforming LLM API traffic.

    350 GitHub stars~2.7k tokensUpdated 2 mo ago
    AI & LLM EngineeringAuto-check passed
  • Duel Agents

    2aronS/Duel-Agents

    Use Duel Agents model routing in Cursor. An agent skill from 2aronS/Duel-Agents.

    745 GitHub stars~228 tokensUpdated 3 mo ago
    AI & LLM EngineeringAuto-check passed
  • Pinme LLM

    glitternetwork/pinme

    A skill your agent uses when a PinMe project (Worker TypeScript) needs to call OpenRouter-backed LLM APIs, including models, chat/completions, streaming, or OpenRouter web search.

    3.8k GitHub stars~2.8k tokensUpdated 29 days ago
    AI & LLM EngineeringAuto-check passed

More from jeremylongshore/tons-of-skills-marketplace

All 3,342 skills in this repo
  • Performing Security Code Review

    jeremylongshore/tons-of-skills-marketplace

    Execute this skill enables AI assistant to conduct a security-focused code review using the security-agent plugin.

    2.8k GitHub starsUsed in 2 repos~1.3k tokens
    Auto-check: notes
  • Adapting Transfer Learning Models

    jeremylongshore/tons-of-skills-marketplace

    Build this skill automates the adaptation of pre-trained machine learning models using transfer learning techniques.

    2.8k GitHub stars~1.1k tokensUpdated today
    Auto-check passed
  • Agent Context Loader

    jeremylongshore/tons-of-skills-marketplace

    Execute proactive auto-loading: automatically detects and loads agents.md files.

    2.8k GitHub stars~1.1k tokensUpdated today
    Auto-check passed
  • Aggregating Performance Metrics

    jeremylongshore/tons-of-skills-marketplace

    Aggregate and centralize performance metrics from applications, systems, databases, caches, and services.

    2.8k GitHub stars~1.2k tokensUpdated today
    Auto-check passed
  • Analyzing Capacity Planning

    jeremylongshore/tons-of-skills-marketplace

    Execute this skill enables AI assistant to analyze capacity requirements and plan for future growth.

    2.8k GitHub stars~947 tokensUpdated today
    Auto-check passed
  • Analyzing Database Indexes

    jeremylongshore/tons-of-skills-marketplace

    Process use when you need to work with database indexing. An agent skill from jeremylongshore/tons-of-skills-marketplace.

    2.8k GitHub stars~2k tokensUpdated today
    Auto-check passed

Questions about Openrouter Hello World

What does Openrouter Hello World do?

Send your first OpenRouter API request and understand the response. Openrouter Hello World is an agent skill from jeremylongshore/tons-of-skills-marketplace. Send your first OpenRouter API request and understand the response.

When should I use Openrouter Hello World?

Openrouter Hello World fits situations like: learning OpenRouter; verifying connectivity.

How do I install Openrouter Hello World in Claude Code?

Run `npx skills add jeremylongshore/tons-of-skills-marketplace --skill openrouter-hello-world -a claude-code`. Or copy the skill folder (skills/.curated/openrouter-hello-world in jeremylongshore/tons-of-skills-marketplace) into .claude/skills/openrouter-hello-world in your project. Claude Code loads it when a task matches its description.

How do I install Openrouter Hello World in Codex?

Run `npx skills add jeremylongshore/tons-of-skills-marketplace --skill openrouter-hello-world -a codex`. Or copy the skill folder (skills/.curated/openrouter-hello-world in jeremylongshore/tons-of-skills-marketplace) into .agents/skills/openrouter-hello-world in your project. Codex loads it when a task matches its description.

Can I use Openrouter Hello World in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add jeremylongshore/tons-of-skills-marketplace --skill openrouter-hello-world -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/openrouter-hello-world, .gemini/skills/openrouter-hello-world, .github/skills/openrouter-hello-world and .opencode/skills/openrouter-hello-world in your project.

What does Openrouter Hello World need to run?

Going by SKILL.md and its folder, Openrouter Hello World needs the command-line tools its instructions call (curl, jq, pip and npm) and credentials named OPENROUTER_API_KEY. Our summary lists: Python 3; Node.js; A credential in OPENROUTER_API_KEY. Its frontmatter pre-approves these tools: Read, Write, Edit, Grep, Bash(curl:*), Bash(python3:*), Bash(node:*), Bash(jq:*). Compatibility (from SKILL.md): Designed for Claude Code.

Does Openrouter Hello World access the network?

SKILL.md names 1 domain. In commands or code: openrouter.ai; the agent is likely to contact it when it follows the instructions. This is read from the text; nothing was executed.

Is Openrouter Hello World safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Openrouter Hello World use?

Openrouter Hello World is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Openrouter Hello World use?

About 1.8k tokens (SKILL.md is roughly 7.3k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 1.6k tokens, read only when the agent opens those files.

What are the alternatives to Openrouter Hello World?

Skills that share tags, products or a category with Openrouter Hello World: Agent Squad Python Guide (2FastLabs/agent-squad, 7.8k stars), Add Example Agent (GetBindu/Bindu, 10k stars), Embeddings via 9Router (decolua/9router, 31k stars) and Using Ccproxy Inspector (starbaser/ccproxy, 350 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Openrouter Hello World?

jeremylongshore (a GitHub user) maintains it in jeremylongshore/tons-of-skills-marketplace, which has 2,827 GitHub stars. The repository holds 3,342 skills in this directory. The repository was last updated on October 10, 2026.

Source: jeremylongshore/tons-of-skills-marketplace on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.