openrouter

package
v0.9.29 Latest Latest
Warning

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

Go to latest
Published: May 2, 2026 License: MIT Imports: 12 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
}

Jump to

Keyboard shortcuts

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