Documentation
¶
Overview ¶
Package modellink downloads, verifies, caches and parses the versioned ModelLink catalog for Go applications.
The zero-value Options use the domestic npmmirror registry and a shared, cross-platform file cache:
client, err := modellink.New(modellink.Options{})
snapshot, err := client.Load(ctx)
model, ok := snapshot.ProviderModel("deepseek", "deepseek-v4-pro")
Load prefers the active verified cache and only calls LoadLatest when no usable cache exists. LoadCached never accesses the registry; LoadLatest always checks it and prevents automatic downgrade. LoadVersion reads an explicit version without activating it, while SwitchVersion deliberately changes the active version. Use NewFileCache to customize local retention, or implement Cache to connect Redis or another shared backend. Compatibility warnings are available from Snapshot.Warnings and Options.OnWarning. Status reads persistent check and activation history from the cache. FindLatest and CheckLatest persist successful checks without activating data. Options.OnOperation optionally receives exclusive stage timings.
Index ¶
- Constants
- Variables
- func Schema() []byte
- type AnthropicUsage
- type Cache
- type CacheEntry
- type CachePruner
- type CacheState
- type CacheStore
- type Catalog
- type CheckState
- type Client
- func (client *Client) ActivateVersion(ctx context.Context, version string) (err error)
- func (client *Client) CheckLatest(ctx context.Context) (status UpdateStatus, err error)
- func (client *Client) CurrentVersion(ctx context.Context) (versionResult string, err error)
- func (client *Client) FindLatest(ctx context.Context) (versionResult string, err error)
- func (client *Client) Load(ctx context.Context) (result *Snapshot, err error)
- func (client *Client) LoadCached(ctx context.Context) (result *Snapshot, err error)
- func (client *Client) LoadLatest(ctx context.Context) (result *Snapshot, err error)
- func (client *Client) LoadVersion(ctx context.Context, version string) (result *Snapshot, err error)
- func (client *Client) Status(ctx context.Context) (state CacheState, err error)
- func (client *Client) SwitchVersion(ctx context.Context, version string) (err error)
- type CostCurrency
- type CostQuery
- type CostResult
- type CostUsage
- type DataFile
- type FileCache
- func (cache *FileCache) Current(ctx context.Context) (string, error)
- func (cache *FileCache) Directory() string
- func (cache *FileCache) Get(ctx context.Context, version string) (*CacheEntry, error)
- func (cache *FileCache) Lock(ctx context.Context, key string) (Lock, error)
- func (cache *FileCache) Prune(ctx context.Context, protected ...string) error
- func (cache *FileCache) Put(ctx context.Context, entry *CacheEntry) error
- func (cache *FileCache) RecordCheck(ctx context.Context, check CheckState) error
- func (cache *FileCache) SetCurrent(ctx context.Context, version string) error
- func (cache *FileCache) State(ctx context.Context) (CacheState, error)
- type FileCacheOptions
- type Interleaved
- type JSONValue
- type Lock
- type Locker
- type Manifest
- type ManifestFile
- type ManifestFiles
- type ManifestSource
- type ModelMetadata
- type ModelMetadataBenchmarksElem
- type ModelMetadataFamily
- type ModelMetadataLimit
- type ModelMetadataLinksElem
- type ModelMetadataLinksElemType
- type ModelMetadataModalities
- type ModelMetadataModalitiesInputElem
- type ModelMetadataModalitiesOutputElem
- type ModelMetadataWeightsElem
- type Models
- type OpenAIChatUsage
- type OpenAIResponsesUsage
- type Operation
- type OperationReport
- type Options
- type Protocol
- type Provider
- type ProviderCreditPackagesCNElem
- type ProviderCreditsCN
- type ProviderEndpoint
- type ProviderLinks
- type ProviderModel
- type ProviderModelCost
- type ProviderModelCostCN
- type ProviderModelCostCNContextOver200K
- type ProviderModelCostCNContextOver200KThinking
- type ProviderModelCostCNThinking
- type ProviderModelCostCNTiersElem
- type ProviderModelCostCNTiersElemThinking
- type ProviderModelCostCNTiersElemWhen
- type ProviderModelCostCNTiersElemWhen_0
- type ProviderModelCostCNTiersElemWhen_1
- type ProviderModelCostCNTiersElemWhen_1Date
- type ProviderModelCostCNTiersElemWhen_1Input
- type ProviderModelCostCNTiersElemWhen_1Output
- type ProviderModelCostCNTiersElemWhen_1Time
- type ProviderModelCostCNTiersElemWhen_1TimeWindowsElem
- type ProviderModelCostCNTiersElemWhen_1TimeWindowsElemDaysElem
- type ProviderModelCostContextOver200K
- type ProviderModelCostPoints
- type ProviderModelCostPointsTiersElem
- type ProviderModelCostPointsTiersElemWhen
- type ProviderModelCostPointsTiersElemWhen_0
- type ProviderModelCostPointsTiersElemWhen_1
- type ProviderModelCostPointsTiersElemWhen_1Date
- type ProviderModelCostPointsTiersElemWhen_1Input
- type ProviderModelCostPointsTiersElemWhen_1Output
- type ProviderModelCostPointsTiersElemWhen_1Time
- type ProviderModelCostPointsTiersElemWhen_1TimeWindowsElem
- type ProviderModelCostPointsTiersElemWhen_1TimeWindowsElemDaysElem
- type ProviderModelCostTiersElem
- type ProviderModelCostTiersElemWhen
- type ProviderModelCostTiersElemWhen_0
- type ProviderModelCostTiersElemWhen_1
- type ProviderModelCostTiersElemWhen_1Date
- type ProviderModelCostTiersElemWhen_1Input
- type ProviderModelCostTiersElemWhen_1Output
- type ProviderModelCostTiersElemWhen_1Time
- type ProviderModelCostTiersElemWhen_1TimeWindowsElem
- type ProviderModelCostTiersElemWhen_1TimeWindowsElemDaysElem
- type ProviderModelExperimental
- type ProviderModelExperimentalModes
- type ProviderModelExperimentalModesValueCost
- type ProviderModelExperimentalModesValueCostCN
- type ProviderModelExperimentalModesValueProvider
- type ProviderModelExperimentalModesValueProviderBody
- type ProviderModelExperimentalModesValueProviderHeaders
- type ProviderModelFamily
- type ProviderModelInterleaved_1
- type ProviderModelInterleaved_1Field
- type ProviderModelLimit
- type ProviderModelModalities
- type ProviderModelModalitiesInputElem
- type ProviderModelModalitiesOutputElem
- type ProviderModelProvider
- type ProviderModelProviderBody
- type ProviderModelProviderHeaders
- type ProviderModelProviderShape
- type ProviderModelStatus
- type ProviderModels
- type ProviderPlansCNElem
- type ProviderProtocol
- type Providers
- type RawUsage
- type ReasoningOption
- type ReasoningOption_0
- type ReasoningOption_1
- type ReasoningOption_1Default_0
- type ReasoningOption_1ValuesElem_0
- type ReasoningOption_2
- type SchemaMetadata
- type Snapshot
- func (snapshot *Snapshot) Cost(query CostQuery) (CostResult, bool, error)
- func (snapshot *Snapshot) File(name DataFile) ([]byte, bool)
- func (snapshot *Snapshot) Model(id string) (ModelMetadata, bool)
- func (snapshot *Snapshot) Provider(id string) (Provider, bool)
- func (snapshot *Snapshot) ProviderModel(providerID string, modelID string) (ProviderModel, bool)
- func (snapshot *Snapshot) Schema() []byte
- func (snapshot *Snapshot) Warnings() []Warning
- type Stage
- type StageReport
- type UpdateState
- type UpdateStatus
- type Warning
- type WarningCode
Constants ¶
const SupportedSchemaVersion = 3
Variables ¶
Functions ¶
Types ¶
type AnthropicUsage ¶ added in v0.5.0
type AnthropicUsage struct {
InputTokens int64 `json:"input_tokens"`
CacheCreationInputTokens int64 `json:"cache_creation_input_tokens"`
CacheReadInputTokens int64 `json:"cache_read_input_tokens"`
OutputTokens int64 `json:"output_tokens"`
}
AnthropicUsage mirrors the usage object of the Anthropic Messages API. InputTokens excludes cached input; cache reads and writes are separate.
func (*AnthropicUsage) UnmarshalJSON ¶ added in v0.5.0
func (usage *AnthropicUsage) UnmarshalJSON(data []byte) error
UnmarshalJSON accepts the official Messages usage object.
type Cache ¶
type Cache interface {
CacheStore
Locker
}
Cache combines storage and update coordination. Most users only configure this interface; the smaller interfaces allow advanced backend composition.
type CacheEntry ¶
CacheEntry is one immutable, versioned ModelLink data package. Files contain the verified JSON bytes published in @modellink/data.
type CachePruner ¶
CachePruner is an optional cache capability used after successful package operations. Custom caches may omit it and manage retention independently.
type CacheState ¶ added in v0.3.0
type CacheState struct {
// Version is the shared active pointer, not the version of an application's
// previously loaded Snapshot. Empty means no version has been activated.
Version string `json:"version,omitempty"`
LastCheck *CheckState `json:"last_check,omitempty"`
LastUpdate *UpdateState `json:"last_update,omitempty"`
}
CacheState survives process restarts. Nil records mean no known event. Version uses the legacy current.json field for backwards-readable storage.
type CacheStore ¶
type CacheStore interface {
Current(ctx context.Context) (string, error)
Get(ctx context.Context, version string) (*CacheEntry, error)
Put(ctx context.Context, entry *CacheEntry) error
// SetCurrent must atomically update Version and LastUpdate, preserving
// LastCheck. Same-version activation must preserve LastUpdate. Implementations
// coordinate metadata writes internally (callers can hold version locks).
SetCurrent(ctx context.Context, version string) error
// State returns durable metadata; a new cache returns an empty state.
State(ctx context.Context) (CacheState, error)
// RecordCheck merges a successful latest lookup without overwriting activation.
// Older CheckedAt values must not replace newer records.
RecordCheck(ctx context.Context, check CheckState) error
}
CacheStore persists versioned packages and the currently active version. Put must publish an entry atomically: readers must never observe partial data.
type CheckState ¶ added in v0.3.0
type CheckState struct {
// CheckedAt is the UTC time of a successful latest lookup, even if unchanged.
CheckedAt time.Time `json:"checked_at"`
// LatestVersion is what Registry returned at CheckedAt, not a live value.
LatestVersion string `json:"latest_version"`
Registry string `json:"registry"`
}
CheckState records a successful latest lookup, not a successful download.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client loads verified, versioned ModelLink snapshots.
func (*Client) ActivateVersion ¶
ActivateVersion makes an already cached version active without accessing the registry. It returns ErrNoCachedData when that version is not cached.
func (*Client) CheckLatest ¶
func (client *Client) CheckLatest(ctx context.Context) (status UpdateStatus, err error)
CheckLatest compares the active local version with the registry latest version without downloading data or activating a version. Successful checks are persisted in cache metadata.
func (*Client) CurrentVersion ¶
CurrentVersion returns the active local version without accessing the registry. It returns ErrNoCachedData when no version has been activated.
func (*Client) FindLatest ¶
FindLatest queries the registry for its latest package version. It does not download data or change the active version. It persists a successful check.
func (*Client) Load ¶
Load returns the active verified cache without checking the registry. When no valid cache is available, it blocks while loading the safe latest version.
func (*Client) LoadCached ¶
LoadCached returns the active verified local snapshot without accessing the registry. It returns ErrNoCachedData when no version has been activated.
func (*Client) LoadLatest ¶
LoadLatest checks the registry, prevents automatic downgrade, activates the safe latest version and returns the active verified snapshot.
func (*Client) LoadVersion ¶
func (client *Client) LoadVersion(ctx context.Context, version string) (result *Snapshot, err error)
LoadVersion returns a verified explicit version without changing the active version. It downloads and caches the version when necessary.
type CostCurrency ¶ added in v0.5.0
type CostCurrency string
CostCurrency identifies the unit a CostResult is expressed in.
const ( // CostCNY means the result is in Chinese yuan per the cost_cn field. CostCNY CostCurrency = "CNY" // CostPoints means the result is in plan points per cost_points. CostPoints CostCurrency = "POINTS" // CostUSD means the result is in US dollars per the cost field. CostUSD CostCurrency = "USD" )
type CostQuery ¶ added in v0.5.0
type CostQuery struct {
Provider string
Model string
// Usage carries the provider-reported usage. Pick the type matching the
// protocol of the request.
Usage CostUsage
// Thinking selects the dedicated thinking-mode prices (cost_cn.thinking)
// when the selected tier declares them.
Thinking bool
// At is the billing moment for time-window tiers, interpreted in the
// timezone declared by the data. Providers bill by server receive time, so
// pass that moment when available. Required whenever a matching price has
// time-window tiers.
At time.Time
// IsCNStatutoryHoliday reports whether a calendar day in the declared
// timezone is a Chinese statutory holiday. It is required when a matching
// price window excludes holidays (holiday = "exclude_cn_statutory"); without
// it the price is unknown and Cost returns an error instead of guessing.
IsCNStatutoryHoliday func(day time.Time) (bool, error)
}
CostQuery describes one billable request.
type CostResult ¶ added in v0.5.0
type CostResult struct {
// Currency is CNY, POINTS or USD.
Currency CostCurrency
// Total is the full price of the request in the currency above.
Total float64
// InputCost covers uncached input tokens.
InputCost float64
// CachedInputCost covers cache-hit input tokens.
CachedInputCost float64
// CacheWriteCost covers cache-write input tokens when the data prices them.
CacheWriteCost float64
// OutputCost covers generated tokens, including any separately priced
// reasoning tokens.
OutputCost float64
// TierLabel names the matched tier, or the top-level fallback label such
// as 闲时. Empty when the data has no label.
TierLabel string
// PerTokens is the token unit the prices refer to: 1,000,000 for CNY and
// USD prices, or the per_tokens declared by cost_points.
PerTokens int64
}
CostResult is the computed price of one request.
type CostUsage ¶ added in v0.5.0
type CostUsage interface {
// contains filtered or unexported methods
}
CostUsage is the usage of one billable request, expressed with the same fields as the protocol that produced it. Pick the type matching the API you called and copy the usage object from the provider response; ModelLink normalizes the accounting differences (whether cached tokens are included in the input count, whether reasoning tokens are included in the output count) before pricing.
type FileCache ¶
type FileCache struct {
// contains filtered or unexported fields
}
FileCache is the default persistent cache. It uses atomic filesystem updates and kernel-backed file locks, so independent processes can safely share it.
func NewFileCache ¶
func NewFileCache(options FileCacheOptions) (*FileCache, error)
NewFileCache creates a filesystem cache. Zero options use the same defaults as New(Options{}).
func (*FileCache) Prune ¶
Prune removes old immutable versions while preserving the active version and every version named in protected. Busy versions are serialized by their version lock before removal.
func (*FileCache) RecordCheck ¶ added in v0.3.0
func (cache *FileCache) RecordCheck(ctx context.Context, check CheckState) error
func (*FileCache) SetCurrent ¶
type FileCacheOptions ¶
type FileCacheOptions struct {
// Directory is the cache root. Empty uses os.UserCacheDir()/modellink.
Directory string
// MaxVersions is the total number of versions to retain. Zero defaults to
// two; -1 disables automatic cleanup. Positive values must be at least two.
MaxVersions int
}
FileCacheOptions configures the default filesystem cache.
type Interleaved ¶
type Interleaved struct {
Field string
}
func (Interleaved) MarshalJSON ¶
func (value Interleaved) MarshalJSON() ([]byte, error)
func (*Interleaved) UnmarshalJSON ¶
func (value *Interleaved) UnmarshalJSON(data []byte) error
type Locker ¶
Locker coordinates a complete update operation across all clients sharing a cache. Implementations must honor cancellation while waiting for a lock.
type Manifest ¶
type Manifest struct {
// Files corresponds to the JSON schema field "files".
Files ManifestFiles `json:"files"`
// GeneratedAt corresponds to the JSON schema field "generated_at".
GeneratedAt time.Time `json:"generated_at"`
// SchemaVersion corresponds to the JSON schema field "schema_version".
SchemaVersion int `json:"schema_version"`
// Source corresponds to the JSON schema field "source".
Source ManifestSource `json:"source"`
// Version corresponds to the JSON schema field "version".
Version string `json:"version"`
}
type ManifestFile ¶
type ManifestFiles ¶
type ManifestFiles struct {
// APIJSON corresponds to the JSON schema field "api.json".
APIJSON ManifestFile `json:"api.json"`
// CatalogJSON corresponds to the JSON schema field "catalog.json".
CatalogJSON ManifestFile `json:"catalog.json"`
// ModelsJSON corresponds to the JSON schema field "models.json".
ModelsJSON ManifestFile `json:"models.json"`
// SchemaJSON corresponds to the JSON schema field "schema.json".
SchemaJSON ManifestFile `json:"schema.json"`
}
type ManifestSource ¶
type ModelMetadata ¶
type ModelMetadata struct {
// Whether attachments are supported. Missing on optional metadata means unknown.
Attachment *bool `json:"attachment,omitempty"`
// Benchmarks corresponds to the JSON schema field "benchmarks".
Benchmarks []ModelMetadataBenchmarksElem `json:"benchmarks,omitempty"`
// Description corresponds to the JSON schema field "description".
Description string `json:"description"`
// Family corresponds to the JSON schema field "family".
Family *ModelMetadataFamily `json:"family,omitempty"`
// ID corresponds to the JSON schema field "id".
ID string `json:"id"`
// Knowledge corresponds to the JSON schema field "knowledge".
Knowledge *string `json:"knowledge,omitempty"`
// LastUpdated corresponds to the JSON schema field "last_updated".
LastUpdated *string `json:"last_updated,omitempty"`
// License corresponds to the JSON schema field "license".
License *string `json:"license,omitempty"`
// Token limits published for the base model.
Limit *ModelMetadataLimit `json:"limit,omitempty"`
// Links corresponds to the JSON schema field "links".
Links []ModelMetadataLinksElem `json:"links,omitempty"`
// Input and output modalities exposed by this model endpoint.
Modalities *ModelMetadataModalities `json:"modalities,omitempty"`
// Name corresponds to the JSON schema field "name".
Name string `json:"name"`
// OpenWeights corresponds to the JSON schema field "open_weights".
OpenWeights *bool `json:"open_weights,omitempty"`
// Whether reasoning is supported. Missing means unknown; false means explicitly
// unsupported.
Reasoning *bool `json:"reasoning,omitempty"`
// ReleaseDate corresponds to the JSON schema field "release_date".
ReleaseDate *string `json:"release_date,omitempty"`
// Series corresponds to the JSON schema field "series".
Series *string `json:"series,omitempty"`
// Whether structured output is supported. Missing means unknown; false means
// explicitly unsupported.
StructuredOutput *bool `json:"structured_output,omitempty"`
// Whether temperature is explicitly adjustable. Missing means unknown; false
// means fixed or unsupported.
Temperature *bool `json:"temperature,omitempty"`
// Whether tool calling is supported. Missing means unknown; false means
// explicitly unsupported.
ToolCall *bool `json:"tool_call,omitempty"`
// Weights corresponds to the JSON schema field "weights".
Weights []ModelMetadataWeightsElem `json:"weights,omitempty"`
}
type ModelMetadataBenchmarksElem ¶
type ModelMetadataBenchmarksElem struct {
// Dataset corresponds to the JSON schema field "dataset".
Dataset *string `json:"dataset,omitempty"`
// Date corresponds to the JSON schema field "date".
Date *string `json:"date,omitempty"`
// Harness corresponds to the JSON schema field "harness".
Harness *string `json:"harness,omitempty"`
// Metric corresponds to the JSON schema field "metric".
Metric *string `json:"metric,omitempty"`
// Name corresponds to the JSON schema field "name".
Name string `json:"name"`
// Score corresponds to the JSON schema field "score".
Score interface{} `json:"score"`
// Source corresponds to the JSON schema field "source".
Source *string `json:"source,omitempty"`
// Variant corresponds to the JSON schema field "variant".
Variant *string `json:"variant,omitempty"`
// Version corresponds to the JSON schema field "version".
Version *string `json:"version,omitempty"`
}
type ModelMetadataFamily ¶
type ModelMetadataFamily string
const ModelMetadataFamilyAgi ModelMetadataFamily = "agi"
const ModelMetadataFamilyAllam ModelMetadataFamily = "allam"
const ModelMetadataFamilyAllenai ModelMetadataFamily = "allenai"
const ModelMetadataFamilyAlpha ModelMetadataFamily = "alpha"
const ModelMetadataFamilyAura ModelMetadataFamily = "aura"
const ModelMetadataFamilyAuto ModelMetadataFamily = "auto"
const ModelMetadataFamilyBaichuan ModelMetadataFamily = "baichuan"
const ModelMetadataFamilyBart ModelMetadataFamily = "bart"
const ModelMetadataFamilyBge ModelMetadataFamily = "bge"
const ModelMetadataFamilyBigPickle ModelMetadataFamily = "big-pickle"
const ModelMetadataFamilyCanopylabs ModelMetadataFamily = "canopylabs"
const ModelMetadataFamilyChutesai ModelMetadataFamily = "chutesai"
const ModelMetadataFamilyClaude ModelMetadataFamily = "claude"
const ModelMetadataFamilyClaudeFable ModelMetadataFamily = "claude-fable"
const ModelMetadataFamilyClaudeHaiku ModelMetadataFamily = "claude-haiku"
const ModelMetadataFamilyClaudeOpus ModelMetadataFamily = "claude-opus"
const ModelMetadataFamilyClaudeSonnet ModelMetadataFamily = "claude-sonnet"
const ModelMetadataFamilyCodestral ModelMetadataFamily = "codestral"
const ModelMetadataFamilyCodestralEmbed ModelMetadataFamily = "codestral-embed"
const ModelMetadataFamilyCogito ModelMetadataFamily = "cogito"
const ModelMetadataFamilyCohereEmbed ModelMetadataFamily = "cohere-embed"
const ModelMetadataFamilyCommand ModelMetadataFamily = "command"
const ModelMetadataFamilyCommandA ModelMetadataFamily = "command-a"
const ModelMetadataFamilyCommandLight ModelMetadataFamily = "command-light"
const ModelMetadataFamilyCommandR ModelMetadataFamily = "command-r"
const ModelMetadataFamilyDallE ModelMetadataFamily = "dall-e"
const ModelMetadataFamilyDeepseek ModelMetadataFamily = "deepseek"
const ModelMetadataFamilyDeepseekFlash ModelMetadataFamily = "deepseek-flash"
const ModelMetadataFamilyDeepseekFlashFree ModelMetadataFamily = "deepseek-flash-free"
const ModelMetadataFamilyDeepseekFlashThink ModelMetadataFamily = "deepseek-flash-think"
const ModelMetadataFamilyDeepseekThinking ModelMetadataFamily = "deepseek-thinking"
const ModelMetadataFamilyDevstral ModelMetadataFamily = "devstral"
const ModelMetadataFamilyDiscolm ModelMetadataFamily = "discolm"
const ModelMetadataFamilyDistilbert ModelMetadataFamily = "distilbert"
const ModelMetadataFamilyDoubaoSeed ModelMetadataFamily = "doubao-seed"
const ModelMetadataFamilyDreamMachine ModelMetadataFamily = "dream-machine"
const ModelMetadataFamilyDreamshaper ModelMetadataFamily = "dreamshaper"
const ModelMetadataFamilyElephant ModelMetadataFamily = "elephant"
const ModelMetadataFamilyElevenlabs ModelMetadataFamily = "elevenlabs"
const ModelMetadataFamilyErnie ModelMetadataFamily = "ernie"
const ModelMetadataFamilyFalcon ModelMetadataFamily = "falcon"
const ModelMetadataFamilyFlux ModelMetadataFamily = "flux"
const ModelMetadataFamilyFugu ModelMetadataFamily = "fugu"
const ModelMetadataFamilyGemini ModelMetadataFamily = "gemini"
const ModelMetadataFamilyGeminiEmbedding ModelMetadataFamily = "gemini-embedding"
const ModelMetadataFamilyGeminiFlash ModelMetadataFamily = "gemini-flash"
const ModelMetadataFamilyGeminiFlashLite ModelMetadataFamily = "gemini-flash-lite"
const ModelMetadataFamilyGeminiPro ModelMetadataFamily = "gemini-pro"
const ModelMetadataFamilyGemma ModelMetadataFamily = "gemma"
const ModelMetadataFamilyGlm ModelMetadataFamily = "glm"
const ModelMetadataFamilyGlmAir ModelMetadataFamily = "glm-air"
const ModelMetadataFamilyGlmFlash ModelMetadataFamily = "glm-flash"
const ModelMetadataFamilyGlmFree ModelMetadataFamily = "glm-free"
const ModelMetadataFamilyGlmZ ModelMetadataFamily = "glm-z"
const ModelMetadataFamilyGlmv ModelMetadataFamily = "glmv"
const ModelMetadataFamilyGpt ModelMetadataFamily = "gpt"
const ModelMetadataFamilyGptCodex ModelMetadataFamily = "gpt-codex"
const ModelMetadataFamilyGptCodexMini ModelMetadataFamily = "gpt-codex-mini"
const ModelMetadataFamilyGptCodexSpark ModelMetadataFamily = "gpt-codex-spark"
const ModelMetadataFamilyGptImage ModelMetadataFamily = "gpt-image"
const ModelMetadataFamilyGptLuna ModelMetadataFamily = "gpt-luna"
const ModelMetadataFamilyGptMini ModelMetadataFamily = "gpt-mini"
const ModelMetadataFamilyGptNano ModelMetadataFamily = "gpt-nano"
const ModelMetadataFamilyGptOss ModelMetadataFamily = "gpt-oss"
const ModelMetadataFamilyGptPro ModelMetadataFamily = "gpt-pro"
const ModelMetadataFamilyGptSol ModelMetadataFamily = "gpt-sol"
const ModelMetadataFamilyGptTerra ModelMetadataFamily = "gpt-terra"
const ModelMetadataFamilyGranite ModelMetadataFamily = "granite"
const ModelMetadataFamilyGrok ModelMetadataFamily = "grok"
const ModelMetadataFamilyGrokBeta ModelMetadataFamily = "grok-beta"
const ModelMetadataFamilyGrokBuild ModelMetadataFamily = "grok-build"
const ModelMetadataFamilyGrokVision ModelMetadataFamily = "grok-vision"
const ModelMetadataFamilyGroq ModelMetadataFamily = "groq"
const ModelMetadataFamilyHermes ModelMetadataFamily = "hermes"
const ModelMetadataFamilyHunyuan ModelMetadataFamily = "hunyuan"
const ModelMetadataFamilyHy ModelMetadataFamily = "Hy"
const ModelMetadataFamilyHy3 ModelMetadataFamily = "hy3"
const ModelMetadataFamilyHy3Free ModelMetadataFamily = "hy3-free"
const ModelMetadataFamilyIdeogram ModelMetadataFamily = "ideogram"
const ModelMetadataFamilyImagen ModelMetadataFamily = "imagen"
const ModelMetadataFamilyIndictrans ModelMetadataFamily = "indictrans"
const ModelMetadataFamilyIntellect ModelMetadataFamily = "intellect"
const ModelMetadataFamilyInternS ModelMetadataFamily = "intern-s"
const ModelMetadataFamilyInternvl ModelMetadataFamily = "internvl"
const ModelMetadataFamilyJais ModelMetadataFamily = "jais"
const ModelMetadataFamilyJamba ModelMetadataFamily = "jamba"
const ModelMetadataFamilyJoyai ModelMetadataFamily = "joyai"
const ModelMetadataFamilyKatCoder ModelMetadataFamily = "kat-coder"
const ModelMetadataFamilyKimi ModelMetadataFamily = "kimi"
const ModelMetadataFamilyKimiFree ModelMetadataFamily = "kimi-free"
const ModelMetadataFamilyKimiK2 ModelMetadataFamily = "kimi-k2"
const ModelMetadataFamilyKimiK3 ModelMetadataFamily = "kimi-k3"
const ModelMetadataFamilyKimiThinking ModelMetadataFamily = "kimi-thinking"
const ModelMetadataFamilyLaguna ModelMetadataFamily = "laguna"
const ModelMetadataFamilyLagunaS ModelMetadataFamily = "laguna-s"
const ModelMetadataFamilyLing ModelMetadataFamily = "ling"
const ModelMetadataFamilyLingFlashFree ModelMetadataFamily = "ling-flash-free"
const ModelMetadataFamilyLiquid ModelMetadataFamily = "liquid"
const ModelMetadataFamilyLlama ModelMetadataFamily = "llama"
const ModelMetadataFamilyLlava ModelMetadataFamily = "llava"
const ModelMetadataFamilyLongcat ModelMetadataFamily = "longcat"
const ModelMetadataFamilyLucid ModelMetadataFamily = "lucid"
const ModelMetadataFamilyLyria ModelMetadataFamily = "lyria"
const ModelMetadataFamilyM2M ModelMetadataFamily = "m2m"
const ModelMetadataFamilyMagistral ModelMetadataFamily = "magistral"
const ModelMetadataFamilyMagistralMedium ModelMetadataFamily = "magistral-medium"
const ModelMetadataFamilyMagistralSmall ModelMetadataFamily = "magistral-small"
const ModelMetadataFamilyMai ModelMetadataFamily = "mai"
const ModelMetadataFamilyMelotts ModelMetadataFamily = "melotts"
const ModelMetadataFamilyMercury ModelMetadataFamily = "mercury"
const ModelMetadataFamilyMimo ModelMetadataFamily = "mimo"
const ModelMetadataFamilyMimoFlashFree ModelMetadataFamily = "mimo-flash-free"
const ModelMetadataFamilyMimoOmni ModelMetadataFamily = "mimo-omni"
const ModelMetadataFamilyMimoOmniFree ModelMetadataFamily = "mimo-omni-free"
const ModelMetadataFamilyMimoPro ModelMetadataFamily = "mimo-pro"
const ModelMetadataFamilyMimoProFree ModelMetadataFamily = "mimo-pro-free"
const ModelMetadataFamilyMimoV25 ModelMetadataFamily = "mimo-v2.5"
const ModelMetadataFamilyMimoV25Free ModelMetadataFamily = "mimo-v2.5-free"
const ModelMetadataFamilyMimoV25Pro ModelMetadataFamily = "mimo-v2.5-pro"
const ModelMetadataFamilyMimoV26Flash ModelMetadataFamily = "mimo-v2.6-flash"
const ModelMetadataFamilyMimoV26Pro ModelMetadataFamily = "mimo-v2.6-pro"
const ModelMetadataFamilyMimoV2Omni ModelMetadataFamily = "mimo-v2-omni"
const ModelMetadataFamilyMimoV2Pro ModelMetadataFamily = "mimo-v2-pro"
const ModelMetadataFamilyMinimax ModelMetadataFamily = "minimax"
const ModelMetadataFamilyMinimaxFree ModelMetadataFamily = "minimax-free"
const ModelMetadataFamilyMinimaxM2 ModelMetadataFamily = "minimax-m2"
const ModelMetadataFamilyMinimaxM21 ModelMetadataFamily = "minimax-m2.1"
const ModelMetadataFamilyMinimaxM25 ModelMetadataFamily = "minimax-m2.5"
const ModelMetadataFamilyMinimaxM27 ModelMetadataFamily = "minimax-m2.7"
const ModelMetadataFamilyMinimaxM3 ModelMetadataFamily = "minimax-m3"
const ModelMetadataFamilyMinimaxM3Free ModelMetadataFamily = "minimax-m3-free"
const ModelMetadataFamilyMinistral ModelMetadataFamily = "ministral"
const ModelMetadataFamilyMistral ModelMetadataFamily = "mistral"
const ModelMetadataFamilyMistralEmbed ModelMetadataFamily = "mistral-embed"
const ModelMetadataFamilyMistralLarge ModelMetadataFamily = "mistral-large"
const ModelMetadataFamilyMistralMedium ModelMetadataFamily = "mistral-medium"
const ModelMetadataFamilyMistralNemo ModelMetadataFamily = "mistral-nemo"
const ModelMetadataFamilyMistralSmall ModelMetadataFamily = "mistral-small"
const ModelMetadataFamilyMixtral ModelMetadataFamily = "mixtral"
const ModelMetadataFamilyMmPoly ModelMetadataFamily = "mm-poly"
const ModelMetadataFamilyModelRouter ModelMetadataFamily = "model-router"
const ModelMetadataFamilyMorph ModelMetadataFamily = "morph"
const ModelMetadataFamilyMuse ModelMetadataFamily = "muse"
const ModelMetadataFamilyNanoBanana ModelMetadataFamily = "nano-banana"
const ModelMetadataFamilyNemoretriever ModelMetadataFamily = "nemoretriever"
const ModelMetadataFamilyNemotron ModelMetadataFamily = "nemotron"
const ModelMetadataFamilyNemotronFree ModelMetadataFamily = "nemotron-free"
const ModelMetadataFamilyNeuralChat ModelMetadataFamily = "neural-chat"
const ModelMetadataFamilyNexN2 ModelMetadataFamily = "nex-n2"
const ModelMetadataFamilyNorth ModelMetadataFamily = "north"
const ModelMetadataFamilyNorthFree ModelMetadataFamily = "north-free"
const ModelMetadataFamilyNousresearch ModelMetadataFamily = "nousresearch"
const ModelMetadataFamilyNova ModelMetadataFamily = "nova"
const ModelMetadataFamilyNovaLite ModelMetadataFamily = "nova-lite"
const ModelMetadataFamilyNovaMicro ModelMetadataFamily = "nova-micro"
const ModelMetadataFamilyNovaPro ModelMetadataFamily = "nova-pro"
const ModelMetadataFamilyO ModelMetadataFamily = "o"
const ModelMetadataFamilyOMini ModelMetadataFamily = "o-mini"
const ModelMetadataFamilyOPro ModelMetadataFamily = "o-pro"
const ModelMetadataFamilyOpenchat ModelMetadataFamily = "openchat"
const ModelMetadataFamilyOpengvlab ModelMetadataFamily = "opengvlab"
const ModelMetadataFamilyOpenpangu ModelMetadataFamily = "openpangu"
const ModelMetadataFamilyOrnith ModelMetadataFamily = "ornith"
const ModelMetadataFamilyOsmosis ModelMetadataFamily = "osmosis"
const ModelMetadataFamilyOswe ModelMetadataFamily = "oswe"
const ModelMetadataFamilyPalmyra ModelMetadataFamily = "palmyra"
const ModelMetadataFamilyPangu ModelMetadataFamily = "pangu"
const ModelMetadataFamilyParakeet ModelMetadataFamily = "parakeet"
const ModelMetadataFamilyPhi ModelMetadataFamily = "phi"
const ModelMetadataFamilyPhoenix ModelMetadataFamily = "phoenix"
const ModelMetadataFamilyPixtral ModelMetadataFamily = "pixtral"
const ModelMetadataFamilyPlamo ModelMetadataFamily = "plamo"
const ModelMetadataFamilyPony ModelMetadataFamily = "pony"
const ModelMetadataFamilyQvq ModelMetadataFamily = "qvq"
const ModelMetadataFamilyQwen ModelMetadataFamily = "qwen"
const ModelMetadataFamilyQwen35 ModelMetadataFamily = "qwen3.5"
const ModelMetadataFamilyQwen36 ModelMetadataFamily = "qwen3.6"
const ModelMetadataFamilyQwen37Flash ModelMetadataFamily = "qwen3.7-flash"
const ModelMetadataFamilyQwen37Max ModelMetadataFamily = "qwen3.7-max"
const ModelMetadataFamilyQwen37Plus ModelMetadataFamily = "qwen3.7-plus"
const ModelMetadataFamilyQwen38Max ModelMetadataFamily = "qwen3.8-max"
const ModelMetadataFamilyQwenFree ModelMetadataFamily = "qwen-free"
const ModelMetadataFamilyQwerky ModelMetadataFamily = "qwerky"
const ModelMetadataFamilyRay ModelMetadataFamily = "ray"
const ModelMetadataFamilyRecraft ModelMetadataFamily = "recraft"
const ModelMetadataFamilyRednote ModelMetadataFamily = "rednote"
const ModelMetadataFamilyReka ModelMetadataFamily = "reka"
const ModelMetadataFamilyResnet ModelMetadataFamily = "resnet"
const ModelMetadataFamilyRing ModelMetadataFamily = "ring"
const ModelMetadataFamilyRing1TFree ModelMetadataFamily = "ring-1t-free"
const ModelMetadataFamilyRnj ModelMetadataFamily = "rnj"
const ModelMetadataFamilyRunway ModelMetadataFamily = "runway"
const ModelMetadataFamilySarvam ModelMetadataFamily = "sarvam"
const ModelMetadataFamilySeed ModelMetadataFamily = "seed"
const ModelMetadataFamilySensenova ModelMetadataFamily = "sensenova"
const ModelMetadataFamilySherlock ModelMetadataFamily = "sherlock"
const ModelMetadataFamilySkywork ModelMetadataFamily = "skywork"
const ModelMetadataFamilySmartTurn ModelMetadataFamily = "smart-turn"
const ModelMetadataFamilySolar ModelMetadataFamily = "solar"
const ModelMetadataFamilySolarMini ModelMetadataFamily = "solar-mini"
const ModelMetadataFamilySolarPro ModelMetadataFamily = "solar-pro"
const ModelMetadataFamilySonar ModelMetadataFamily = "sonar"
const ModelMetadataFamilySonarDeepResearch ModelMetadataFamily = "sonar-deep-research"
const ModelMetadataFamilySonarPro ModelMetadataFamily = "sonar-pro"
const ModelMetadataFamilySonarReasoning ModelMetadataFamily = "sonar-reasoning"
const ModelMetadataFamilySora ModelMetadataFamily = "sora"
const ModelMetadataFamilySourceful ModelMetadataFamily = "sourceful"
const ModelMetadataFamilySparkX2 ModelMetadataFamily = "spark-x2"
const ModelMetadataFamilySqlcoder ModelMetadataFamily = "sqlcoder"
const ModelMetadataFamilyStableDiffusion ModelMetadataFamily = "stable-diffusion"
const ModelMetadataFamilyStarling ModelMetadataFamily = "starling"
const ModelMetadataFamilyStep ModelMetadataFamily = "step"
const ModelMetadataFamilyTako ModelMetadataFamily = "tako"
const ModelMetadataFamilyTextEmbedding ModelMetadataFamily = "text-embedding"
const ModelMetadataFamilyTitan ModelMetadataFamily = "titan"
const ModelMetadataFamilyTitanEmbed ModelMetadataFamily = "titan-embed"
const ModelMetadataFamilyTngtech ModelMetadataFamily = "tngtech"
const ModelMetadataFamilyTopazlabs ModelMetadataFamily = "topazlabs"
const ModelMetadataFamilyTrinity ModelMetadataFamily = "trinity"
const ModelMetadataFamilyTrinityMini ModelMetadataFamily = "trinity-mini"
const ModelMetadataFamilyTstars ModelMetadataFamily = "tstars"
const ModelMetadataFamilyUnaCybertron ModelMetadataFamily = "una-cybertron"
const ModelMetadataFamilyUnsloth ModelMetadataFamily = "unsloth"
const ModelMetadataFamilyV0 ModelMetadataFamily = "v0"
const ModelMetadataFamilyVenice ModelMetadataFamily = "venice"
const ModelMetadataFamilyVeo ModelMetadataFamily = "veo"
const ModelMetadataFamilyVoxtral ModelMetadataFamily = "voxtral"
const ModelMetadataFamilyVoyage ModelMetadataFamily = "voyage"
const ModelMetadataFamilyWhisper ModelMetadataFamily = "whisper"
const ModelMetadataFamilyYi ModelMetadataFamily = "yi"
const ModelMetadataFamilyZephyr ModelMetadataFamily = "zephyr"
type ModelMetadataLimit ¶
type ModelMetadataLimit struct {
// Maximum context window in tokens.
Context int `json:"context"`
// Maximum input length in tokens when separately documented.
Input *int `json:"input,omitempty"`
// Maximum output length in tokens when documented.
Output *int `json:"output,omitempty"`
}
Token limits published for the base model.
type ModelMetadataLinksElem ¶
type ModelMetadataLinksElem struct {
// Label corresponds to the JSON schema field "label".
Label *string `json:"label,omitempty"`
// Type corresponds to the JSON schema field "type".
Type *ModelMetadataLinksElemType `json:"type,omitempty"`
// URL corresponds to the JSON schema field "url".
URL string `json:"url"`
}
type ModelMetadataLinksElemType ¶
type ModelMetadataLinksElemType string
const ModelMetadataLinksElemTypeAnnouncement ModelMetadataLinksElemType = "announcement"
const ModelMetadataLinksElemTypeBlog ModelMetadataLinksElemType = "blog"
const ModelMetadataLinksElemTypeDocs ModelMetadataLinksElemType = "docs"
const ModelMetadataLinksElemTypeLicense ModelMetadataLinksElemType = "license"
const ModelMetadataLinksElemTypeModelCard ModelMetadataLinksElemType = "model_card"
const ModelMetadataLinksElemTypeOther ModelMetadataLinksElemType = "other"
const ModelMetadataLinksElemTypePaper ModelMetadataLinksElemType = "paper"
const ModelMetadataLinksElemTypeWeights ModelMetadataLinksElemType = "weights"
type ModelMetadataModalities ¶
type ModelMetadataModalities struct {
// Input modalities accepted by the model.
Input []ModelMetadataModalitiesInputElem `json:"input"`
// Output modalities produced by the model.
Output []ModelMetadataModalitiesOutputElem `json:"output"`
}
Input and output modalities exposed by this model endpoint.
type ModelMetadataModalitiesInputElem ¶
type ModelMetadataModalitiesInputElem string
const ModelMetadataModalitiesInputElemAudio ModelMetadataModalitiesInputElem = "audio"
const ModelMetadataModalitiesInputElemImage ModelMetadataModalitiesInputElem = "image"
const ModelMetadataModalitiesInputElemPdf ModelMetadataModalitiesInputElem = "pdf"
const ModelMetadataModalitiesInputElemText ModelMetadataModalitiesInputElem = "text"
const ModelMetadataModalitiesInputElemVideo ModelMetadataModalitiesInputElem = "video"
type ModelMetadataModalitiesOutputElem ¶
type ModelMetadataModalitiesOutputElem string
const ModelMetadataModalitiesOutputElemAudio ModelMetadataModalitiesOutputElem = "audio"
const ModelMetadataModalitiesOutputElemImage ModelMetadataModalitiesOutputElem = "image"
const ModelMetadataModalitiesOutputElemPdf ModelMetadataModalitiesOutputElem = "pdf"
const ModelMetadataModalitiesOutputElemText ModelMetadataModalitiesOutputElem = "text"
const ModelMetadataModalitiesOutputElemVideo ModelMetadataModalitiesOutputElem = "video"
type ModelMetadataWeightsElem ¶
type ModelMetadataWeightsElem struct {
// Format corresponds to the JSON schema field "format".
Format *string `json:"format,omitempty"`
// Label corresponds to the JSON schema field "label".
Label *string `json:"label,omitempty"`
// Quantization corresponds to the JSON schema field "quantization".
Quantization *string `json:"quantization,omitempty"`
// URL corresponds to the JSON schema field "url".
URL string `json:"url"`
}
type Models ¶
type Models map[string]ModelMetadata
type OpenAIChatUsage ¶ added in v0.5.0
type OpenAIChatUsage struct {
PromptTokens int64 `json:"prompt_tokens"`
CompletionTokens int64 `json:"completion_tokens"`
PromptCachedTokens int64 `json:"-"`
}
OpenAIChatUsage mirrors the usage object of OpenAI-compatible chat completions. PromptTokens includes cache hits; PromptCachedTokens is the cached_tokens part reported in prompt_tokens_details.
func (*OpenAIChatUsage) UnmarshalJSON ¶ added in v0.5.0
func (usage *OpenAIChatUsage) UnmarshalJSON(data []byte) error
UnmarshalJSON accepts the official chat-completions usage object.
type OpenAIResponsesUsage ¶ added in v0.5.0
type OpenAIResponsesUsage struct {
InputTokens int64 `json:"input_tokens"`
OutputTokens int64 `json:"output_tokens"`
InputCachedTokens int64 `json:"-"` // input_tokens_details.cached_tokens
OutputReasoningTokens int64 `json:"-"` // output_tokens_details.reasoning_tokens
}
OpenAIResponsesUsage mirrors the usage object of the OpenAI Responses API. InputTokens includes cache hits; OutputTokens includes reasoning tokens.
func (*OpenAIResponsesUsage) UnmarshalJSON ¶ added in v0.5.0
func (usage *OpenAIResponsesUsage) UnmarshalJSON(data []byte) error
UnmarshalJSON accepts the official Responses usage object.
type Operation ¶ added in v0.3.0
type Operation string
Operation identifies the public entry point that initiated a logical task.
const ( OperationCurrentVersion Operation = "current_version" OperationStatus Operation = "status" OperationFindLatest Operation = "find_latest" OperationCheckLatest Operation = "check_latest" OperationActivateVersion Operation = "activate_version" OperationSwitchVersion Operation = "switch_version" OperationLoadCached Operation = "load_cached" OperationLoadVersion Operation = "load_version" OperationLoadLatest Operation = "load_latest" OperationLoad Operation = "load" )
type OperationReport ¶ added in v0.3.0
type OperationReport struct {
Operation Operation
// StartedAt and FinishedAt are UTC wall-clock timestamps.
StartedAt time.Time
FinishedAt time.Time
// Duration includes unclassified overhead but excludes the report callback.
// It need not equal the sum of the exclusive stage durations.
Duration time.Duration
Stages []StageReport
Err error
}
OperationReport measures a logical operation. A joined caller reports only its own shared_wait; the original task reports its work even if its caller cancels. Err is the operation error; applications should apply their usual redaction policy before exporting error messages to external log systems. Reports are not persisted. Callbacks run outside client/cache locks, may run concurrently, and may arrive after the initiating API call has returned.
type Options ¶
type Options struct {
// Registry is an npm-compatible registry URL. Empty uses npmmirror.
Registry string
// Cache stores and coordinates packages. Empty uses the default FileCache.
Cache Cache
// OnWarning receives each distinct non-fatal warning once per Client. Nil
// keeps the client silent; warnings remain available from Snapshot.Warnings.
OnWarning func(Warning)
// OnOperation receives completed logical operations outside cache/client
// locks. Calls can be concurrent; keep the handler short and concurrency-safe.
// Shared tasks may report after the API returns. Nil disables stage collection.
OnOperation func(OperationReport)
}
Options configures a Client. Its zero value uses npmmirror and the default cross-platform file cache.
type Protocol ¶
type Protocol string
const ProtocolAnthropicCompatible Protocol = "anthropic-compatible"
const ProtocolOpenaiCompatible Protocol = "openai-compatible"
const ProtocolOpenaiResponses Protocol = "openai-responses"
type Provider ¶
type Provider struct {
// Base API URL for the default endpoint.
API *string `json:"api,omitempty"`
// Purchasable credit packages published for users in China.
CreditPackagesCN []ProviderCreditPackagesCNElem `json:"credit_packages_cn,omitempty"`
// Legacy single credit package summary retained for Schema v3 readers.
CreditsCN *ProviderCreditsCN `json:"credits_cn,omitempty"`
// Doc corresponds to the JSON schema field "doc".
Doc string `json:"doc"`
// All protocol-specific endpoints exposed by this provider.
Endpoints []ProviderEndpoint `json:"endpoints,omitempty"`
// Env corresponds to the JSON schema field "env".
Env []string `json:"env"`
// ID corresponds to the JSON schema field "id".
ID string `json:"id"`
// Purpose-specific official links for integrating with this provider.
Links *ProviderLinks `json:"links,omitempty"`
// Models corresponds to the JSON schema field "models".
Models ProviderModels `json:"models"`
// Name corresponds to the JSON schema field "name".
Name string `json:"name"`
// NPM corresponds to the JSON schema field "npm".
NPM string `json:"npm"`
// Subscription plans published for users in China.
PlansCN []ProviderPlansCNElem `json:"plans_cn,omitempty"`
// Default protocol used by this provider.
Protocol ProviderProtocol `json:"protocol"`
}
type ProviderCreditPackagesCNElem ¶ added in v0.5.0
type ProviderCreditPackagesCNElem struct {
// Cny corresponds to the JSON schema field "cny".
Cny float64 `json:"cny"`
// Points corresponds to the JSON schema field "points".
Points int `json:"points"`
// ValidDays corresponds to the JSON schema field "valid_days".
ValidDays *int `json:"valid_days,omitempty"`
}
type ProviderCreditsCN ¶
type ProviderCreditsCN struct {
// Cny corresponds to the JSON schema field "cny".
Cny float64 `json:"cny"`
// Points corresponds to the JSON schema field "points".
Points int `json:"points"`
// ValidDays corresponds to the JSON schema field "valid_days".
ValidDays *int `json:"valid_days,omitempty"`
}
Legacy single credit package summary retained for Schema v3 readers.
type ProviderEndpoint ¶
type ProviderEndpoint struct {
// Base API URL for this endpoint.
API string `json:"api"`
// Marks the endpoint represented by the provider-level protocol and API fields.
Default *bool `json:"default,omitempty"`
// Stable endpoint ID referenced by provider models.
ID string `json:"id"`
// Protocol corresponds to the JSON schema field "protocol".
Protocol Protocol `json:"protocol"`
}
A protocol-specific API endpoint exposed by a provider.
type ProviderLinks ¶ added in v0.2.0
type ProviderLinks struct {
// Official instructions for applying for and configuring an API key.
APIKey *string `json:"api_key,omitempty"`
// Official console used to manage API keys and the provider account.
Console *string `json:"console,omitempty"`
// Official catalog of models available from this provider.
Models *string `json:"models,omitempty"`
// Official pricing, subscription plan, or purchase page.
Pricing *string `json:"pricing,omitempty"`
}
Purpose-specific official links for integrating with this provider.
type ProviderModel ¶
type ProviderModel struct {
// Whether attachments are supported. Missing on optional metadata means unknown.
Attachment bool `json:"attachment"`
// Prices in USD per million tokens.
Cost *ProviderModelCost `json:"cost,omitempty"`
// Prices in CNY per million tokens.
CostCN *ProviderModelCostCN `json:"cost_cn,omitempty"`
// Plan point consumption per the number of tokens declared by per_tokens.
CostPoints *ProviderModelCostPoints `json:"cost_points,omitempty"`
// Description corresponds to the JSON schema field "description".
Description string `json:"description"`
// Doc corresponds to the JSON schema field "doc".
Doc *string `json:"doc,omitempty"`
// Provider endpoint IDs enabled for this model; missing means the provider
// default endpoint.
Endpoints []string `json:"endpoints,omitempty"`
// Experimental corresponds to the JSON schema field "experimental".
Experimental *ProviderModelExperimental `json:"experimental,omitempty"`
// Family corresponds to the JSON schema field "family".
Family *ProviderModelFamily `json:"family,omitempty"`
// ID corresponds to the JSON schema field "id".
ID string `json:"id"`
// Whether reasoning content is returned alongside output, optionally naming its
// response field.
Interleaved *Interleaved `json:"interleaved,omitempty"`
// Knowledge corresponds to the JSON schema field "knowledge".
Knowledge *string `json:"knowledge,omitempty"`
// LastUpdated corresponds to the JSON schema field "last_updated".
LastUpdated string `json:"last_updated"`
// Token limits exposed by this provider model endpoint.
Limit ProviderModelLimit `json:"limit"`
// Input and output modalities exposed by this model endpoint.
Modalities ProviderModelModalities `json:"modalities"`
// Name corresponds to the JSON schema field "name".
Name string `json:"name"`
// OpenWeights corresponds to the JSON schema field "open_weights".
OpenWeights bool `json:"open_weights"`
// Provider corresponds to the JSON schema field "provider".
Provider *ProviderModelProvider `json:"provider,omitempty"`
// Whether reasoning is supported. Missing means unknown; false means explicitly
// unsupported.
Reasoning *bool `json:"reasoning,omitempty"`
// Provider-specific controls for enabling or configuring reasoning.
ReasoningOptions []ReasoningOption `json:"reasoning_options,omitempty"`
// ReleaseDate corresponds to the JSON schema field "release_date".
ReleaseDate string `json:"release_date"`
// Series corresponds to the JSON schema field "series".
Series *string `json:"series,omitempty"`
// Status corresponds to the JSON schema field "status".
Status *ProviderModelStatus `json:"status,omitempty"`
// Whether structured output is supported. Missing means unknown; false means
// explicitly unsupported.
StructuredOutput *bool `json:"structured_output,omitempty"`
// Whether temperature is explicitly adjustable. Missing means unknown; false
// means fixed or unsupported.
Temperature *bool `json:"temperature,omitempty"`
// Whether tool calling is supported. Missing means unknown; false means
// explicitly unsupported.
ToolCall *bool `json:"tool_call,omitempty"`
}
type ProviderModelCost ¶
type ProviderModelCost struct {
// CacheRead corresponds to the JSON schema field "cache_read".
CacheRead *float64 `json:"cache_read,omitempty"`
// CacheWrite corresponds to the JSON schema field "cache_write".
CacheWrite *float64 `json:"cache_write,omitempty"`
// ContextOver200K corresponds to the JSON schema field "context_over_200k".
ContextOver200K *ProviderModelCostContextOver200K `json:"context_over_200k,omitempty"`
// Input corresponds to the JSON schema field "input".
Input float64 `json:"input"`
// InputAudio corresponds to the JSON schema field "input_audio".
InputAudio *float64 `json:"input_audio,omitempty"`
// Label corresponds to the JSON schema field "label".
Label *string `json:"label,omitempty"`
// Output corresponds to the JSON schema field "output".
Output float64 `json:"output"`
// OutputAudio corresponds to the JSON schema field "output_audio".
OutputAudio *float64 `json:"output_audio,omitempty"`
// Reasoning corresponds to the JSON schema field "reasoning".
Reasoning *float64 `json:"reasoning,omitempty"`
// Tiers corresponds to the JSON schema field "tiers".
Tiers []ProviderModelCostTiersElem `json:"tiers,omitempty"`
}
Prices in USD per million tokens.
type ProviderModelCostCN ¶
type ProviderModelCostCN struct {
// CacheRead corresponds to the JSON schema field "cache_read".
CacheRead *float64 `json:"cache_read,omitempty"`
// CacheWrite corresponds to the JSON schema field "cache_write".
CacheWrite *float64 `json:"cache_write,omitempty"`
// ContextOver200K corresponds to the JSON schema field "context_over_200k".
ContextOver200K *ProviderModelCostCNContextOver200K `json:"context_over_200k,omitempty"`
// Input corresponds to the JSON schema field "input".
Input float64 `json:"input"`
// InputAudio corresponds to the JSON schema field "input_audio".
InputAudio *float64 `json:"input_audio,omitempty"`
// Label corresponds to the JSON schema field "label".
Label *string `json:"label,omitempty"`
// Output corresponds to the JSON schema field "output".
Output float64 `json:"output"`
// OutputAudio corresponds to the JSON schema field "output_audio".
OutputAudio *float64 `json:"output_audio,omitempty"`
// Reasoning corresponds to the JSON schema field "reasoning".
Reasoning *float64 `json:"reasoning,omitempty"`
// Thinking corresponds to the JSON schema field "thinking".
Thinking *ProviderModelCostCNThinking `json:"thinking,omitempty"`
// Tiers corresponds to the JSON schema field "tiers".
Tiers []ProviderModelCostCNTiersElem `json:"tiers,omitempty"`
}
Prices in CNY per million tokens.
type ProviderModelCostCNContextOver200K ¶
type ProviderModelCostCNContextOver200K struct {
// CacheRead corresponds to the JSON schema field "cache_read".
CacheRead *float64 `json:"cache_read,omitempty"`
// CacheWrite corresponds to the JSON schema field "cache_write".
CacheWrite *float64 `json:"cache_write,omitempty"`
// Input corresponds to the JSON schema field "input".
Input float64 `json:"input"`
// InputAudio corresponds to the JSON schema field "input_audio".
InputAudio *float64 `json:"input_audio,omitempty"`
// Label corresponds to the JSON schema field "label".
Label *string `json:"label,omitempty"`
// Output corresponds to the JSON schema field "output".
Output float64 `json:"output"`
// OutputAudio corresponds to the JSON schema field "output_audio".
OutputAudio *float64 `json:"output_audio,omitempty"`
// Reasoning corresponds to the JSON schema field "reasoning".
Reasoning *float64 `json:"reasoning,omitempty"`
// Thinking corresponds to the JSON schema field "thinking".
Thinking *ProviderModelCostCNContextOver200KThinking `json:"thinking,omitempty"`
}
type ProviderModelCostCNContextOver200KThinking ¶
type ProviderModelCostCNContextOver200KThinking struct {
// CacheRead corresponds to the JSON schema field "cache_read".
CacheRead *float64 `json:"cache_read,omitempty"`
// CacheWrite corresponds to the JSON schema field "cache_write".
CacheWrite *float64 `json:"cache_write,omitempty"`
// Input corresponds to the JSON schema field "input".
Input float64 `json:"input"`
// InputAudio corresponds to the JSON schema field "input_audio".
InputAudio *float64 `json:"input_audio,omitempty"`
// Label corresponds to the JSON schema field "label".
Label *string `json:"label,omitempty"`
// Output corresponds to the JSON schema field "output".
Output float64 `json:"output"`
// OutputAudio corresponds to the JSON schema field "output_audio".
OutputAudio *float64 `json:"output_audio,omitempty"`
}
type ProviderModelCostCNThinking ¶
type ProviderModelCostCNThinking struct {
// CacheRead corresponds to the JSON schema field "cache_read".
CacheRead *float64 `json:"cache_read,omitempty"`
// CacheWrite corresponds to the JSON schema field "cache_write".
CacheWrite *float64 `json:"cache_write,omitempty"`
// Input corresponds to the JSON schema field "input".
Input float64 `json:"input"`
// InputAudio corresponds to the JSON schema field "input_audio".
InputAudio *float64 `json:"input_audio,omitempty"`
// Label corresponds to the JSON schema field "label".
Label *string `json:"label,omitempty"`
// Output corresponds to the JSON schema field "output".
Output float64 `json:"output"`
// OutputAudio corresponds to the JSON schema field "output_audio".
OutputAudio *float64 `json:"output_audio,omitempty"`
}
type ProviderModelCostCNTiersElem ¶
type ProviderModelCostCNTiersElem struct {
// CacheRead corresponds to the JSON schema field "cache_read".
CacheRead *float64 `json:"cache_read,omitempty"`
// CacheWrite corresponds to the JSON schema field "cache_write".
CacheWrite *float64 `json:"cache_write,omitempty"`
// Input corresponds to the JSON schema field "input".
Input float64 `json:"input"`
// InputAudio corresponds to the JSON schema field "input_audio".
InputAudio *float64 `json:"input_audio,omitempty"`
// Label corresponds to the JSON schema field "label".
Label *string `json:"label,omitempty"`
// Output corresponds to the JSON schema field "output".
Output float64 `json:"output"`
// OutputAudio corresponds to the JSON schema field "output_audio".
OutputAudio *float64 `json:"output_audio,omitempty"`
// Reasoning corresponds to the JSON schema field "reasoning".
Reasoning *float64 `json:"reasoning,omitempty"`
// Thinking corresponds to the JSON schema field "thinking".
Thinking *ProviderModelCostCNTiersElemThinking `json:"thinking,omitempty"`
// When corresponds to the JSON schema field "when".
When ProviderModelCostCNTiersElemWhen `json:"when"`
}
type ProviderModelCostCNTiersElemThinking ¶
type ProviderModelCostCNTiersElemThinking struct {
// CacheRead corresponds to the JSON schema field "cache_read".
CacheRead *float64 `json:"cache_read,omitempty"`
// CacheWrite corresponds to the JSON schema field "cache_write".
CacheWrite *float64 `json:"cache_write,omitempty"`
// Input corresponds to the JSON schema field "input".
Input float64 `json:"input"`
// InputAudio corresponds to the JSON schema field "input_audio".
InputAudio *float64 `json:"input_audio,omitempty"`
// Label corresponds to the JSON schema field "label".
Label *string `json:"label,omitempty"`
// Output corresponds to the JSON schema field "output".
Output float64 `json:"output"`
// OutputAudio corresponds to the JSON schema field "output_audio".
OutputAudio *float64 `json:"output_audio,omitempty"`
}
type ProviderModelCostCNTiersElemWhen ¶ added in v0.4.0
type ProviderModelCostCNTiersElemWhen struct {
// Date corresponds to the JSON schema field "date".
Date *ProviderModelCostCNTiersElemWhen_1Date `json:"date,omitempty"`
// Input corresponds to the JSON schema field "input".
Input *ProviderModelCostCNTiersElemWhen_1Input `json:"input,omitempty"`
// Output corresponds to the JSON schema field "output".
Output *ProviderModelCostCNTiersElemWhen_1Output `json:"output,omitempty"`
// Size corresponds to the JSON schema field "size".
Size *int `json:"size,omitempty"`
// Time corresponds to the JSON schema field "time".
Time *ProviderModelCostCNTiersElemWhen_1Time `json:"time,omitempty"`
// Type corresponds to the JSON schema field "type".
Type string `json:"type"`
}
type ProviderModelCostCNTiersElemWhen_0 ¶ added in v0.4.0
type ProviderModelCostCNTiersElemWhen_1 ¶ added in v0.4.0
type ProviderModelCostCNTiersElemWhen_1 struct {
// Date corresponds to the JSON schema field "date".
Date *ProviderModelCostCNTiersElemWhen_1Date `json:"date,omitempty"`
// Input corresponds to the JSON schema field "input".
Input *ProviderModelCostCNTiersElemWhen_1Input `json:"input,omitempty"`
// Output corresponds to the JSON schema field "output".
Output *ProviderModelCostCNTiersElemWhen_1Output `json:"output,omitempty"`
// Time corresponds to the JSON schema field "time".
Time *ProviderModelCostCNTiersElemWhen_1Time `json:"time,omitempty"`
// Type corresponds to the JSON schema field "type".
Type string `json:"type"`
}
type ProviderModelCostCNTiersElemWhen_1Date ¶ added in v0.5.0
type ProviderModelCostCNTiersElemWhen_1Date struct {
// From corresponds to the JSON schema field "from".
From *string `json:"from,omitempty"`
// Timezone corresponds to the JSON schema field "timezone".
Timezone string `json:"timezone,omitempty"`
// To corresponds to the JSON schema field "to".
To *string `json:"to,omitempty"`
}
type ProviderModelCostCNTiersElemWhen_1Input ¶ added in v0.4.0
type ProviderModelCostCNTiersElemWhen_1Input struct {
// Gt corresponds to the JSON schema field "gt".
Gt *int `json:"gt,omitempty"`
// Gte corresponds to the JSON schema field "gte".
Gte *int `json:"gte,omitempty"`
// Lt corresponds to the JSON schema field "lt".
Lt *int `json:"lt,omitempty"`
// Lte corresponds to the JSON schema field "lte".
Lte *int `json:"lte,omitempty"`
}
type ProviderModelCostCNTiersElemWhen_1Output ¶ added in v0.4.0
type ProviderModelCostCNTiersElemWhen_1Output struct {
// Gt corresponds to the JSON schema field "gt".
Gt *int `json:"gt,omitempty"`
// Gte corresponds to the JSON schema field "gte".
Gte *int `json:"gte,omitempty"`
// Lt corresponds to the JSON schema field "lt".
Lt *int `json:"lt,omitempty"`
// Lte corresponds to the JSON schema field "lte".
Lte *int `json:"lte,omitempty"`
}
type ProviderModelCostCNTiersElemWhen_1Time ¶ added in v0.4.0
type ProviderModelCostCNTiersElemWhen_1Time struct {
// Timezone corresponds to the JSON schema field "timezone".
Timezone string `json:"timezone"`
// Windows corresponds to the JSON schema field "windows".
Windows []ProviderModelCostCNTiersElemWhen_1TimeWindowsElem `json:"windows"`
}
type ProviderModelCostCNTiersElemWhen_1TimeWindowsElem ¶ added in v0.4.0
type ProviderModelCostCNTiersElemWhen_1TimeWindowsElem struct {
// Days corresponds to the JSON schema field "days".
Days []ProviderModelCostCNTiersElemWhen_1TimeWindowsElemDaysElem `json:"days"`
// End corresponds to the JSON schema field "end".
End string `json:"end"`
// Excludes this window on China statutory holidays; callers provide the holiday
// resolver.
Holiday *string `json:"holiday,omitempty"`
// Start corresponds to the JSON schema field "start".
Start string `json:"start"`
}
type ProviderModelCostCNTiersElemWhen_1TimeWindowsElemDaysElem ¶ added in v0.4.0
type ProviderModelCostCNTiersElemWhen_1TimeWindowsElemDaysElem string
const ProviderModelCostCNTiersElemWhen_1TimeWindowsElemDaysElemFriday ProviderModelCostCNTiersElemWhen_1TimeWindowsElemDaysElem = "friday"
const ProviderModelCostCNTiersElemWhen_1TimeWindowsElemDaysElemMonday ProviderModelCostCNTiersElemWhen_1TimeWindowsElemDaysElem = "monday"
const ProviderModelCostCNTiersElemWhen_1TimeWindowsElemDaysElemSaturday ProviderModelCostCNTiersElemWhen_1TimeWindowsElemDaysElem = "saturday"
const ProviderModelCostCNTiersElemWhen_1TimeWindowsElemDaysElemSunday ProviderModelCostCNTiersElemWhen_1TimeWindowsElemDaysElem = "sunday"
const ProviderModelCostCNTiersElemWhen_1TimeWindowsElemDaysElemThursday ProviderModelCostCNTiersElemWhen_1TimeWindowsElemDaysElem = "thursday"
const ProviderModelCostCNTiersElemWhen_1TimeWindowsElemDaysElemTuesday ProviderModelCostCNTiersElemWhen_1TimeWindowsElemDaysElem = "tuesday"
const ProviderModelCostCNTiersElemWhen_1TimeWindowsElemDaysElemWednesday ProviderModelCostCNTiersElemWhen_1TimeWindowsElemDaysElem = "wednesday"
type ProviderModelCostContextOver200K ¶
type ProviderModelCostContextOver200K struct {
// CacheRead corresponds to the JSON schema field "cache_read".
CacheRead *float64 `json:"cache_read,omitempty"`
// CacheWrite corresponds to the JSON schema field "cache_write".
CacheWrite *float64 `json:"cache_write,omitempty"`
// Input corresponds to the JSON schema field "input".
Input float64 `json:"input"`
// InputAudio corresponds to the JSON schema field "input_audio".
InputAudio *float64 `json:"input_audio,omitempty"`
// Label corresponds to the JSON schema field "label".
Label *string `json:"label,omitempty"`
// Output corresponds to the JSON schema field "output".
Output float64 `json:"output"`
// OutputAudio corresponds to the JSON schema field "output_audio".
OutputAudio *float64 `json:"output_audio,omitempty"`
// Reasoning corresponds to the JSON schema field "reasoning".
Reasoning *float64 `json:"reasoning,omitempty"`
}
type ProviderModelCostPoints ¶
type ProviderModelCostPoints struct {
// CacheRead corresponds to the JSON schema field "cache_read".
CacheRead *float64 `json:"cache_read,omitempty"`
// Input corresponds to the JSON schema field "input".
Input float64 `json:"input"`
// Label corresponds to the JSON schema field "label".
Label *string `json:"label,omitempty"`
// Output corresponds to the JSON schema field "output".
Output float64 `json:"output"`
// PerTokens corresponds to the JSON schema field "per_tokens".
PerTokens int `json:"per_tokens"`
// Tiers corresponds to the JSON schema field "tiers".
Tiers []ProviderModelCostPointsTiersElem `json:"tiers,omitempty"`
}
Plan point consumption per the number of tokens declared by per_tokens.
type ProviderModelCostPointsTiersElem ¶
type ProviderModelCostPointsTiersElem struct {
// CacheRead corresponds to the JSON schema field "cache_read".
CacheRead *float64 `json:"cache_read,omitempty"`
// Input corresponds to the JSON schema field "input".
Input float64 `json:"input"`
// Label corresponds to the JSON schema field "label".
Label *string `json:"label,omitempty"`
// Output corresponds to the JSON schema field "output".
Output float64 `json:"output"`
// When corresponds to the JSON schema field "when".
When ProviderModelCostPointsTiersElemWhen `json:"when"`
}
type ProviderModelCostPointsTiersElemWhen ¶ added in v0.4.0
type ProviderModelCostPointsTiersElemWhen struct {
// Date corresponds to the JSON schema field "date".
Date *ProviderModelCostPointsTiersElemWhen_1Date `json:"date,omitempty"`
// Input corresponds to the JSON schema field "input".
Input *ProviderModelCostPointsTiersElemWhen_1Input `json:"input,omitempty"`
// Output corresponds to the JSON schema field "output".
Output *ProviderModelCostPointsTiersElemWhen_1Output `json:"output,omitempty"`
// Size corresponds to the JSON schema field "size".
Size *int `json:"size,omitempty"`
// Time corresponds to the JSON schema field "time".
Time *ProviderModelCostPointsTiersElemWhen_1Time `json:"time,omitempty"`
// Type corresponds to the JSON schema field "type".
Type string `json:"type"`
}
type ProviderModelCostPointsTiersElemWhen_0 ¶ added in v0.4.0
type ProviderModelCostPointsTiersElemWhen_1 ¶ added in v0.4.0
type ProviderModelCostPointsTiersElemWhen_1 struct {
// Date corresponds to the JSON schema field "date".
Date *ProviderModelCostPointsTiersElemWhen_1Date `json:"date,omitempty"`
// Input corresponds to the JSON schema field "input".
Input *ProviderModelCostPointsTiersElemWhen_1Input `json:"input,omitempty"`
// Output corresponds to the JSON schema field "output".
Output *ProviderModelCostPointsTiersElemWhen_1Output `json:"output,omitempty"`
// Time corresponds to the JSON schema field "time".
Time *ProviderModelCostPointsTiersElemWhen_1Time `json:"time,omitempty"`
// Type corresponds to the JSON schema field "type".
Type string `json:"type"`
}
type ProviderModelCostPointsTiersElemWhen_1Date ¶ added in v0.5.0
type ProviderModelCostPointsTiersElemWhen_1Date struct {
// From corresponds to the JSON schema field "from".
From *string `json:"from,omitempty"`
// Timezone corresponds to the JSON schema field "timezone".
Timezone string `json:"timezone,omitempty"`
// To corresponds to the JSON schema field "to".
To *string `json:"to,omitempty"`
}
type ProviderModelCostPointsTiersElemWhen_1Input ¶ added in v0.4.0
type ProviderModelCostPointsTiersElemWhen_1Input struct {
// Gt corresponds to the JSON schema field "gt".
Gt *int `json:"gt,omitempty"`
// Gte corresponds to the JSON schema field "gte".
Gte *int `json:"gte,omitempty"`
// Lt corresponds to the JSON schema field "lt".
Lt *int `json:"lt,omitempty"`
// Lte corresponds to the JSON schema field "lte".
Lte *int `json:"lte,omitempty"`
}
type ProviderModelCostPointsTiersElemWhen_1Output ¶ added in v0.4.0
type ProviderModelCostPointsTiersElemWhen_1Output struct {
// Gt corresponds to the JSON schema field "gt".
Gt *int `json:"gt,omitempty"`
// Gte corresponds to the JSON schema field "gte".
Gte *int `json:"gte,omitempty"`
// Lt corresponds to the JSON schema field "lt".
Lt *int `json:"lt,omitempty"`
// Lte corresponds to the JSON schema field "lte".
Lte *int `json:"lte,omitempty"`
}
type ProviderModelCostPointsTiersElemWhen_1Time ¶ added in v0.4.0
type ProviderModelCostPointsTiersElemWhen_1Time struct {
// Timezone corresponds to the JSON schema field "timezone".
Timezone string `json:"timezone"`
// Windows corresponds to the JSON schema field "windows".
Windows []ProviderModelCostPointsTiersElemWhen_1TimeWindowsElem `json:"windows"`
}
type ProviderModelCostPointsTiersElemWhen_1TimeWindowsElem ¶ added in v0.4.0
type ProviderModelCostPointsTiersElemWhen_1TimeWindowsElem struct {
// Days corresponds to the JSON schema field "days".
Days []ProviderModelCostPointsTiersElemWhen_1TimeWindowsElemDaysElem `json:"days"`
// End corresponds to the JSON schema field "end".
End string `json:"end"`
// Excludes this window on China statutory holidays; callers provide the holiday
// resolver.
Holiday *string `json:"holiday,omitempty"`
// Start corresponds to the JSON schema field "start".
Start string `json:"start"`
}
type ProviderModelCostPointsTiersElemWhen_1TimeWindowsElemDaysElem ¶ added in v0.4.0
type ProviderModelCostPointsTiersElemWhen_1TimeWindowsElemDaysElem string
const ProviderModelCostPointsTiersElemWhen_1TimeWindowsElemDaysElemFriday ProviderModelCostPointsTiersElemWhen_1TimeWindowsElemDaysElem = "friday"
const ProviderModelCostPointsTiersElemWhen_1TimeWindowsElemDaysElemMonday ProviderModelCostPointsTiersElemWhen_1TimeWindowsElemDaysElem = "monday"
const ProviderModelCostPointsTiersElemWhen_1TimeWindowsElemDaysElemSaturday ProviderModelCostPointsTiersElemWhen_1TimeWindowsElemDaysElem = "saturday"
const ProviderModelCostPointsTiersElemWhen_1TimeWindowsElemDaysElemSunday ProviderModelCostPointsTiersElemWhen_1TimeWindowsElemDaysElem = "sunday"
const ProviderModelCostPointsTiersElemWhen_1TimeWindowsElemDaysElemThursday ProviderModelCostPointsTiersElemWhen_1TimeWindowsElemDaysElem = "thursday"
const ProviderModelCostPointsTiersElemWhen_1TimeWindowsElemDaysElemTuesday ProviderModelCostPointsTiersElemWhen_1TimeWindowsElemDaysElem = "tuesday"
const ProviderModelCostPointsTiersElemWhen_1TimeWindowsElemDaysElemWednesday ProviderModelCostPointsTiersElemWhen_1TimeWindowsElemDaysElem = "wednesday"
type ProviderModelCostTiersElem ¶
type ProviderModelCostTiersElem struct {
// CacheRead corresponds to the JSON schema field "cache_read".
CacheRead *float64 `json:"cache_read,omitempty"`
// CacheWrite corresponds to the JSON schema field "cache_write".
CacheWrite *float64 `json:"cache_write,omitempty"`
// Input corresponds to the JSON schema field "input".
Input float64 `json:"input"`
// InputAudio corresponds to the JSON schema field "input_audio".
InputAudio *float64 `json:"input_audio,omitempty"`
// Label corresponds to the JSON schema field "label".
Label *string `json:"label,omitempty"`
// Output corresponds to the JSON schema field "output".
Output float64 `json:"output"`
// OutputAudio corresponds to the JSON schema field "output_audio".
OutputAudio *float64 `json:"output_audio,omitempty"`
// Reasoning corresponds to the JSON schema field "reasoning".
Reasoning *float64 `json:"reasoning,omitempty"`
// When corresponds to the JSON schema field "when".
When ProviderModelCostTiersElemWhen `json:"when"`
}
type ProviderModelCostTiersElemWhen ¶ added in v0.4.0
type ProviderModelCostTiersElemWhen struct {
// Date corresponds to the JSON schema field "date".
Date *ProviderModelCostTiersElemWhen_1Date `json:"date,omitempty"`
// Input corresponds to the JSON schema field "input".
Input *ProviderModelCostTiersElemWhen_1Input `json:"input,omitempty"`
// Output corresponds to the JSON schema field "output".
Output *ProviderModelCostTiersElemWhen_1Output `json:"output,omitempty"`
// Size corresponds to the JSON schema field "size".
Size *int `json:"size,omitempty"`
// Time corresponds to the JSON schema field "time".
Time *ProviderModelCostTiersElemWhen_1Time `json:"time,omitempty"`
// Type corresponds to the JSON schema field "type".
Type string `json:"type"`
}
type ProviderModelCostTiersElemWhen_0 ¶ added in v0.4.0
type ProviderModelCostTiersElemWhen_1 ¶ added in v0.4.0
type ProviderModelCostTiersElemWhen_1 struct {
// Date corresponds to the JSON schema field "date".
Date *ProviderModelCostTiersElemWhen_1Date `json:"date,omitempty"`
// Input corresponds to the JSON schema field "input".
Input *ProviderModelCostTiersElemWhen_1Input `json:"input,omitempty"`
// Output corresponds to the JSON schema field "output".
Output *ProviderModelCostTiersElemWhen_1Output `json:"output,omitempty"`
// Time corresponds to the JSON schema field "time".
Time *ProviderModelCostTiersElemWhen_1Time `json:"time,omitempty"`
// Type corresponds to the JSON schema field "type".
Type string `json:"type"`
}
type ProviderModelCostTiersElemWhen_1Date ¶ added in v0.5.0
type ProviderModelCostTiersElemWhen_1Date struct {
// From corresponds to the JSON schema field "from".
From *string `json:"from,omitempty"`
// Timezone corresponds to the JSON schema field "timezone".
Timezone string `json:"timezone,omitempty"`
// To corresponds to the JSON schema field "to".
To *string `json:"to,omitempty"`
}
type ProviderModelCostTiersElemWhen_1Input ¶ added in v0.4.0
type ProviderModelCostTiersElemWhen_1Input struct {
// Gt corresponds to the JSON schema field "gt".
Gt *int `json:"gt,omitempty"`
// Gte corresponds to the JSON schema field "gte".
Gte *int `json:"gte,omitempty"`
// Lt corresponds to the JSON schema field "lt".
Lt *int `json:"lt,omitempty"`
// Lte corresponds to the JSON schema field "lte".
Lte *int `json:"lte,omitempty"`
}
type ProviderModelCostTiersElemWhen_1Output ¶ added in v0.4.0
type ProviderModelCostTiersElemWhen_1Output struct {
// Gt corresponds to the JSON schema field "gt".
Gt *int `json:"gt,omitempty"`
// Gte corresponds to the JSON schema field "gte".
Gte *int `json:"gte,omitempty"`
// Lt corresponds to the JSON schema field "lt".
Lt *int `json:"lt,omitempty"`
// Lte corresponds to the JSON schema field "lte".
Lte *int `json:"lte,omitempty"`
}
type ProviderModelCostTiersElemWhen_1Time ¶ added in v0.4.0
type ProviderModelCostTiersElemWhen_1Time struct {
// Timezone corresponds to the JSON schema field "timezone".
Timezone string `json:"timezone"`
// Windows corresponds to the JSON schema field "windows".
Windows []ProviderModelCostTiersElemWhen_1TimeWindowsElem `json:"windows"`
}
type ProviderModelCostTiersElemWhen_1TimeWindowsElem ¶ added in v0.4.0
type ProviderModelCostTiersElemWhen_1TimeWindowsElem struct {
// Days corresponds to the JSON schema field "days".
Days []ProviderModelCostTiersElemWhen_1TimeWindowsElemDaysElem `json:"days"`
// End corresponds to the JSON schema field "end".
End string `json:"end"`
// Excludes this window on China statutory holidays; callers provide the holiday
// resolver.
Holiday *string `json:"holiday,omitempty"`
// Start corresponds to the JSON schema field "start".
Start string `json:"start"`
}
type ProviderModelCostTiersElemWhen_1TimeWindowsElemDaysElem ¶ added in v0.4.0
type ProviderModelCostTiersElemWhen_1TimeWindowsElemDaysElem string
const ProviderModelCostTiersElemWhen_1TimeWindowsElemDaysElemFriday ProviderModelCostTiersElemWhen_1TimeWindowsElemDaysElem = "friday"
const ProviderModelCostTiersElemWhen_1TimeWindowsElemDaysElemMonday ProviderModelCostTiersElemWhen_1TimeWindowsElemDaysElem = "monday"
const ProviderModelCostTiersElemWhen_1TimeWindowsElemDaysElemSaturday ProviderModelCostTiersElemWhen_1TimeWindowsElemDaysElem = "saturday"
const ProviderModelCostTiersElemWhen_1TimeWindowsElemDaysElemSunday ProviderModelCostTiersElemWhen_1TimeWindowsElemDaysElem = "sunday"
const ProviderModelCostTiersElemWhen_1TimeWindowsElemDaysElemThursday ProviderModelCostTiersElemWhen_1TimeWindowsElemDaysElem = "thursday"
const ProviderModelCostTiersElemWhen_1TimeWindowsElemDaysElemTuesday ProviderModelCostTiersElemWhen_1TimeWindowsElemDaysElem = "tuesday"
const ProviderModelCostTiersElemWhen_1TimeWindowsElemDaysElemWednesday ProviderModelCostTiersElemWhen_1TimeWindowsElemDaysElem = "wednesday"
type ProviderModelExperimental ¶
type ProviderModelExperimental struct {
// Modes corresponds to the JSON schema field "modes".
Modes ProviderModelExperimentalModes `json:"modes,omitempty"`
}
type ProviderModelExperimentalModes ¶
type ProviderModelExperimentalModes map[string]struct { // Cost corresponds to the JSON schema field "cost". Cost *ProviderModelExperimentalModesValueCost `json:"cost,omitempty"` // CostCN corresponds to the JSON schema field "cost_cn". CostCN *ProviderModelExperimentalModesValueCostCN `json:"cost_cn,omitempty"` // Provider corresponds to the JSON schema field "provider". Provider *ProviderModelExperimentalModesValueProvider `json:"provider,omitempty"` }
type ProviderModelExperimentalModesValueCost ¶
type ProviderModelExperimentalModesValueCost struct {
// CacheRead corresponds to the JSON schema field "cache_read".
CacheRead *float64 `json:"cache_read,omitempty"`
// CacheWrite corresponds to the JSON schema field "cache_write".
CacheWrite *float64 `json:"cache_write,omitempty"`
// Input corresponds to the JSON schema field "input".
Input float64 `json:"input"`
// InputAudio corresponds to the JSON schema field "input_audio".
InputAudio *float64 `json:"input_audio,omitempty"`
// Label corresponds to the JSON schema field "label".
Label *string `json:"label,omitempty"`
// Output corresponds to the JSON schema field "output".
Output float64 `json:"output"`
// OutputAudio corresponds to the JSON schema field "output_audio".
OutputAudio *float64 `json:"output_audio,omitempty"`
// Reasoning corresponds to the JSON schema field "reasoning".
Reasoning *float64 `json:"reasoning,omitempty"`
}
type ProviderModelExperimentalModesValueCostCN ¶
type ProviderModelExperimentalModesValueCostCN struct {
// CacheRead corresponds to the JSON schema field "cache_read".
CacheRead *float64 `json:"cache_read,omitempty"`
// CacheWrite corresponds to the JSON schema field "cache_write".
CacheWrite *float64 `json:"cache_write,omitempty"`
// Input corresponds to the JSON schema field "input".
Input float64 `json:"input"`
// InputAudio corresponds to the JSON schema field "input_audio".
InputAudio *float64 `json:"input_audio,omitempty"`
// Label corresponds to the JSON schema field "label".
Label *string `json:"label,omitempty"`
// Output corresponds to the JSON schema field "output".
Output float64 `json:"output"`
// OutputAudio corresponds to the JSON schema field "output_audio".
OutputAudio *float64 `json:"output_audio,omitempty"`
// Reasoning corresponds to the JSON schema field "reasoning".
Reasoning *float64 `json:"reasoning,omitempty"`
}
type ProviderModelExperimentalModesValueProvider ¶
type ProviderModelExperimentalModesValueProvider struct {
// Body corresponds to the JSON schema field "body".
Body ProviderModelExperimentalModesValueProviderBody `json:"body,omitempty"`
// Headers corresponds to the JSON schema field "headers".
Headers ProviderModelExperimentalModesValueProviderHeaders `json:"headers,omitempty"`
}
type ProviderModelFamily ¶
type ProviderModelFamily string
const ProviderModelFamilyAgi ProviderModelFamily = "agi"
const ProviderModelFamilyAllam ProviderModelFamily = "allam"
const ProviderModelFamilyAllenai ProviderModelFamily = "allenai"
const ProviderModelFamilyAlpha ProviderModelFamily = "alpha"
const ProviderModelFamilyAura ProviderModelFamily = "aura"
const ProviderModelFamilyAuto ProviderModelFamily = "auto"
const ProviderModelFamilyBaichuan ProviderModelFamily = "baichuan"
const ProviderModelFamilyBart ProviderModelFamily = "bart"
const ProviderModelFamilyBge ProviderModelFamily = "bge"
const ProviderModelFamilyBigPickle ProviderModelFamily = "big-pickle"
const ProviderModelFamilyCanopylabs ProviderModelFamily = "canopylabs"
const ProviderModelFamilyChutesai ProviderModelFamily = "chutesai"
const ProviderModelFamilyClaude ProviderModelFamily = "claude"
const ProviderModelFamilyClaudeFable ProviderModelFamily = "claude-fable"
const ProviderModelFamilyClaudeHaiku ProviderModelFamily = "claude-haiku"
const ProviderModelFamilyClaudeOpus ProviderModelFamily = "claude-opus"
const ProviderModelFamilyClaudeSonnet ProviderModelFamily = "claude-sonnet"
const ProviderModelFamilyCodestral ProviderModelFamily = "codestral"
const ProviderModelFamilyCodestralEmbed ProviderModelFamily = "codestral-embed"
const ProviderModelFamilyCogito ProviderModelFamily = "cogito"
const ProviderModelFamilyCohereEmbed ProviderModelFamily = "cohere-embed"
const ProviderModelFamilyCommand ProviderModelFamily = "command"
const ProviderModelFamilyCommandA ProviderModelFamily = "command-a"
const ProviderModelFamilyCommandLight ProviderModelFamily = "command-light"
const ProviderModelFamilyCommandR ProviderModelFamily = "command-r"
const ProviderModelFamilyDallE ProviderModelFamily = "dall-e"
const ProviderModelFamilyDeepseek ProviderModelFamily = "deepseek"
const ProviderModelFamilyDeepseekFlash ProviderModelFamily = "deepseek-flash"
const ProviderModelFamilyDeepseekFlashFree ProviderModelFamily = "deepseek-flash-free"
const ProviderModelFamilyDeepseekFlashThink ProviderModelFamily = "deepseek-flash-think"
const ProviderModelFamilyDeepseekThinking ProviderModelFamily = "deepseek-thinking"
const ProviderModelFamilyDevstral ProviderModelFamily = "devstral"
const ProviderModelFamilyDiscolm ProviderModelFamily = "discolm"
const ProviderModelFamilyDistilbert ProviderModelFamily = "distilbert"
const ProviderModelFamilyDoubaoSeed ProviderModelFamily = "doubao-seed"
const ProviderModelFamilyDreamMachine ProviderModelFamily = "dream-machine"
const ProviderModelFamilyDreamshaper ProviderModelFamily = "dreamshaper"
const ProviderModelFamilyElephant ProviderModelFamily = "elephant"
const ProviderModelFamilyElevenlabs ProviderModelFamily = "elevenlabs"
const ProviderModelFamilyErnie ProviderModelFamily = "ernie"
const ProviderModelFamilyFalcon ProviderModelFamily = "falcon"
const ProviderModelFamilyFlux ProviderModelFamily = "flux"
const ProviderModelFamilyFugu ProviderModelFamily = "fugu"
const ProviderModelFamilyGemini ProviderModelFamily = "gemini"
const ProviderModelFamilyGeminiEmbedding ProviderModelFamily = "gemini-embedding"
const ProviderModelFamilyGeminiFlash ProviderModelFamily = "gemini-flash"
const ProviderModelFamilyGeminiFlashLite ProviderModelFamily = "gemini-flash-lite"
const ProviderModelFamilyGeminiPro ProviderModelFamily = "gemini-pro"
const ProviderModelFamilyGemma ProviderModelFamily = "gemma"
const ProviderModelFamilyGlm ProviderModelFamily = "glm"
const ProviderModelFamilyGlmAir ProviderModelFamily = "glm-air"
const ProviderModelFamilyGlmFlash ProviderModelFamily = "glm-flash"
const ProviderModelFamilyGlmFree ProviderModelFamily = "glm-free"
const ProviderModelFamilyGlmZ ProviderModelFamily = "glm-z"
const ProviderModelFamilyGlmv ProviderModelFamily = "glmv"
const ProviderModelFamilyGpt ProviderModelFamily = "gpt"
const ProviderModelFamilyGptCodex ProviderModelFamily = "gpt-codex"
const ProviderModelFamilyGptCodexMini ProviderModelFamily = "gpt-codex-mini"
const ProviderModelFamilyGptCodexSpark ProviderModelFamily = "gpt-codex-spark"
const ProviderModelFamilyGptImage ProviderModelFamily = "gpt-image"
const ProviderModelFamilyGptLuna ProviderModelFamily = "gpt-luna"
const ProviderModelFamilyGptMini ProviderModelFamily = "gpt-mini"
const ProviderModelFamilyGptNano ProviderModelFamily = "gpt-nano"
const ProviderModelFamilyGptOss ProviderModelFamily = "gpt-oss"
const ProviderModelFamilyGptPro ProviderModelFamily = "gpt-pro"
const ProviderModelFamilyGptSol ProviderModelFamily = "gpt-sol"
const ProviderModelFamilyGptTerra ProviderModelFamily = "gpt-terra"
const ProviderModelFamilyGranite ProviderModelFamily = "granite"
const ProviderModelFamilyGrok ProviderModelFamily = "grok"
const ProviderModelFamilyGrokBeta ProviderModelFamily = "grok-beta"
const ProviderModelFamilyGrokBuild ProviderModelFamily = "grok-build"
const ProviderModelFamilyGrokVision ProviderModelFamily = "grok-vision"
const ProviderModelFamilyGroq ProviderModelFamily = "groq"
const ProviderModelFamilyHermes ProviderModelFamily = "hermes"
const ProviderModelFamilyHunyuan ProviderModelFamily = "hunyuan"
const ProviderModelFamilyHy ProviderModelFamily = "Hy"
const ProviderModelFamilyHy3 ProviderModelFamily = "hy3"
const ProviderModelFamilyHy3Free ProviderModelFamily = "hy3-free"
const ProviderModelFamilyIdeogram ProviderModelFamily = "ideogram"
const ProviderModelFamilyImagen ProviderModelFamily = "imagen"
const ProviderModelFamilyIndictrans ProviderModelFamily = "indictrans"
const ProviderModelFamilyIntellect ProviderModelFamily = "intellect"
const ProviderModelFamilyInternS ProviderModelFamily = "intern-s"
const ProviderModelFamilyInternvl ProviderModelFamily = "internvl"
const ProviderModelFamilyJais ProviderModelFamily = "jais"
const ProviderModelFamilyJamba ProviderModelFamily = "jamba"
const ProviderModelFamilyJoyai ProviderModelFamily = "joyai"
const ProviderModelFamilyKatCoder ProviderModelFamily = "kat-coder"
const ProviderModelFamilyKimi ProviderModelFamily = "kimi"
const ProviderModelFamilyKimiFree ProviderModelFamily = "kimi-free"
const ProviderModelFamilyKimiK2 ProviderModelFamily = "kimi-k2"
const ProviderModelFamilyKimiK3 ProviderModelFamily = "kimi-k3"
const ProviderModelFamilyKimiThinking ProviderModelFamily = "kimi-thinking"
const ProviderModelFamilyLaguna ProviderModelFamily = "laguna"
const ProviderModelFamilyLagunaS ProviderModelFamily = "laguna-s"
const ProviderModelFamilyLing ProviderModelFamily = "ling"
const ProviderModelFamilyLingFlashFree ProviderModelFamily = "ling-flash-free"
const ProviderModelFamilyLiquid ProviderModelFamily = "liquid"
const ProviderModelFamilyLlama ProviderModelFamily = "llama"
const ProviderModelFamilyLlava ProviderModelFamily = "llava"
const ProviderModelFamilyLongcat ProviderModelFamily = "longcat"
const ProviderModelFamilyLucid ProviderModelFamily = "lucid"
const ProviderModelFamilyLyria ProviderModelFamily = "lyria"
const ProviderModelFamilyM2M ProviderModelFamily = "m2m"
const ProviderModelFamilyMagistral ProviderModelFamily = "magistral"
const ProviderModelFamilyMagistralMedium ProviderModelFamily = "magistral-medium"
const ProviderModelFamilyMagistralSmall ProviderModelFamily = "magistral-small"
const ProviderModelFamilyMai ProviderModelFamily = "mai"
const ProviderModelFamilyMelotts ProviderModelFamily = "melotts"
const ProviderModelFamilyMercury ProviderModelFamily = "mercury"
const ProviderModelFamilyMimo ProviderModelFamily = "mimo"
const ProviderModelFamilyMimoFlashFree ProviderModelFamily = "mimo-flash-free"
const ProviderModelFamilyMimoOmni ProviderModelFamily = "mimo-omni"
const ProviderModelFamilyMimoOmniFree ProviderModelFamily = "mimo-omni-free"
const ProviderModelFamilyMimoPro ProviderModelFamily = "mimo-pro"
const ProviderModelFamilyMimoProFree ProviderModelFamily = "mimo-pro-free"
const ProviderModelFamilyMimoV25 ProviderModelFamily = "mimo-v2.5"
const ProviderModelFamilyMimoV25Free ProviderModelFamily = "mimo-v2.5-free"
const ProviderModelFamilyMimoV25Pro ProviderModelFamily = "mimo-v2.5-pro"
const ProviderModelFamilyMimoV26Flash ProviderModelFamily = "mimo-v2.6-flash"
const ProviderModelFamilyMimoV26Pro ProviderModelFamily = "mimo-v2.6-pro"
const ProviderModelFamilyMimoV2Omni ProviderModelFamily = "mimo-v2-omni"
const ProviderModelFamilyMimoV2Pro ProviderModelFamily = "mimo-v2-pro"
const ProviderModelFamilyMinimax ProviderModelFamily = "minimax"
const ProviderModelFamilyMinimaxFree ProviderModelFamily = "minimax-free"
const ProviderModelFamilyMinimaxM2 ProviderModelFamily = "minimax-m2"
const ProviderModelFamilyMinimaxM21 ProviderModelFamily = "minimax-m2.1"
const ProviderModelFamilyMinimaxM25 ProviderModelFamily = "minimax-m2.5"
const ProviderModelFamilyMinimaxM27 ProviderModelFamily = "minimax-m2.7"
const ProviderModelFamilyMinimaxM3 ProviderModelFamily = "minimax-m3"
const ProviderModelFamilyMinimaxM3Free ProviderModelFamily = "minimax-m3-free"
const ProviderModelFamilyMinistral ProviderModelFamily = "ministral"
const ProviderModelFamilyMistral ProviderModelFamily = "mistral"
const ProviderModelFamilyMistralEmbed ProviderModelFamily = "mistral-embed"
const ProviderModelFamilyMistralLarge ProviderModelFamily = "mistral-large"
const ProviderModelFamilyMistralMedium ProviderModelFamily = "mistral-medium"
const ProviderModelFamilyMistralNemo ProviderModelFamily = "mistral-nemo"
const ProviderModelFamilyMistralSmall ProviderModelFamily = "mistral-small"
const ProviderModelFamilyMixtral ProviderModelFamily = "mixtral"
const ProviderModelFamilyMmPoly ProviderModelFamily = "mm-poly"
const ProviderModelFamilyModelRouter ProviderModelFamily = "model-router"
const ProviderModelFamilyMorph ProviderModelFamily = "morph"
const ProviderModelFamilyMuse ProviderModelFamily = "muse"
const ProviderModelFamilyNanoBanana ProviderModelFamily = "nano-banana"
const ProviderModelFamilyNemoretriever ProviderModelFamily = "nemoretriever"
const ProviderModelFamilyNemotron ProviderModelFamily = "nemotron"
const ProviderModelFamilyNemotronFree ProviderModelFamily = "nemotron-free"
const ProviderModelFamilyNeuralChat ProviderModelFamily = "neural-chat"
const ProviderModelFamilyNexN2 ProviderModelFamily = "nex-n2"
const ProviderModelFamilyNorth ProviderModelFamily = "north"
const ProviderModelFamilyNorthFree ProviderModelFamily = "north-free"
const ProviderModelFamilyNousresearch ProviderModelFamily = "nousresearch"
const ProviderModelFamilyNova ProviderModelFamily = "nova"
const ProviderModelFamilyNovaLite ProviderModelFamily = "nova-lite"
const ProviderModelFamilyNovaMicro ProviderModelFamily = "nova-micro"
const ProviderModelFamilyNovaPro ProviderModelFamily = "nova-pro"
const ProviderModelFamilyO ProviderModelFamily = "o"
const ProviderModelFamilyOMini ProviderModelFamily = "o-mini"
const ProviderModelFamilyOPro ProviderModelFamily = "o-pro"
const ProviderModelFamilyOpenchat ProviderModelFamily = "openchat"
const ProviderModelFamilyOpengvlab ProviderModelFamily = "opengvlab"
const ProviderModelFamilyOpenpangu ProviderModelFamily = "openpangu"
const ProviderModelFamilyOrnith ProviderModelFamily = "ornith"
const ProviderModelFamilyOsmosis ProviderModelFamily = "osmosis"
const ProviderModelFamilyOswe ProviderModelFamily = "oswe"
const ProviderModelFamilyPalmyra ProviderModelFamily = "palmyra"
const ProviderModelFamilyPangu ProviderModelFamily = "pangu"
const ProviderModelFamilyParakeet ProviderModelFamily = "parakeet"
const ProviderModelFamilyPhi ProviderModelFamily = "phi"
const ProviderModelFamilyPhoenix ProviderModelFamily = "phoenix"
const ProviderModelFamilyPixtral ProviderModelFamily = "pixtral"
const ProviderModelFamilyPlamo ProviderModelFamily = "plamo"
const ProviderModelFamilyPony ProviderModelFamily = "pony"
const ProviderModelFamilyQvq ProviderModelFamily = "qvq"
const ProviderModelFamilyQwen ProviderModelFamily = "qwen"
const ProviderModelFamilyQwen35 ProviderModelFamily = "qwen3.5"
const ProviderModelFamilyQwen36 ProviderModelFamily = "qwen3.6"
const ProviderModelFamilyQwen37Flash ProviderModelFamily = "qwen3.7-flash"
const ProviderModelFamilyQwen37Max ProviderModelFamily = "qwen3.7-max"
const ProviderModelFamilyQwen37Plus ProviderModelFamily = "qwen3.7-plus"
const ProviderModelFamilyQwen38Max ProviderModelFamily = "qwen3.8-max"
const ProviderModelFamilyQwenFree ProviderModelFamily = "qwen-free"
const ProviderModelFamilyQwerky ProviderModelFamily = "qwerky"
const ProviderModelFamilyRay ProviderModelFamily = "ray"
const ProviderModelFamilyRecraft ProviderModelFamily = "recraft"
const ProviderModelFamilyRednote ProviderModelFamily = "rednote"
const ProviderModelFamilyReka ProviderModelFamily = "reka"
const ProviderModelFamilyResnet ProviderModelFamily = "resnet"
const ProviderModelFamilyRing ProviderModelFamily = "ring"
const ProviderModelFamilyRing1TFree ProviderModelFamily = "ring-1t-free"
const ProviderModelFamilyRnj ProviderModelFamily = "rnj"
const ProviderModelFamilyRunway ProviderModelFamily = "runway"
const ProviderModelFamilySarvam ProviderModelFamily = "sarvam"
const ProviderModelFamilySeed ProviderModelFamily = "seed"
const ProviderModelFamilySensenova ProviderModelFamily = "sensenova"
const ProviderModelFamilySherlock ProviderModelFamily = "sherlock"
const ProviderModelFamilySkywork ProviderModelFamily = "skywork"
const ProviderModelFamilySmartTurn ProviderModelFamily = "smart-turn"
const ProviderModelFamilySolar ProviderModelFamily = "solar"
const ProviderModelFamilySolarMini ProviderModelFamily = "solar-mini"
const ProviderModelFamilySolarPro ProviderModelFamily = "solar-pro"
const ProviderModelFamilySonar ProviderModelFamily = "sonar"
const ProviderModelFamilySonarDeepResearch ProviderModelFamily = "sonar-deep-research"
const ProviderModelFamilySonarPro ProviderModelFamily = "sonar-pro"
const ProviderModelFamilySonarReasoning ProviderModelFamily = "sonar-reasoning"
const ProviderModelFamilySora ProviderModelFamily = "sora"
const ProviderModelFamilySourceful ProviderModelFamily = "sourceful"
const ProviderModelFamilySparkX2 ProviderModelFamily = "spark-x2"
const ProviderModelFamilySqlcoder ProviderModelFamily = "sqlcoder"
const ProviderModelFamilyStableDiffusion ProviderModelFamily = "stable-diffusion"
const ProviderModelFamilyStarling ProviderModelFamily = "starling"
const ProviderModelFamilyStep ProviderModelFamily = "step"
const ProviderModelFamilyTako ProviderModelFamily = "tako"
const ProviderModelFamilyTextEmbedding ProviderModelFamily = "text-embedding"
const ProviderModelFamilyTitan ProviderModelFamily = "titan"
const ProviderModelFamilyTitanEmbed ProviderModelFamily = "titan-embed"
const ProviderModelFamilyTngtech ProviderModelFamily = "tngtech"
const ProviderModelFamilyTopazlabs ProviderModelFamily = "topazlabs"
const ProviderModelFamilyTrinity ProviderModelFamily = "trinity"
const ProviderModelFamilyTrinityMini ProviderModelFamily = "trinity-mini"
const ProviderModelFamilyTstars ProviderModelFamily = "tstars"
const ProviderModelFamilyUnaCybertron ProviderModelFamily = "una-cybertron"
const ProviderModelFamilyUnsloth ProviderModelFamily = "unsloth"
const ProviderModelFamilyV0 ProviderModelFamily = "v0"
const ProviderModelFamilyVenice ProviderModelFamily = "venice"
const ProviderModelFamilyVeo ProviderModelFamily = "veo"
const ProviderModelFamilyVoxtral ProviderModelFamily = "voxtral"
const ProviderModelFamilyVoyage ProviderModelFamily = "voyage"
const ProviderModelFamilyWhisper ProviderModelFamily = "whisper"
const ProviderModelFamilyYi ProviderModelFamily = "yi"
const ProviderModelFamilyZephyr ProviderModelFamily = "zephyr"
type ProviderModelInterleaved_1 ¶
type ProviderModelInterleaved_1 struct {
// Field corresponds to the JSON schema field "field".
Field ProviderModelInterleaved_1Field `json:"field"`
}
type ProviderModelInterleaved_1Field ¶
type ProviderModelInterleaved_1Field string
const ProviderModelInterleaved_1FieldReasoningContent ProviderModelInterleaved_1Field = "reasoning_content"
const ProviderModelInterleaved_1FieldReasoningDetails ProviderModelInterleaved_1Field = "reasoning_details"
type ProviderModelLimit ¶
type ProviderModelLimit struct {
// Maximum context window in tokens.
Context int `json:"context"`
// Maximum input length in tokens when separately documented.
Input *int `json:"input,omitempty"`
// Maximum output length in tokens when documented.
Output *int `json:"output,omitempty"`
}
Token limits exposed by this provider model endpoint.
type ProviderModelModalities ¶
type ProviderModelModalities struct {
// Input modalities accepted by the model.
Input []ProviderModelModalitiesInputElem `json:"input"`
// Output modalities produced by the model.
Output []ProviderModelModalitiesOutputElem `json:"output"`
}
Input and output modalities exposed by this model endpoint.
type ProviderModelModalitiesInputElem ¶
type ProviderModelModalitiesInputElem string
const ProviderModelModalitiesInputElemAudio ProviderModelModalitiesInputElem = "audio"
const ProviderModelModalitiesInputElemImage ProviderModelModalitiesInputElem = "image"
const ProviderModelModalitiesInputElemPdf ProviderModelModalitiesInputElem = "pdf"
const ProviderModelModalitiesInputElemText ProviderModelModalitiesInputElem = "text"
const ProviderModelModalitiesInputElemVideo ProviderModelModalitiesInputElem = "video"
type ProviderModelModalitiesOutputElem ¶
type ProviderModelModalitiesOutputElem string
const ProviderModelModalitiesOutputElemAudio ProviderModelModalitiesOutputElem = "audio"
const ProviderModelModalitiesOutputElemImage ProviderModelModalitiesOutputElem = "image"
const ProviderModelModalitiesOutputElemPdf ProviderModelModalitiesOutputElem = "pdf"
const ProviderModelModalitiesOutputElemText ProviderModelModalitiesOutputElem = "text"
const ProviderModelModalitiesOutputElemVideo ProviderModelModalitiesOutputElem = "video"
type ProviderModelProvider ¶
type ProviderModelProvider struct {
// API corresponds to the JSON schema field "api".
API *string `json:"api,omitempty"`
// Body corresponds to the JSON schema field "body".
Body ProviderModelProviderBody `json:"body,omitempty"`
// Headers corresponds to the JSON schema field "headers".
Headers ProviderModelProviderHeaders `json:"headers,omitempty"`
// NPM corresponds to the JSON schema field "npm".
NPM *string `json:"npm,omitempty"`
// Shape corresponds to the JSON schema field "shape".
Shape *ProviderModelProviderShape `json:"shape,omitempty"`
}
type ProviderModelProviderShape ¶
type ProviderModelProviderShape string
const ProviderModelProviderShapeCompletions ProviderModelProviderShape = "completions"
const ProviderModelProviderShapeResponses ProviderModelProviderShape = "responses"
type ProviderModelStatus ¶
type ProviderModelStatus string
const ProviderModelStatusAlpha ProviderModelStatus = "alpha"
const ProviderModelStatusBeta ProviderModelStatus = "beta"
const ProviderModelStatusDeprecated ProviderModelStatus = "deprecated"
type ProviderModels ¶
type ProviderModels map[string]ProviderModel
type ProviderPlansCNElem ¶
type ProviderPlansCNElem struct {
// Name corresponds to the JSON schema field "name".
Name string `json:"name"`
// PriceMonth corresponds to the JSON schema field "price_month".
PriceMonth float64 `json:"price_month"`
// QuotaWindows corresponds to the JSON schema field "quota_windows".
QuotaWindows []string `json:"quota_windows,omitempty"`
// Usage corresponds to the JSON schema field "usage".
Usage *string `json:"usage,omitempty"`
}
type ProviderProtocol ¶
type ProviderProtocol string
const ProviderProtocolAnthropicCompatible ProviderProtocol = "anthropic-compatible"
const ProviderProtocolOpenaiCompatible ProviderProtocol = "openai-compatible"
const ProviderProtocolOpenaiResponses ProviderProtocol = "openai-responses"
type RawUsage ¶ added in v0.5.0
type RawUsage struct {
UncachedInput int64
CacheReadInput int64
CacheWriteInput int64
OutputTokens int64
ReasoningOutput int64
}
RawUsage bills an explicitly decomposed request when none of the protocol helpers fits, for example after aggregating usage yourself.
type ReasoningOption ¶
type ReasoningOption struct {
// Default reasoning effort when the provider documents one.
Default interface{} `json:"default,omitempty"`
// Provider endpoint IDs where this reasoning control applies.
Endpoints []string `json:"endpoints,omitempty"`
// Request body field used by this reasoning control.
Field *string `json:"field,omitempty"`
// Maximum reasoning token budget.
Max *int `json:"max,omitempty"`
// Minimum reasoning token budget; -1 may represent automatic allocation.
Min *int `json:"min,omitempty"`
// Type corresponds to the JSON schema field "type".
Type string `json:"type"`
// Supported reasoning effort values; JSON null disables reasoning when supported.
Values []interface{} `json:"values,omitempty"`
}
Provider-specific reasoning control; type discriminates toggle, effort and token-budget forms.
type ReasoningOption_0 ¶
type ReasoningOption_0 struct {
// Provider endpoint IDs where this reasoning control applies.
Endpoints []string `json:"endpoints,omitempty"`
// Request body field used by this reasoning control.
Field *string `json:"field,omitempty"`
// Type corresponds to the JSON schema field "type".
Type string `json:"type"`
}
type ReasoningOption_1 ¶
type ReasoningOption_1 struct {
// Default reasoning effort when the provider documents one.
Default interface{} `json:"default,omitempty"`
// Provider endpoint IDs where this reasoning control applies.
Endpoints []string `json:"endpoints,omitempty"`
// Request body field used by this reasoning control.
Field *string `json:"field,omitempty"`
// Type corresponds to the JSON schema field "type".
Type string `json:"type"`
// Supported reasoning effort values; JSON null disables reasoning when supported.
Values []interface{} `json:"values"`
}
type ReasoningOption_1Default_0 ¶
type ReasoningOption_1Default_0 string
const ReasoningOption_1Default_0_High ReasoningOption_1Default_0 = "high"
const ReasoningOption_1Default_0_Low ReasoningOption_1Default_0 = "low"
const ReasoningOption_1Default_0_Max ReasoningOption_1Default_0 = "max"
const ReasoningOption_1Default_0_Medium ReasoningOption_1Default_0 = "medium"
const ReasoningOption_1Default_0_Minimal ReasoningOption_1Default_0 = "minimal"
const ReasoningOption_1Default_0_None ReasoningOption_1Default_0 = "none"
const ReasoningOption_1Default_0_Xhigh ReasoningOption_1Default_0 = "xhigh"
type ReasoningOption_1ValuesElem_0 ¶
type ReasoningOption_1ValuesElem_0 string
const ReasoningOption_1ValuesElem_0_High ReasoningOption_1ValuesElem_0 = "high"
const ReasoningOption_1ValuesElem_0_Low ReasoningOption_1ValuesElem_0 = "low"
const ReasoningOption_1ValuesElem_0_Max ReasoningOption_1ValuesElem_0 = "max"
const ReasoningOption_1ValuesElem_0_Medium ReasoningOption_1ValuesElem_0 = "medium"
const ReasoningOption_1ValuesElem_0_Minimal ReasoningOption_1ValuesElem_0 = "minimal"
const ReasoningOption_1ValuesElem_0_None ReasoningOption_1ValuesElem_0 = "none"
const ReasoningOption_1ValuesElem_0_Xhigh ReasoningOption_1ValuesElem_0 = "xhigh"
type ReasoningOption_2 ¶
type ReasoningOption_2 struct {
// Provider endpoint IDs where this reasoning control applies.
Endpoints []string `json:"endpoints,omitempty"`
// Request body field used by this reasoning control.
Field *string `json:"field,omitempty"`
// Maximum reasoning token budget.
Max *int `json:"max,omitempty"`
// Minimum reasoning token budget; -1 may represent automatic allocation.
Min *int `json:"min,omitempty"`
// Type corresponds to the JSON schema field "type".
Type string `json:"type"`
}
type SchemaMetadata ¶
type SchemaMetadata struct {
Package string `json:"package"`
PackageVersion string `json:"package_version"`
SchemaVersion int `json:"schema_version"`
SchemaSHA256 string `json:"schema_sha256"`
SourceRevision string `json:"source_revision"`
}
func SchemaInfo ¶
func SchemaInfo() SchemaMetadata
type Snapshot ¶
type Snapshot struct {
Manifest Manifest
Catalog Catalog
// contains filtered or unexported fields
}
Snapshot is one immutable, verified ModelLink catalog version.
func (*Snapshot) Cost ¶ added in v0.5.0
func (snapshot *Snapshot) Cost(query CostQuery) (CostResult, bool, error)
Cost prices one request against the snapshot data. It returns ok = false when the provider model is missing or has no price data. It returns an error when price data exists but cannot be applied reliably, for example a missing billing time or holiday resolver; in that case no price should be assumed.
func (*Snapshot) Model ¶
func (snapshot *Snapshot) Model(id string) (ModelMetadata, bool)
Model returns canonical base-model metadata by its globally unique ID.
func (*Snapshot) ProviderModel ¶
func (snapshot *Snapshot) ProviderModel( providerID string, modelID string, ) (ProviderModel, bool)
ProviderModel returns one concrete model offered by a provider. modelID is the provider's callable model identifier.
type Stage ¶ added in v0.3.0
type Stage string
Stage identifies one measured phase of an operation. A phase may occur more than once; an absent phase was not executed by this operation.
type StageReport ¶ added in v0.3.0
StageReport measures one phase, excluding time attributed to nested phases. Reports are ordered by phase start time, not aggregated by Stage.
type UpdateState ¶ added in v0.3.0
type UpdateState struct {
// UpdatedAt is set in the cache activation transaction, only on version change.
UpdatedAt time.Time `json:"updated_at"`
// PreviousVersion is empty for the first activation.
PreviousVersion string `json:"previous_version"`
CurrentVersion string `json:"current_version"`
}
UpdateState records the last actual change of the shared active pointer.
type UpdateStatus ¶
type UpdateStatus struct {
CurrentVersion string
LatestVersion string
UpdateAvailable bool
RegistryBehind bool
// CheckedAt is the UTC successful lookup time, or zero if lookup failed.
// It may be populated alongside an error if persisting the check failed.
CheckedAt time.Time
// Duration covers CheckLatest including metadata persistence, excluding the
// OnOperation callback. It is not persisted in CacheState.
Duration time.Duration
}
UpdateStatus compares the active snapshot with the registry latest version.
type Warning ¶
type Warning struct {
Code WarningCode
Message string
DataPackageVersion string
DataSchemaVersion int
DataSchemaSHA256 string
EmbeddedPackageVersion string
EmbeddedSchemaVersion int
EmbeddedSchemaSHA256 string
CurrentVersion string
RegistryVersion string
}
Warning describes an actionable, non-fatal compatibility condition.
type WarningCode ¶
type WarningCode string
WarningCode identifies a non-fatal condition found while loading data.
const ( // WarningSchemaSDKOutdated means the loaded data uses a newer Schema than // the one used to generate this SDK's public Go types. WarningSchemaSDKOutdated WarningCode = "schema_sdk_outdated" // WarningSchemaDataOutdated means the loaded data uses an older Schema than // the one embedded in this SDK. WarningSchemaDataOutdated WarningCode = "schema_data_outdated" // WarningSchemaMismatch means the two Schema hashes differ but their package // versions do not establish which copy is newer. WarningSchemaMismatch WarningCode = "schema_mismatch" // WarningRegistryBehind means the registry latest version is older than the // active local version and automatic downgrade was prevented. WarningRegistryBehind WarningCode = "registry_behind" // WarningSchemaUpdateSkipped means a future Schema package could not be // decoded, so LoadLatest retained the active compatible snapshot instead. WarningSchemaUpdateSkipped WarningCode = "schema_update_skipped" )
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
examples
|
|
|
basic
command
|
|
|
cost
command
|
|
|
file-cache
command
|
|
|
observability
command
|
|
|
update
command
|
|
|
version-control
command
|
|
|
internal
|
|
|
atomicfile
Package atomicfile writes files through a same-directory temporary file and atomically replaces the destination where the operating system supports it.
|
Package atomicfile writes files through a same-directory temporary file and atomically replaces the destination where the operating system supports it. |
|
cmd/schemacheck
command
|
|
|
cmd/schemagen
command
|
|
|
cmd/schemasync
command
|
|
|
cmd/verifydata
command
|
|
|
trace
Package trace measures exclusive stage durations without exposing SDK types to the artifact transport.
|
Package trace measures exclusive stage durations without exposing SDK types to the artifact transport. |