orter
Typer-based CLI tool that uses OpenRouter API.
Installation
uvx orter
Usage
Environment Variable Setup
You can set the OPENROUTER_API_KEY environment variable, or use the --api-key option with each command.
Models
List available models.
# Default output: human-readable table + default limit(20)
uv run orter models
uv run orter models list --limit 20
# Search
uv run orter models --search gpt-4o --limit 20
# Output in JSON format
uv run orter models --json
# Get specific model information
uv run orter models get openai/gpt-4o-mini
Chat Completions
Send chat completion requests.
# Basic usage (recommended)
uv run orter chat completions -m "Hello"
# Specify model
uv run orter chat completions -m "Print Hello World in Python" --model "openai/gpt-4o"
# Enable streaming
uv run orter chat completions -m "Write a simple story" --stream
# Include system message
uv run orter chat completions -m "User message" --system "You are a helpful AI assistant."
# Output in JSON format
uv run orter chat completions -m "Hello" --json
# Using additional parameters
uv run orter chat completions -m "Write a creative story" \
--temperature 0.9 \
--max-tokens 500 \
--model "openai/gpt-4o-mini"
Generation
Query generation statistics.
# Get generation statistics (using id from chat completions response)
uv run orter generation get gen-xxxxxxxxxxxxxx
# Output in JSON format
uv run orter generation get gen-xxxxxxxxxxxxxx --json
Raw (full API access)
uv run orter raw request GET api/v1/models
uv run orter raw request POST api/v1/chat/completions \
--body '{"model":"openai/gpt-4o-mini","messages":[{"role":"user","content":"hi"}]}'
Key Features
- Chat Completions API support
- Streaming support
- Models API support
- Generation statistics lookup
- Call any endpoint with raw (full API access)
- JSON output option
- Type safety guarantee
Examples
Simple Question
uv run orter chat completions -m "What are the advantages of Python?"
Code Generation
uv run orter chat completions -m "Create a simple calculator function in Python" \
--model "openai/gpt-4o-mini" \
--temperature 0.7
Streaming Response
uv run orter chat completions -m "Write a long story" --stream
License
MIT
Documentation References
- https://openrouter.ai/docs/api/api-reference/responses/create-responses.md
- https://openrouter.ai/docs/api/api-reference/o-auth/exchange-auth-code-for-api-key.md
- https://openrouter.ai/docs/api/api-reference/o-auth/create-auth-keys-code.md
- https://openrouter.ai/docs/api/api-reference/analytics/get-user-activity.md
- https://openrouter.ai/docs/api/api-reference/credits/get-credits.md
- https://openrouter.ai/docs/api/api-reference/credits/create-coinbase-charge.md
- https://openrouter.ai/docs/api/api-reference/embeddings/create-embeddings.md
- https://openrouter.ai/docs/api/api-reference/embeddings/list-embeddings-models.md
- https://openrouter.ai/docs/api/api-reference/generations/get-generation.md
- https://openrouter.ai/docs/api/api-reference/models/list-models-count.md
- https://openrouter.ai/docs/api/api-reference/models/get-models.md
- https://openrouter.ai/docs/api/api-reference/models/list-models-user.md
- https://openrouter.ai/docs/api/api-reference/endpoints/list-endpoints.md
- https://openrouter.ai/docs/api/api-reference/endpoints/list-endpoints-zdr.md
- https://openrouter.ai/docs/api/api-reference/parameters/get-parameters.md
- https://openrouter.ai/docs/api/api-reference/providers/list-providers.md
- https://openrouter.ai/docs/api/api-reference/api-keys/list.md
- https://openrouter.ai/docs/api/api-reference/api-keys/create-keys.md
- https://openrouter.ai/docs/api/api-reference/api-keys/get-key.md
- https://openrouter.ai/docs/api/api-reference/api-keys/delete-keys.md
- https://openrouter.ai/docs/api/api-reference/api-keys/update-keys.md
- https://openrouter.ai/docs/api/api-reference/api-keys/get-current-key.md
- https://openrouter.ai/docs/api/api-reference/chat/send-chat-completion-request.md
- https://openrouter.ai/docs/api/api-reference/completions/create-completions.md
Metadata
Release files for orter 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| orter-0.1.0.tar.gz | 23.3 kB | Without provenance | Details for orter-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| orter-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for orter-0.1.0-py3-none-any.whl |
Total release size: 56.1 kB
Release files / orter-0.1.0.tar.gz
| Download URL | orter-0.1.0.tar.gz |
|---|---|
| Size | 23.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8bcf331527f972e84968e84d1eb52f73a25dc89d58e3eeae9fde84a1b5f4844f
|
|
BLAKE2b-256 checksum How to use checksums |
1eb048cfe792630fbc6dd23cbd3bea3f8c8cd316805c800c3dae00b89ca4f3ff
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.9.5
|
Release files / orter-0.1.0-py3-none-any.whl
| Download URL | orter-0.1.0-py3-none-any.whl |
|---|---|
| Size | 32.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
626d580a4dc0ceba86ae467253ea003852624448f52452b4484409988db9faf5
|
|
BLAKE2b-256 checksum How to use checksums |
ef1280b6d8817123112ef9121d570c5902d243cb3e0ab72a66caf43303e77b6f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.9.5
|
Security for orter 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.