openrouter

package
v0.10.5 Latest Latest
Warning

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

Go to latest
Published: May 4, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultBaseURL = "https://openrouter.ai/api/v1"

Variables

View Source
var ProtocolCapabilities = openai.ProtocolCapabilities{
	Tools:            true,
	Stream:           true,
	StructuredOutput: true,
	Thinking:         true,
	ThinkingFormat:   openai.ThinkingWireFormatOpenRouter,
}

Functions

func LookupModelLimits

func LookupModelLimits(ctx context.Context, baseURL, apiKey string, headers map[string]string, model string) limits.ModelLimits

func New

func New(cfg Config) *openai.Provider

func UsageCostAttribution

func UsageCostAttribution(rawUsage string) (*agent.CostAttribution, bool)

Types

type Config

type Config struct {
	BaseURL             string
	APIKey              string
	Model               string
	ModelPattern        string
	KnownModels         map[string]string
	Headers             map[string]string
	Reasoning           reasoning.Reasoning
	ModelReasoningWire  map[string]string
	QuotaSignalObserver func(quotaheaders.Signal)
}

Jump to

Keyboard shortcuts

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