concentrate

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package concentrate holds shared constants and pricing-cache helpers for the Concentrate AI Responses API gateway (https://concentrate.ai).

Index

Constants

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

DefaultBaseURL is the Concentrate AI API root.

Variables

This section is empty.

Functions

func ResetCache

func ResetCache()

ResetCache clears the pricing cache. For testing only.

func SetPricing

func SetPricing(modelID string, entry PricingCacheEntry)

SetPricing stores pricing for a model in the cache.

Types

type PricingCacheEntry

type PricingCacheEntry struct {
	// InputPrice is the per-token input price in USD.
	InputPrice float64 `json:"input_price"`
	// OutputPrice is the per-token output price in USD.
	OutputPrice float64 `json:"output_price"`
	// ReasoningPrice is the per-token reasoning price in USD (0 if not separate).
	ReasoningPrice float64 `json:"reasoning_price,omitempty"`
	// TierThreshold is the token count at which tiered pricing kicks in (0 if no tiers).
	TierThreshold int `json:"tier_threshold,omitempty"`
	// TieredInputPrice is the per-token input price above the threshold.
	TieredInputPrice float64 `json:"tiered_input_price,omitempty"`
	// TieredOutputPrice is the per-token output price above the threshold.
	TieredOutputPrice float64 `json:"tiered_output_price,omitempty"`
	// CachedAt is when this entry was cached.
	CachedAt time.Time `json:"cached_at"`
}

PricingCacheEntry holds all pricing data for a model, including reasoning and tiered pricing.

func GetPricing

func GetPricing(modelID string) (entry PricingCacheEntry, ok bool)

GetPricing looks up cached pricing for a model. Returns ok=false if not found or expired.

Jump to

Keyboard shortcuts

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