openrouter

package
v0.2.64 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 25, 2026 License: MPL-2.0 Imports: 10 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package openrouter is the v1 ai://chat backend.

It speaks the OpenAI-compatible chat-completions API to OpenRouter's public endpoint (https://openrouter.ai/api/v1/chat/completions), which proxies to dozens of upstream model providers. One backend, many models — a deliberately conservative v1 choice (the spec's "boring foundation").

The backend self-registers in init() under the name "openrouter". The chassis activates it with a blank import in the main package.

**Leak posture.** The cleartext API key (OPENROUTER_KEY) is read from the secrets.SecretBag exactly once per Run, passed into the outbound http.Request's Authorization header, and never stored on the backend struct, never written to a trace field, never logged. A 401 response body is discarded immediately — providers occasionally quote a prefix of the submitted key in error messages, and that prefix would otherwise reach the response envelope and trace.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL