pricing

package
v0.3.9 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2026 License: MIT Imports: 0 Imported by: 0 modules, 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 pricing 按 Gemini API 与 Vertex AI 公布的当前文本单价估算请求费用

Index

Constants

View Source
const LongContext = 200_000

LongContext 是长上下文分档的输入 token 界限,输入超过该值的请求按长上下文单价计费

Variables

This section is empty.

Functions

func Cost

func Cost(model string, input, cached, output int64) float64

Cost 返回一个请求按模型单价估算的美元费用,cached 为 input 中命中缓存的部分,output 为思考与回复 token 之和,模型没有单价时为 0

func Priced added in v0.2.11

func Priced(model string) bool

Priced 返回模型是否有单价

func TierCost added in v0.3.8

func TierCost(model string, long bool, input, cached, output int64) float64

TierCost 返回一组同模型同分档请求的美元费用,long 表示这些请求的输入都超过 LongContext,token 为各请求之和

Types

This section is empty.

Jump to

Keyboard shortcuts

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