openrouter-inspector


Nameopenrouter-inspector JSON
Version 0.1.9 PyPI version JSON
download
home_pageNone
SummaryA command-line tool for querying OpenRouter AI models and providers
upload_time2025-08-13 23:55:27
maintainerNone
docs_urlNone
authorNone
requires_python>=3.10
licenseMIT License Copyright (c) 2024 OpenRouter CLI Team Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords ai api cli models openrouter
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # OpenRouter Inspector

[![CI](https://github.com/matdev83/openrouter-inspector/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/matdev83/openrouter-inspector/actions/workflows/ci.yml)
[![codecov](https://codecov.io/gh/matdev83/openrouter-inspector/branch/main/graph/badge.svg)](https://codecov.io/gh/matdev83/openrouter-inspector)
[![PyPI](https://img.shields.io/pypi/v/openrouter-inspector.svg)](https://pypi.org/project/openrouter-inspector/)
![Python](https://img.shields.io/badge/python-%3E%3D3.10-blue)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)
[![security: bandit](https://img.shields.io/badge/security-bandit-yellow.svg)](https://github.com/PyCQA/bandit)
[![Pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white)](https://github.com/pre-commit/pre-commit)
[![Tests](https://github.com/matdev83/openrouter-inspector/actions/workflows/tests.yml/badge.svg?branch=main)](https://github.com/matdev83/openrouter-inspector/actions/workflows/tests.yml)
![Last commit](https://img.shields.io/github/last-commit/matdev83/openrouter-inspector)
[![Issues](https://img.shields.io/github/issues/matdev83/openrouter-inspector)](https://github.com/matdev83/openrouter-inspector/issues)

A lightweight CLI for exploring OpenRouter AI models, listing provider endpoints with supported model parameters, and benchmarking endpoint latency and throughput.

## Installation

### Requirements

- Python 3.10+

### From PyPI (recommended)

- With pipx (recommended for CLIs):
  ```bash
  pipx install openrouter-inspector
  ```
- Or with pip into your active environment:
  ```bash
  pip install openrouter-inspector
  ```

### From source (development)

- Install from a clone:
  ```bash
  pip install .
  ```
- Editable/development install:
  ```bash
  pip install -e .
  ```

### Contributing / Development

If you want to hack on the project (dev setup, tests, QA, pre-commit, etc.), see
the dedicated contributor guide:

[CONTRIBUTING.md](CONTRIBUTING.md)

## Features

- Explore available models and provider-specific endpoints from OpenRouter.
- Rich table output with pricing per 1M tokens and optional provider counts.
- Change detection for new models and pricing changes between runs.
- JSON output for easy scripting.

## Usage

The CLI supports both subcommands and lightweight global flags.

### Authentication

Set your OpenRouter API key via environment variable (required):

```bash
export OPENROUTER_API_KEY=sk-or-...
```

For security, the CLI does not accept API keys via command-line flags. It reads the key only from the `OPENROUTER_API_KEY` environment variable. If the key is missing or invalid, the CLI shows a friendly error and exits.

### Quick starts

Subcommands:

```bash
# List all models
openrouter-inspector list

# List models filtered by substring (matches id or display name)
openrouter-inspector list openai

# List models with multiple filters (AND logic)
openrouter-inspector list meta free

# Or just type your search terms; default action is `list`
openrouter-inspector gemini-2.0 free

# Detailed provider endpoints (exact model id)
openrouter-inspector endpoints deepseek/deepseek-r1

# To check the endpoint health and latency
openrouter-inspector ping google/gemini-2.0-flash-exp:free
```

 

### Commands

#### list

```bash
openrouter-inspector list [filters...] [--with-providers] [--sort-by id|name|context|providers] [--desc] [--format table|json|yaml]
```

- Displays all available models with enhanced table output (Name, ID, Context, Input/Output pricing).
- Optional positional `filters` performs case-insensitive substring matches against model id and name using AND logic.
- Context values are displayed with K suffix (e.g., 128K).
- Input/Output prices are shown per million tokens in USD.
- **Change Detection**: Automatically detects new models and pricing changes compared to previous runs with the same parameters. New models are shown in a separate table, and pricing changes are highlighted in yellow.

Options:
- `--format [table|json|yaml]` (default: table)
- `--with-providers` add a Providers column (makes extra API calls per model)
- `--sort-by [id|name|context|providers]` (default: id)
- `--desc` sort descending

#### endpoints

```bash
openrouter-inspector endpoints MODEL_ID [--min-quant VALUE] [--min-context VALUE] [--sort-by provider|model|quant|context|maxout|price_in|price_out] [--desc] [--per-1m] [--format table|json|yaml]
```

Shows detailed provider offers for an exact model id (`author/slug`), with:
- Provider, Model (provider endpoint name), Reason (+/-), Quant, Context (K), Max Out (K), Input/Output price (USD/1M)

Behavior:
- Fails if model id does not match an exact existing model or returns no offers.

Filters and sorting:
- `--min-quant VALUE` minimum quantization (e.g., fp8). Unspecified quant (“—”) is included as best.
- `--min-context VALUE` minimum context window (e.g., `128K` or `131072`).
- `--sort-by [provider|model|quant|context|maxout|price_in|price_out]` (default: provider)
- `--desc` sort descending

#### check

```bash
openrouter-inspector check MODEL_ID PROVIDER_NAME ENDPOINT_NAME
```

Checks a specific provider endpoint's health using OpenRouter API status. Web-scraped metrics have been removed.

Behavior:
- Returns one of: `Functional`, `Disabled`.
- If API indicates provider is offline/disabled or not available → `Disabled`.
- Otherwise → `Functional`.

Options:
- `--log-level [CRITICAL|ERROR|WARNING|INFO|DEBUG|NOTSET]` set logging level

#### ping

```bash
openrouter-inspector ping MODEL_ID [PROVIDER_NAME]
openrouter-inspector ping MODEL_ID@PROVIDER_NAME

# Examples
openrouter-inspector ping openai/o4-mini
openrouter-inspector ping deepseek/deepseek-chat-v3-0324:free Chutes
openrouter-inspector ping deepseek/deepseek-chat-v3-0324:free@Chutes
```

- Performs an end-to-end chat completion call to verify the functional state of a model or a specific provider endpoint.
- Uses a tiny “Ping/Pong” prompt and minimizes completion size for a fast and inexpensive check.
- When a provider is specified (positional or `@` shorthand), the request pins routing order to that provider and disables fallbacks.
- Prints the provider that served the request, token usage, USD cost (unrounded when provided by the API), measured latency, and effective TTL.
- Returns OS exit code `0` on 100% success (zero packet loss) and `1` otherwise, making it suitable for scripting.

Behavior:
- Default timeout: 60s. Change via `--timeout <seconds>`.
- Default ping count: 3. Change via `-n <count>` or `-c <count>`.
- Reasoning minimized by default for low-cost pings (reasoning.effort=low, exclude=true; legacy include_reasoning=false).
- Caps `max_tokens` to 4 for expected “Pong” reply.
- Dynamically formats latency: `<1000ms` prints in `ms`; `>=1s` prints in seconds with two decimals (e.g., `1.63s`).

Options:
- `--timeout <seconds>`: Per-request timeout override (defaults to 60 if missing or invalid).
- `-n <count>`, `-c <count>`: Number of pings to send (defaults to 3).
- `--filthy-rich`: Required if sending more than 10 pings to acknowledge potential API costs.
- `--log-level [CRITICAL|ERROR|WARNING|INFO|DEBUG|NOTSET]`: Set logging level.

Example output:

```

Pinging https://openrouter.ai/api/v1/chat/completions/tngtech/deepseek-r1t2-chimera:free@Chutes with 26 input tokens:
Reply from: https://openrouter.ai/api/v1/chat/completions/tngtech/deepseek-r1t2-chimera:free@Chutes tokens: 4 cost: $0.00 time=2.50s TTL=60s

Pinging https://openrouter.ai/api/v1/chat/completions/tngtech/deepseek-r1t2-chimera:free@Chutes with 26 input tokens:
Reply from: https://openrouter.ai/api/v1/chat/completions/tngtech/deepseek-r1t2-chimera:free@Chutes tokens: 4 cost: $0.00 time=2.30s TTL=60s

Ping statistics for tngtech/deepseek-r1t2-chimera:free@Chutes:
    Packets: Sent = 2, Received = 2, Lost = 0 (0% loss),
Approximate round trip times in seconds:
    Minimum = 2.30s, Maximum = 2.50s, Average = 2.40s
Total API cost for this run: $0.000000

```

Notes:
- Provider pinning uses the OpenRouter provider routing preferences (order, allow_fallbacks=false when a provider is specified). See provider routing docs for details.

> ⚠️ **Warning**
>
> Running `ping` against paid endpoints will make a real completion call and can consume your API credits. It is not a simulated or “no-op” health check. Use with care on metered providers.
>
> Additionally, even when using "free" models, each ping counts against the daily request limit of OpenRouter's free tier. Use with caution, especially if incorporating the command into monitoring scripts or frequent, automated checks.

#### benchmark

```bash
openrouter-inspector benchmark MODEL_ID [PROVIDER_NAME] \
  [--timeout <seconds>] [--max-tokens <limit>] [--format table|json|text] [--min-tps <threshold>] [--debug-response]
```

- Measures model or provider-specific throughput (tokens per second, TPS) by streaming a long response.
- When **`PROVIDER_NAME`** is specified (either as a second positional argument *or* using the shorthand `MODEL_ID@PROVIDER_NAME`), routing is *pinned* to that provider and fallbacks are disabled. If omitted, OpenRouter automatically selects the best provider.
- Supports multiple output modes so you can use it in scripts:
  - `table` (default): Rich table with metrics (Status, Duration, Input/Output/Total tokens, Throughput, Cost). Includes a short “Benchmarking …” preface.
  - `json`: Emits a JSON object with the same metrics as the table.
  - `text`: Emits a single line: `TPS: <value>`.

> ⚠️ **Warning**
>
> `benchmark` sends real chat completion requests and streams long responses. On paid providers this can incur non-trivial costs, especially with larger `--max-tokens` or repeated runs. Even for "free" models, requests may count against rate or daily usage quotas. Use with care, prefer smaller `--max-tokens`, and consider testing on free tiers first.

Options:
- `--timeout <seconds>`: Request timeout (default: 120).
- `--max-tokens <limit>`: Safety cap for generated tokens (default: 3000).
- `--format [table|json|text]`: Output format (default: table).
- `--min-tps <threshold>`: Enforce a minimum TPS threshold (range 1–10000) in `text` mode. Exit code is `1` when measured TPS is lower than threshold, otherwise `0`.
- `--debug-response`: Print streaming chunk JSON for debugging (noisy).

Examples:

```bash
# Human-friendly table for auto-selected provider
openrouter-inspector benchmark google/gemini-2.0-flash-exp:free

# Pin benchmark to a specific provider (positional argument)
openrouter-inspector benchmark google/gemini-2.0-flash-exp:free Chutes

# Same, using @ shorthand
openrouter-inspector benchmark google/gemini-2.0-flash-exp:free@Chutes

# JSON for automation
openrouter-inspector benchmark google/gemini-2.0-flash-exp:free --format json

# Text-only TPS with threshold suitable for CI/monitoring (non-zero exit code on breach)
openrouter-inspector benchmark google/gemini-2.0-flash-exp:free --format text --min-tps 200
```

Scripting/monitoring notes:
- In `text` format with `--min-tps`, the command exits with code `1` if TPS is below the threshold (else `0`). Use this in CI/CD, cron, or health checks.
- In `table`/`json` formats, the exit code reflects execution success, not a threshold check.

### Examples

```bash
# Top-level listing filtered by vendor substring
openrouter-inspector list "google"

# List models with multiple filters (AND logic)
openrouter-inspector list "meta" "free"

# Endpoints with filters and sorting: min quant fp8, min context 128K, sort by price_out desc
openrouter-inspector endpoints deepseek/deepseek-r1 --min-quant fp8 --min-context 128K --sort-by price_out --desc

# Lightweight mode with sorting
openrouter-inspector --list --sort-by name
```

## Notes

- Models are retrieved from `/api/v1/models`. Provider offers per model are retrieved from `/api/v1/models/:author/:slug/endpoints`.
- Supported parameters listed on `/models` are a union across providers. Use `/endpoints` for per-provider truth.
- Some fields may vary by provider (context, pricing, features); the CLI reflects these differences.

## License

MIT License - see LICENSE file for details.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "openrouter-inspector",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": "\"Mateusz B.\" <matdev83@github.com>",
    "keywords": "ai, api, cli, models, openrouter",
    "author": null,
    "author_email": "\"Mateusz B.\" <matdev83@github.com>",
    "download_url": "https://files.pythonhosted.org/packages/a9/ba/b59113cc82dd9e307747f3b83b9e02300f0559192414014d409f53d9adee/openrouter_inspector-0.1.9.tar.gz",
    "platform": null,
    "description": "# OpenRouter Inspector\n\n[![CI](https://github.com/matdev83/openrouter-inspector/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/matdev83/openrouter-inspector/actions/workflows/ci.yml)\n[![codecov](https://codecov.io/gh/matdev83/openrouter-inspector/branch/main/graph/badge.svg)](https://codecov.io/gh/matdev83/openrouter-inspector)\n[![PyPI](https://img.shields.io/pypi/v/openrouter-inspector.svg)](https://pypi.org/project/openrouter-inspector/)\n![Python](https://img.shields.io/badge/python-%3E%3D3.10-blue)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)\n[![security: bandit](https://img.shields.io/badge/security-bandit-yellow.svg)](https://github.com/PyCQA/bandit)\n[![Pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white)](https://github.com/pre-commit/pre-commit)\n[![Tests](https://github.com/matdev83/openrouter-inspector/actions/workflows/tests.yml/badge.svg?branch=main)](https://github.com/matdev83/openrouter-inspector/actions/workflows/tests.yml)\n![Last commit](https://img.shields.io/github/last-commit/matdev83/openrouter-inspector)\n[![Issues](https://img.shields.io/github/issues/matdev83/openrouter-inspector)](https://github.com/matdev83/openrouter-inspector/issues)\n\nA lightweight CLI for exploring OpenRouter AI models, listing provider endpoints with supported model parameters, and benchmarking endpoint latency and throughput.\n\n## Installation\n\n### Requirements\n\n- Python 3.10+\n\n### From PyPI (recommended)\n\n- With pipx (recommended for CLIs):\n  ```bash\n  pipx install openrouter-inspector\n  ```\n- Or with pip into your active environment:\n  ```bash\n  pip install openrouter-inspector\n  ```\n\n### From source (development)\n\n- Install from a clone:\n  ```bash\n  pip install .\n  ```\n- Editable/development install:\n  ```bash\n  pip install -e .\n  ```\n\n### Contributing / Development\n\nIf you want to hack on the project (dev setup, tests, QA, pre-commit, etc.), see\nthe dedicated contributor guide:\n\n[CONTRIBUTING.md](CONTRIBUTING.md)\n\n## Features\n\n- Explore available models and provider-specific endpoints from OpenRouter.\n- Rich table output with pricing per 1M tokens and optional provider counts.\n- Change detection for new models and pricing changes between runs.\n- JSON output for easy scripting.\n\n## Usage\n\nThe CLI supports both subcommands and lightweight global flags.\n\n### Authentication\n\nSet your OpenRouter API key via environment variable (required):\n\n```bash\nexport OPENROUTER_API_KEY=sk-or-...\n```\n\nFor security, the CLI does not accept API keys via command-line flags. It reads the key only from the `OPENROUTER_API_KEY` environment variable. If the key is missing or invalid, the CLI shows a friendly error and exits.\n\n### Quick starts\n\nSubcommands:\n\n```bash\n# List all models\nopenrouter-inspector list\n\n# List models filtered by substring (matches id or display name)\nopenrouter-inspector list openai\n\n# List models with multiple filters (AND logic)\nopenrouter-inspector list meta free\n\n# Or just type your search terms; default action is `list`\nopenrouter-inspector gemini-2.0 free\n\n# Detailed provider endpoints (exact model id)\nopenrouter-inspector endpoints deepseek/deepseek-r1\n\n# To check the endpoint health and latency\nopenrouter-inspector ping google/gemini-2.0-flash-exp:free\n```\n\n \n\n### Commands\n\n#### list\n\n```bash\nopenrouter-inspector list [filters...] [--with-providers] [--sort-by id|name|context|providers] [--desc] [--format table|json|yaml]\n```\n\n- Displays all available models with enhanced table output (Name, ID, Context, Input/Output pricing).\n- Optional positional `filters` performs case-insensitive substring matches against model id and name using AND logic.\n- Context values are displayed with K suffix (e.g., 128K).\n- Input/Output prices are shown per million tokens in USD.\n- **Change Detection**: Automatically detects new models and pricing changes compared to previous runs with the same parameters. New models are shown in a separate table, and pricing changes are highlighted in yellow.\n\nOptions:\n- `--format [table|json|yaml]` (default: table)\n- `--with-providers` add a Providers column (makes extra API calls per model)\n- `--sort-by [id|name|context|providers]` (default: id)\n- `--desc` sort descending\n\n#### endpoints\n\n```bash\nopenrouter-inspector endpoints MODEL_ID [--min-quant VALUE] [--min-context VALUE] [--sort-by provider|model|quant|context|maxout|price_in|price_out] [--desc] [--per-1m] [--format table|json|yaml]\n```\n\nShows detailed provider offers for an exact model id (`author/slug`), with:\n- Provider, Model (provider endpoint name), Reason (+/-), Quant, Context (K), Max Out (K), Input/Output price (USD/1M)\n\nBehavior:\n- Fails if model id does not match an exact existing model or returns no offers.\n\nFilters and sorting:\n- `--min-quant VALUE` minimum quantization (e.g., fp8). Unspecified quant (\u201c\u2014\u201d) is included as best.\n- `--min-context VALUE` minimum context window (e.g., `128K` or `131072`).\n- `--sort-by [provider|model|quant|context|maxout|price_in|price_out]` (default: provider)\n- `--desc` sort descending\n\n#### check\n\n```bash\nopenrouter-inspector check MODEL_ID PROVIDER_NAME ENDPOINT_NAME\n```\n\nChecks a specific provider endpoint's health using OpenRouter API status. Web-scraped metrics have been removed.\n\nBehavior:\n- Returns one of: `Functional`, `Disabled`.\n- If API indicates provider is offline/disabled or not available \u2192 `Disabled`.\n- Otherwise \u2192 `Functional`.\n\nOptions:\n- `--log-level [CRITICAL|ERROR|WARNING|INFO|DEBUG|NOTSET]` set logging level\n\n#### ping\n\n```bash\nopenrouter-inspector ping MODEL_ID [PROVIDER_NAME]\nopenrouter-inspector ping MODEL_ID@PROVIDER_NAME\n\n# Examples\nopenrouter-inspector ping openai/o4-mini\nopenrouter-inspector ping deepseek/deepseek-chat-v3-0324:free Chutes\nopenrouter-inspector ping deepseek/deepseek-chat-v3-0324:free@Chutes\n```\n\n- Performs an end-to-end chat completion call to verify the functional state of a model or a specific provider endpoint.\n- Uses a tiny \u201cPing/Pong\u201d prompt and minimizes completion size for a fast and inexpensive check.\n- When a provider is specified (positional or `@` shorthand), the request pins routing order to that provider and disables fallbacks.\n- Prints the provider that served the request, token usage, USD cost (unrounded when provided by the API), measured latency, and effective TTL.\n- Returns OS exit code `0` on 100% success (zero packet loss) and `1` otherwise, making it suitable for scripting.\n\nBehavior:\n- Default timeout: 60s. Change via `--timeout <seconds>`.\n- Default ping count: 3. Change via `-n <count>` or `-c <count>`.\n- Reasoning minimized by default for low-cost pings (reasoning.effort=low, exclude=true; legacy include_reasoning=false).\n- Caps `max_tokens` to 4 for expected \u201cPong\u201d reply.\n- Dynamically formats latency: `<1000ms` prints in `ms`; `>=1s` prints in seconds with two decimals (e.g., `1.63s`).\n\nOptions:\n- `--timeout <seconds>`: Per-request timeout override (defaults to 60 if missing or invalid).\n- `-n <count>`, `-c <count>`: Number of pings to send (defaults to 3).\n- `--filthy-rich`: Required if sending more than 10 pings to acknowledge potential API costs.\n- `--log-level [CRITICAL|ERROR|WARNING|INFO|DEBUG|NOTSET]`: Set logging level.\n\nExample output:\n\n```\n\nPinging https://openrouter.ai/api/v1/chat/completions/tngtech/deepseek-r1t2-chimera:free@Chutes with 26 input tokens:\nReply from: https://openrouter.ai/api/v1/chat/completions/tngtech/deepseek-r1t2-chimera:free@Chutes tokens: 4 cost: $0.00 time=2.50s TTL=60s\n\nPinging https://openrouter.ai/api/v1/chat/completions/tngtech/deepseek-r1t2-chimera:free@Chutes with 26 input tokens:\nReply from: https://openrouter.ai/api/v1/chat/completions/tngtech/deepseek-r1t2-chimera:free@Chutes tokens: 4 cost: $0.00 time=2.30s TTL=60s\n\nPing statistics for tngtech/deepseek-r1t2-chimera:free@Chutes:\n    Packets: Sent = 2, Received = 2, Lost = 0 (0% loss),\nApproximate round trip times in seconds:\n    Minimum = 2.30s, Maximum = 2.50s, Average = 2.40s\nTotal API cost for this run: $0.000000\n\n```\n\nNotes:\n- Provider pinning uses the OpenRouter provider routing preferences (order, allow_fallbacks=false when a provider is specified). See provider routing docs for details.\n\n> \u26a0\ufe0f **Warning**\n>\n> Running `ping` against paid endpoints will make a real completion call and can consume your API credits. It is not a simulated or \u201cno-op\u201d health check. Use with care on metered providers.\n>\n> Additionally, even when using \"free\" models, each ping counts against the daily request limit of OpenRouter's free tier. Use with caution, especially if incorporating the command into monitoring scripts or frequent, automated checks.\n\n#### benchmark\n\n```bash\nopenrouter-inspector benchmark MODEL_ID [PROVIDER_NAME] \\\n  [--timeout <seconds>] [--max-tokens <limit>] [--format table|json|text] [--min-tps <threshold>] [--debug-response]\n```\n\n- Measures model or provider-specific throughput (tokens per second, TPS) by streaming a long response.\n- When **`PROVIDER_NAME`** is specified (either as a second positional argument *or* using the shorthand `MODEL_ID@PROVIDER_NAME`), routing is *pinned* to that provider and fallbacks are disabled. If omitted, OpenRouter automatically selects the best provider.\n- Supports multiple output modes so you can use it in scripts:\n  - `table` (default): Rich table with metrics (Status, Duration, Input/Output/Total tokens, Throughput, Cost). Includes a short \u201cBenchmarking \u2026\u201d preface.\n  - `json`: Emits a JSON object with the same metrics as the table.\n  - `text`: Emits a single line: `TPS: <value>`.\n\n> \u26a0\ufe0f **Warning**\n>\n> `benchmark` sends real chat completion requests and streams long responses. On paid providers this can incur non-trivial costs, especially with larger `--max-tokens` or repeated runs. Even for \"free\" models, requests may count against rate or daily usage quotas. Use with care, prefer smaller `--max-tokens`, and consider testing on free tiers first.\n\nOptions:\n- `--timeout <seconds>`: Request timeout (default: 120).\n- `--max-tokens <limit>`: Safety cap for generated tokens (default: 3000).\n- `--format [table|json|text]`: Output format (default: table).\n- `--min-tps <threshold>`: Enforce a minimum TPS threshold (range 1\u201310000) in `text` mode. Exit code is `1` when measured TPS is lower than threshold, otherwise `0`.\n- `--debug-response`: Print streaming chunk JSON for debugging (noisy).\n\nExamples:\n\n```bash\n# Human-friendly table for auto-selected provider\nopenrouter-inspector benchmark google/gemini-2.0-flash-exp:free\n\n# Pin benchmark to a specific provider (positional argument)\nopenrouter-inspector benchmark google/gemini-2.0-flash-exp:free Chutes\n\n# Same, using @ shorthand\nopenrouter-inspector benchmark google/gemini-2.0-flash-exp:free@Chutes\n\n# JSON for automation\nopenrouter-inspector benchmark google/gemini-2.0-flash-exp:free --format json\n\n# Text-only TPS with threshold suitable for CI/monitoring (non-zero exit code on breach)\nopenrouter-inspector benchmark google/gemini-2.0-flash-exp:free --format text --min-tps 200\n```\n\nScripting/monitoring notes:\n- In `text` format with `--min-tps`, the command exits with code `1` if TPS is below the threshold (else `0`). Use this in CI/CD, cron, or health checks.\n- In `table`/`json` formats, the exit code reflects execution success, not a threshold check.\n\n### Examples\n\n```bash\n# Top-level listing filtered by vendor substring\nopenrouter-inspector list \"google\"\n\n# List models with multiple filters (AND logic)\nopenrouter-inspector list \"meta\" \"free\"\n\n# Endpoints with filters and sorting: min quant fp8, min context 128K, sort by price_out desc\nopenrouter-inspector endpoints deepseek/deepseek-r1 --min-quant fp8 --min-context 128K --sort-by price_out --desc\n\n# Lightweight mode with sorting\nopenrouter-inspector --list --sort-by name\n```\n\n## Notes\n\n- Models are retrieved from `/api/v1/models`. Provider offers per model are retrieved from `/api/v1/models/:author/:slug/endpoints`.\n- Supported parameters listed on `/models` are a union across providers. Use `/endpoints` for per-provider truth.\n- Some fields may vary by provider (context, pricing, features); the CLI reflects these differences.\n\n## License\n\nMIT License - see LICENSE file for details.\n",
    "bugtrack_url": null,
    "license": "MIT License\n        \n        Copyright (c) 2024 OpenRouter CLI Team\n        \n        Permission is hereby granted, free of charge, to any person obtaining a copy\n        of this software and associated documentation files (the \"Software\"), to deal\n        in the Software without restriction, including without limitation the rights\n        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n        copies of the Software, and to permit persons to whom the Software is\n        furnished to do so, subject to the following conditions:\n        \n        The above copyright notice and this permission notice shall be included in all\n        copies or substantial portions of the Software.\n        \n        THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n        SOFTWARE.",
    "summary": "A command-line tool for querying OpenRouter AI models and providers",
    "version": "0.1.9",
    "project_urls": {
        "Bug Tracker": "https://github.com/matdev83/openrouter-inspector/issues",
        "Documentation": "https://github.com/matdev83/openrouter-inspector#readme",
        "Homepage": "https://github.com/matdev83/openrouter-inspector/",
        "Repository": "https://github.com/matdev83/openrouter-inspector/"
    },
    "split_keywords": [
        "ai",
        " api",
        " cli",
        " models",
        " openrouter"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "24d70f11aabe9cfc8819922d11f0e12e828f11cd2cf73cf197c1380d00ab9b64",
                "md5": "1d71ba646d803768f4ca588e026ee586",
                "sha256": "0af2bb06a02c9adbc501143286b8c0294d6513ab36555769606be780b9244a30"
            },
            "downloads": -1,
            "filename": "openrouter_inspector-0.1.9-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "1d71ba646d803768f4ca588e026ee586",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 53115,
            "upload_time": "2025-08-13T23:55:26",
            "upload_time_iso_8601": "2025-08-13T23:55:26.107182Z",
            "url": "https://files.pythonhosted.org/packages/24/d7/0f11aabe9cfc8819922d11f0e12e828f11cd2cf73cf197c1380d00ab9b64/openrouter_inspector-0.1.9-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "a9bab59113cc82dd9e307747f3b83b9e02300f0559192414014d409f53d9adee",
                "md5": "1e6ec1d652eb5c641b03233f131cd07a",
                "sha256": "2108619f1e2f77e97744a9a54aa8857a6fd910d9aad55b8977640ef153b965bb"
            },
            "downloads": -1,
            "filename": "openrouter_inspector-0.1.9.tar.gz",
            "has_sig": false,
            "md5_digest": "1e6ec1d652eb5c641b03233f131cd07a",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 80261,
            "upload_time": "2025-08-13T23:55:27",
            "upload_time_iso_8601": "2025-08-13T23:55:27.461948Z",
            "url": "https://files.pythonhosted.org/packages/a9/ba/b59113cc82dd9e307747f3b83b9e02300f0559192414014d409f53d9adee/openrouter_inspector-0.1.9.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-08-13 23:55:27",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "matdev83",
    "github_project": "openrouter-inspector",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "openrouter-inspector"
}
        
Elapsed time: 1.24638s