Help us shape the future of Go! Take the 2026 Go Developer Survey

modellink

package module
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2026 License: MIT Imports: 20 Imported by: 0

README

ModelLink 官方 Go 客户端,用于获取、校验、缓存和解析版本化的中国 AI 模型与服务商数据。

数据来自 @modellink/data,运行时默认访问国内的 npmmirror。客户端不依赖 Node.js,也不会执行 npm 包中的任何脚本。

安装

go get github.com/goroutined/modellink-go

按需求选择

需求 从哪里开始
读取当前模型目录 examples/basic
检查并更新数据 examples/update
审核并切换指定版本 examples/version-control
修改缓存目录和保留数量 examples/file-cache
接入 Redis 或对象存储 自定义缓存
维护 Schema 和生成类型 Schema 与代码生成

大多数应用只需要 New、Load 和 Snapshot 查询方法,不需要了解缓存接口或 Schema 生成过程。

快速开始

package main

import (
    "context"
    "fmt"
    "log"

    modellink "github.com/goroutined/modellink-go"
)

func main() {
    client, err := modellink.New(modellink.Options{})
    if err != nil {
        log.Fatal(err)
    }

    // 本地已有已校验版本时不访问网络;首次使用时下载最新版。
    snapshot, err := client.Load(context.Background())
    if err != nil {
        log.Fatal(err)
    }

    model, ok := snapshot.ProviderModel("deepseek", "deepseek-v4-pro")
    if !ok {
        log.Fatal("model not found")
    }
    fmt.Printf("%s: context=%d\n", model.Name, model.Limit.Context)
}

Snapshot 还提供:

snapshot.Model("deepseek/deepseek-v4-pro")
snapshot.Provider("deepseek")
snapshot.ProviderModel("deepseek", "deepseek-v4-pro")
查询方法 返回内容
Model 研发机构发布的基础模型元数据
Provider 服务商及其完整可调用模型目录
ProviderModel 指定服务商下可调用模型的价格、协议和限制

也可以直接访问完整的强类型目录:

snapshot.Catalog.Models
snapshot.Catalog.Providers
snapshot.Manifest
snapshot.Schema()
snapshot.File(modellink.FileCatalog) // npm 包内经过哈希校验的原始字节

返回的 Snapshot 会在进程内共享,请将其视为只读数据。

Client 功能地图

公开方法分成底层能力、版本组合和加载入口。下载地址、npm tarball 和存储过程都隐藏在 Client 内部:

flowchart BT
    subgraph P["底层能力"]
        CV["CurrentVersion<br/>读取当前版本"]
        LC["LoadCached<br/>读取当前缓存"]
        FL["FindLatest<br/>查询 Registry"]
        AV["ActivateVersion<br/>激活已缓存版本"]
    end

    subgraph C["版本组合"]
        LV["LoadVersion<br/>加载指定版本"]
        CL["CheckLatest<br/>检查最新版本"]
        SV["SwitchVersion<br/>切换指定版本"]
    end

    subgraph H["加载入口"]
        LL["LoadLatest<br/>防降级加载最新版"]
        LD["Load<br/>缓存优先加载"]
    end

    CV --> CL
    FL --> CL
    LV --> SV
    AV --> SV
    CL --> LL
    SV --> LL
    LC --> LD
    LL --> LD

返回值遵循固定规则:

  • Current、Find、Check 返回轻量状态。
  • Activate、Switch 执行动作,只返回 error。
  • 只有 Load* 返回 *Snapshot。

完整函数签名:

CurrentVersion(ctx context.Context) (string, error)
FindLatest(ctx context.Context) (string, error)
CheckLatest(ctx context.Context) (modellink.UpdateStatus, error)

ActivateVersion(ctx context.Context, version string) error
SwitchVersion(ctx context.Context, version string) error

LoadCached(ctx context.Context) (*modellink.Snapshot, error)
LoadVersion(ctx context.Context, version string) (*modellink.Snapshot, error)
LoadLatest(ctx context.Context) (*modellink.Snapshot, error)
Load(ctx context.Context) (*modellink.Snapshot, error)
行为对照
方法 Registry 写缓存 修改 current 返回内容
CurrentVersion 否 否 否 当前版本号
FindLatest 只查询元数据 否 否 Registry 最新版本号
CheckLatest 只查询元数据 否 否 版本比较状态
ActivateVersion 否 否 是 error
SwitchVersion 缓存未命中时访问 可能 是 error
LoadCached 否 否 否 当前 Snapshot
LoadVersion 缓存未命中时访问 可能 否 指定版本 Snapshot
LoadLatest 是 可能 是 安全的最新 Snapshot
Load 仅无有效缓存时 可能 可能 当前可用 Snapshot

LoadCached 是本地只读调用,不发生网络阻塞,但 Go 的同步文件读取仍可能产生短暂磁盘等待。

加载与版本控制

缓存优先

Load 先读取当前有效缓存,不检查更新;只有没有可用缓存时才阻塞调用 LoadLatest:

snapshot, err := client.Load(ctx)
明确要求最新

LoadLatest 每次都会检查 Registry。Registry 较新或当前无版本时切换到最新版本; Registry 暂时落后时保持本地较新版本并产生 WarningRegistryBehind:

snapshot, err := client.LoadLatest(ctx)
完全本地启动
snapshot, err := client.LoadCached(ctx)
if errors.Is(err, modellink.ErrNoCachedData) {
    // 使用应用自身随程序发布的 fallback 数据,并在后台调用 LoadLatest。
}
固定版本

LoadVersion 必要时下载并校验指定版本,但不修改 current:

snapshot, err := client.LoadVersion(ctx, "0.1.4")
审核后切换
version, err := client.FindLatest(ctx)
candidate, err := client.LoadVersion(ctx, version)

// 检查 candidate 后,显式激活已经缓存的版本。
err = client.ActivateVersion(ctx, version)
active, err := client.LoadCached(ctx)

简化为一步切换指定版本:

err := client.SwitchVersion(ctx, "0.1.4")

SwitchVersion 是显式操作,因此允许开发者主动升级或降级;自动执行的 LoadLatest 始终禁止降级。

检查最新版本

status, err := client.CheckLatest(ctx)
if err != nil {
    return err
}
if status.UpdateAvailable {
    snapshot, err = client.LoadLatest(ctx)
}
if status.RegistryBehind {
    // Registry 镜像暂时落后,本地版本不会被自动降级。
}

Schema 兼容性提醒

SDK 会在每次加载后,本地比较数据包 manifest.json 中的 Schema 版本与 SHA-256, 不会为此增加网络请求:

  • 数据使用更高的破坏性 Schema 版本时返回 ErrUnsupportedSchema,不切换当前缓存。
  • Schema 哈希不一致但仍可解析时继续返回 Snapshot,并产生非阻断 warning。
  • 仅 npm 数据版本不同、Schema 哈希相同时不会产生 warning。

库默认不主动写日志。Schema 漂移和 Registry 落后等非阻断事件可以通过 OnWarning 接入自己的日志或监控:

client, err := modellink.New(modellink.Options{
    OnWarning: func(warning modellink.Warning) {
        slog.Warn(warning.Message, "code", warning.Code)
    },
})

与 Snapshot 数据本身相关的 warning 也会保留在 Snapshot 中:

snapshot, err := client.Load(ctx)
for _, warning := range snapshot.Warnings() {
    // 写入日志、监控或运维状态页
}

同一个 Client 对同一事件只调用一次 OnWarning,重复或并发调用不会刷屏。显式加载 旧数据时会建议更新数据;数据 Schema 较新时会建议升级 modellink-go。

缓存与并发

默认缓存目录由 os.UserCacheDir() 决定:

系统 默认目录
Linux $XDG_CACHE_HOME/modellink 或 ~/.cache/modellink
macOS ~/Library/Caches/modellink
Windows %LocalAppData%\\modellink

需要指定共享目录时,创建文件缓存并传给 Client:

cache, err := modellink.NewFileCache(modellink.FileCacheOptions{
    Directory: "/var/cache/my-service/modellink",
})
if err != nil {
    return err
}

client, err := modellink.New(modellink.Options{
    Cache: cache,
})

文件缓存默认保留当前版本和最近一个其他版本,总计最多两个版本。只修改保留数量、 继续使用系统默认目录:

cache, err := modellink.NewFileCache(modellink.FileCacheOptions{
    MaxVersions: 5,
})

同时修改目录和保留数量:

cache, err := modellink.NewFileCache(modellink.FileCacheOptions{
    Directory:   "/var/cache/my-service/modellink",
    MaxVersions: 5,
})

MaxVersions 至少为 2;设置为 -1 可以保留全部历史版本。自动清理只在下载或切换版本时执行, 不会启动后台 goroutine;当前版本和本次操作使用的版本不会被删除。

  • 多个 goroutine 同时请求同一个版本时,只下载一次,其余调用等待同一结果。
  • 多个进程使用同一文件缓存时,通过带超时的系统文件锁共享下载与更新结果。
  • 已有可用缓存时,Load 不等待正在进行的更新。
  • 下载先写入独立临时目录;npm integrity、Manifest SHA-256、Schema 版本和 JSON 解析全部通过后才原子安装。
  • 更新失败不会覆盖当前可用版本。
  • 文件锁覆盖查询、下载、校验和激活的完整流程;进程退出后由操作系统自动释放。
  • 调用方取消等待不会取消其他 goroutine 已经共享的下载任务。
自定义缓存

Options 只接收一个 Cache。它同时负责版本化数据存储和共享更新互斥:

type Cache interface {
    CacheStore
    Locker
}

因此 Redis 实现通常只需要配置一次:

client, err := modellink.New(modellink.Options{
    Cache: redisCache,
})

自定义缓存需要实现:

type CacheStore interface {
    Current(ctx context.Context) (string, error)
    Get(ctx context.Context, version string) (*modellink.CacheEntry, error)
    Put(ctx context.Context, entry *modellink.CacheEntry) error
    SetCurrent(ctx context.Context, version string) error
}

type Locker interface {
    Lock(ctx context.Context, key string) (modellink.Lock, error)
}

Put 必须原子发布完整版本,不能让读取方看到部分文件;找不到数据时返回 modellink.ErrNoCachedData。客户端仍会重新校验 Manifest、文件哈希、Schema 版本并解析 JSON,缓存实现不能绕过数据完整性检查。

如果数据和锁位于不同系统,例如对象存储配 Redis 锁,可以组合为一个缓存:

cache, err := modellink.NewCache(objectStore, redisLocker)
if err != nil {
    return err
}
client, err := modellink.New(modellink.Options{Cache: cache})

Redis 锁实现应使用唯一持有者 token 安全解锁,并处理锁租期和续租;不能仅使用 一个无法确认持有者的 SETNX 键。等待锁时必须遵守传入的 context。

默认 Registry:

https://registry.npmmirror.com

可以切换到 npm 官方源或内部镜像:

client, err := modellink.New(modellink.Options{
    Registry: "https://registry.npmjs.org",
})

可选字段

生成类型会保留公开 Schema 的可选性。例如:

model.Temperature == nil                         // 未知
model.Temperature != nil && !*model.Temperature // 明确不支持或固定不可调
model.Temperature != nil && *model.Temperature  // 明确支持调节

不要把缺失字段自动当成 false,也不要根据上下文窗口推导缺失的最大输入或输出长度。

Schema 与代码生成

当前内嵌 Schema v2,来源于 @modellink/data 0.2.1,同时兼容 Schema v1 数据。 Provider 的可选 Links 提供 Models(模型目录)、Pricing(价格/套餐)、 APIKey(申请和接入指引)、Console(管理后台)。使用前检查 provider.Links != nil 及具体字段是否为 nil;旧数据或未提供的入口保持缺省。原 Doc 文档入口仍保留。

仓库保存了生成依据:

schema/schema.json
schema/schema.lock.json
zz_types_generated.go

schema.lock.json 记录 npm 包版本、Schema 版本、SHA-256 和 ModelLink 源 commit。

更新过程是手动触发的:

# 从 npm 官方源同步最新 Schema 和锁文件
go run ./internal/cmd/schemasync

# 只根据仓库内 Schema 重新生成 Go 类型,不拉取 ModelLink 数据
go generate ./...

go test ./...

也可以同步指定版本或指定 Registry:

go run ./internal/cmd/schemasync -version 0.1.3
go run ./internal/cmd/schemasync -registry https://registry.npmmirror.com

CI 会强制检查已提交 Schema 与生成代码是否一致。npm 最新数据包中的 Schema 版本或内容发生变化时只给出提示,不阻止 Pull Request;仅模型数据更新不会触发提示:

go run ./internal/cmd/schemacheck

当前客户端支持的破坏性 Schema 版本由 modellink.SupportedSchemaVersion 表示。遇到更高版本时客户端会返回 modellink.ErrUnsupportedSchema,并继续保留旧缓存。

仓库结构

根目录保持单一的 modellink package,外部项目始终只需要一个 import。文件按职责 拆分,目录并不代表额外的公共子包:

client.go              Client、Options 和公共版本结构
client_api.go          完整公开 Client API 与语义注释
client_load.go         缓存读取、固定版本和激活实现
client_update.go       Registry 查询、防降级和并发协调
snapshot.go            Model、Provider、ProviderModel 查询
warning.go             Schema 兼容性警告与版本方向判断

cache.go               Cache、CacheStore 和 Locker 接口
cache_file.go          默认文件缓存和原子读写
cache_file_lock.go     跨进程文件锁
cache_file_prune.go    缓存版本清理

schema.go              内嵌 Schema 和版本元数据
types_custom.go        手写的特殊 JSON 类型
zz_types_generated.go  Schema 自动生成类型,请勿手工修改

internal/artifact/     npm 下载、integrity 和文件哈希校验
internal/cmd/          Schema 同步、生成和检查命令
examples/              可直接运行的使用示例
schema/                生成依据和版本锁文件

修改公开数据类型时,应先更新 ModelLink 的 schema.json,然后同步 Schema 并重新运行 go generate ./...,不要直接编辑 zz_types_generated.go。

数据来源

License

MIT

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.

Index

Constants

View Source
const SupportedSchemaVersion = 2

Variables

View Source
var (
	ErrNoCachedData      = errors.New("modellink: no cached data")
	ErrUnsupportedSchema = errors.New("modellink: unsupported schema version")
	ErrLockTimeout       = errors.New("modellink: cache lock timeout")
)

Functions

func Schema

func Schema() []byte

Types

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.

func NewCache

func NewCache(store CacheStore, locker Locker) (Cache, error)

NewCache combines a store and locker into one Cache.

type CacheEntry

type CacheEntry struct {
	Version string
	Files   map[DataFile][]byte
}

CacheEntry is one immutable, versioned ModelLink data package. Files contain the verified JSON bytes published in @modellink/data.

type CachePruner

type CachePruner interface {
	Prune(ctx context.Context, protected ...string) error
}

CachePruner is an optional cache capability used after successful package operations. Custom caches may omit it and manage retention independently.

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(ctx context.Context, version string) error
}

CacheStore persists versioned packages and the currently active version. Put must publish an entry atomically: readers must never observe partial data.

type Catalog

type Catalog struct {
	// Models corresponds to the JSON schema field "models".
	Models Models `json:"models"`

	// Providers corresponds to the JSON schema field "providers".
	Providers Providers `json:"providers"`
}

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client loads verified, versioned ModelLink snapshots.

func New

func New(options Options) (*Client, error)

New creates a ModelLink client.

func (*Client) ActivateVersion

func (client *Client) ActivateVersion(ctx context.Context, version string) error

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) (UpdateStatus, error)

CheckLatest compares the active local version with the registry latest version without downloading data or changing the cache.

func (*Client) CurrentVersion

func (client *Client) CurrentVersion(ctx context.Context) (string, error)

CurrentVersion returns the active local version without accessing the registry. It returns ErrNoCachedData when no version has been activated.

func (*Client) FindLatest

func (client *Client) FindLatest(ctx context.Context) (string, error)

FindLatest queries the registry for its latest package version. It does not download data, write the cache or change the active version.

func (*Client) Load

func (client *Client) Load(ctx context.Context) (*Snapshot, error)

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

func (client *Client) LoadCached(ctx context.Context) (*Snapshot, error)

LoadCached returns the active verified local snapshot without accessing the registry. It returns ErrNoCachedData when no version has been activated.

func (*Client) LoadLatest

func (client *Client) LoadLatest(ctx context.Context) (*Snapshot, error)

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) (*Snapshot, error)

LoadVersion returns a verified explicit version without changing the active version. It downloads and caches the version when necessary.

func (*Client) SwitchVersion

func (client *Client) SwitchVersion(ctx context.Context, version string) error

SwitchVersion loads and activates an explicit version. This deliberate operation permits both upgrades and downgrades.

type DataFile

type DataFile string

DataFile identifies a JSON file published in @modellink/data.

const (
	FileAPI      DataFile = "api.json"
	FileModels   DataFile = "models.json"
	FileCatalog  DataFile = "catalog.json"
	FileSchema   DataFile = "schema.json"
	FileManifest DataFile = "manifest.json"
)

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) Current

func (cache *FileCache) Current(ctx context.Context) (string, error)

func (*FileCache) Directory

func (cache *FileCache) Directory() string

Directory returns the absolute cache directory.

func (*FileCache) Get

func (cache *FileCache) Get(ctx context.Context, version string) (*CacheEntry, error)

func (*FileCache) Lock

func (cache *FileCache) Lock(ctx context.Context, key string) (Lock, error)

func (*FileCache) Prune

func (cache *FileCache) Prune(ctx context.Context, protected ...string) error

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) Put

func (cache *FileCache) Put(ctx context.Context, entry *CacheEntry) error

func (*FileCache) SetCurrent

func (cache *FileCache) SetCurrent(ctx context.Context, version string) error

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 JSONValue

type JSONValue interface{}

type Lock

type Lock interface {
	Unlock() error
}

Lock is an acquired cache lock.

type Locker

type Locker interface {
	Lock(ctx context.Context, key string) (Lock, error)
}

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 ManifestFile struct {
	// SHA256 corresponds to the JSON schema field "sha256".
	SHA256 string `json:"sha256"`

	// Size corresponds to the JSON schema field "size".
	Size int `json:"size"`
}

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 ManifestSource struct {
	// Repository corresponds to the JSON schema field "repository".
	Repository string `json:"repository"`

	// Revision corresponds to the JSON schema field "revision".
	Revision string `json:"revision"`
}

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 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 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)
}

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"`

	// CreditsCN corresponds to the JSON schema field "credits_cn".
	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 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"`
}

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 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"`

	// 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"`

	// 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"`

	// 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"`

	// 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"`

	// 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"`

	// 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"`

	// Tier corresponds to the JSON schema field "tier".
	Tier ProviderModelCostCNTiersElemTier `json:"tier"`
}

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"`

	// 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 ProviderModelCostCNTiersElemTier

type ProviderModelCostCNTiersElemTier struct {
	// Input corresponds to the JSON schema field "input".
	Input *ProviderModelCostCNTiersElemTier_1Input `json:"input,omitempty"`

	// Label corresponds to the JSON schema field "label".
	Label *string `json:"label,omitempty"`

	// Output corresponds to the JSON schema field "output".
	Output *ProviderModelCostCNTiersElemTier_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 *ProviderModelCostCNTiersElemTier_1Time `json:"time,omitempty"`

	// Type corresponds to the JSON schema field "type".
	Type string `json:"type"`
}

type ProviderModelCostCNTiersElemTier_0

type ProviderModelCostCNTiersElemTier_0 struct {
	// Size corresponds to the JSON schema field "size".
	Size int `json:"size"`

	// Type corresponds to the JSON schema field "type".
	Type string `json:"type"`
}

type ProviderModelCostCNTiersElemTier_1

type ProviderModelCostCNTiersElemTier_1 struct {
	// Input corresponds to the JSON schema field "input".
	Input *ProviderModelCostCNTiersElemTier_1Input `json:"input,omitempty"`

	// Label corresponds to the JSON schema field "label".
	Label *string `json:"label,omitempty"`

	// Output corresponds to the JSON schema field "output".
	Output *ProviderModelCostCNTiersElemTier_1Output `json:"output,omitempty"`

	// Time corresponds to the JSON schema field "time".
	Time *ProviderModelCostCNTiersElemTier_1Time `json:"time,omitempty"`

	// Type corresponds to the JSON schema field "type".
	Type string `json:"type"`
}

type ProviderModelCostCNTiersElemTier_1Input

type ProviderModelCostCNTiersElemTier_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 ProviderModelCostCNTiersElemTier_1Output

type ProviderModelCostCNTiersElemTier_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 ProviderModelCostCNTiersElemTier_1Time

type ProviderModelCostCNTiersElemTier_1Time struct {
	// Timezone corresponds to the JSON schema field "timezone".
	Timezone string `json:"timezone"`

	// Windows corresponds to the JSON schema field "windows".
	Windows []ProviderModelCostCNTiersElemTier_1TimeWindowsElem `json:"windows"`
}

type ProviderModelCostCNTiersElemTier_1TimeWindowsElem

type ProviderModelCostCNTiersElemTier_1TimeWindowsElem struct {
	// Days corresponds to the JSON schema field "days".
	Days []ProviderModelCostCNTiersElemTier_1TimeWindowsElemDaysElem `json:"days,omitempty"`

	// End corresponds to the JSON schema field "end".
	End string `json:"end"`

	// Start corresponds to the JSON schema field "start".
	Start string `json:"start"`
}

type ProviderModelCostCNTiersElemTier_1TimeWindowsElemDaysElem

type ProviderModelCostCNTiersElemTier_1TimeWindowsElemDaysElem string
const ProviderModelCostCNTiersElemTier_1TimeWindowsElemDaysElemFriday ProviderModelCostCNTiersElemTier_1TimeWindowsElemDaysElem = "friday"
const ProviderModelCostCNTiersElemTier_1TimeWindowsElemDaysElemMonday ProviderModelCostCNTiersElemTier_1TimeWindowsElemDaysElem = "monday"
const ProviderModelCostCNTiersElemTier_1TimeWindowsElemDaysElemSaturday ProviderModelCostCNTiersElemTier_1TimeWindowsElemDaysElem = "saturday"
const ProviderModelCostCNTiersElemTier_1TimeWindowsElemDaysElemSunday ProviderModelCostCNTiersElemTier_1TimeWindowsElemDaysElem = "sunday"
const ProviderModelCostCNTiersElemTier_1TimeWindowsElemDaysElemThursday ProviderModelCostCNTiersElemTier_1TimeWindowsElemDaysElem = "thursday"
const ProviderModelCostCNTiersElemTier_1TimeWindowsElemDaysElemTuesday ProviderModelCostCNTiersElemTier_1TimeWindowsElemDaysElem = "tuesday"
const ProviderModelCostCNTiersElemTier_1TimeWindowsElemDaysElemWednesday ProviderModelCostCNTiersElemTier_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"`

	// 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"`

	// OffPeakMultiplier corresponds to the JSON schema field "off_peak_multiplier".
	OffPeakMultiplier *float64 `json:"off_peak_multiplier,omitempty"`

	// Output corresponds to the JSON schema field "output".
	Output float64 `json:"output"`

	// PeakWindow corresponds to the JSON schema field "peak_window".
	PeakWindow *ProviderModelCostPointsPeakWindow `json:"peak_window,omitempty"`

	// 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 ProviderModelCostPointsPeakWindow

type ProviderModelCostPointsPeakWindow struct {
	// Days corresponds to the JSON schema field "days".
	Days []ProviderModelCostPointsPeakWindowDaysElem `json:"days"`

	// End corresponds to the JSON schema field "end".
	End string `json:"end"`

	// Start corresponds to the JSON schema field "start".
	Start string `json:"start"`

	// Timezone corresponds to the JSON schema field "timezone".
	Timezone string `json:"timezone"`
}

type ProviderModelCostPointsPeakWindowDaysElem

type ProviderModelCostPointsPeakWindowDaysElem string
const ProviderModelCostPointsPeakWindowDaysElemFriday ProviderModelCostPointsPeakWindowDaysElem = "friday"
const ProviderModelCostPointsPeakWindowDaysElemMonday ProviderModelCostPointsPeakWindowDaysElem = "monday"
const ProviderModelCostPointsPeakWindowDaysElemSaturday ProviderModelCostPointsPeakWindowDaysElem = "saturday"
const ProviderModelCostPointsPeakWindowDaysElemSunday ProviderModelCostPointsPeakWindowDaysElem = "sunday"
const ProviderModelCostPointsPeakWindowDaysElemThursday ProviderModelCostPointsPeakWindowDaysElem = "thursday"
const ProviderModelCostPointsPeakWindowDaysElemTuesday ProviderModelCostPointsPeakWindowDaysElem = "tuesday"
const ProviderModelCostPointsPeakWindowDaysElemWednesday ProviderModelCostPointsPeakWindowDaysElem = "wednesday"

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"`

	// Output corresponds to the JSON schema field "output".
	Output float64 `json:"output"`

	// Tier corresponds to the JSON schema field "tier".
	Tier ProviderModelCostPointsTiersElemTier `json:"tier"`
}

type ProviderModelCostPointsTiersElemTier

type ProviderModelCostPointsTiersElemTier struct {
	// Input corresponds to the JSON schema field "input".
	Input *ProviderModelCostPointsTiersElemTier_1Input `json:"input,omitempty"`

	// Label corresponds to the JSON schema field "label".
	Label *string `json:"label,omitempty"`

	// Output corresponds to the JSON schema field "output".
	Output *ProviderModelCostPointsTiersElemTier_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 *ProviderModelCostPointsTiersElemTier_1Time `json:"time,omitempty"`

	// Type corresponds to the JSON schema field "type".
	Type string `json:"type"`
}

type ProviderModelCostPointsTiersElemTier_0

type ProviderModelCostPointsTiersElemTier_0 struct {
	// Size corresponds to the JSON schema field "size".
	Size int `json:"size"`

	// Type corresponds to the JSON schema field "type".
	Type string `json:"type"`
}

type ProviderModelCostPointsTiersElemTier_1

type ProviderModelCostPointsTiersElemTier_1 struct {
	// Input corresponds to the JSON schema field "input".
	Input *ProviderModelCostPointsTiersElemTier_1Input `json:"input,omitempty"`

	// Label corresponds to the JSON schema field "label".
	Label *string `json:"label,omitempty"`

	// Output corresponds to the JSON schema field "output".
	Output *ProviderModelCostPointsTiersElemTier_1Output `json:"output,omitempty"`

	// Time corresponds to the JSON schema field "time".
	Time *ProviderModelCostPointsTiersElemTier_1Time `json:"time,omitempty"`

	// Type corresponds to the JSON schema field "type".
	Type string `json:"type"`
}

type ProviderModelCostPointsTiersElemTier_1Input

type ProviderModelCostPointsTiersElemTier_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 ProviderModelCostPointsTiersElemTier_1Output

type ProviderModelCostPointsTiersElemTier_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 ProviderModelCostPointsTiersElemTier_1Time

type ProviderModelCostPointsTiersElemTier_1Time struct {
	// Timezone corresponds to the JSON schema field "timezone".
	Timezone string `json:"timezone"`

	// Windows corresponds to the JSON schema field "windows".
	Windows []ProviderModelCostPointsTiersElemTier_1TimeWindowsElem `json:"windows"`
}

type ProviderModelCostPointsTiersElemTier_1TimeWindowsElem

type ProviderModelCostPointsTiersElemTier_1TimeWindowsElem struct {
	// Days corresponds to the JSON schema field "days".
	Days []ProviderModelCostPointsTiersElemTier_1TimeWindowsElemDaysElem `json:"days,omitempty"`

	// End corresponds to the JSON schema field "end".
	End string `json:"end"`

	// Start corresponds to the JSON schema field "start".
	Start string `json:"start"`
}

type ProviderModelCostPointsTiersElemTier_1TimeWindowsElemDaysElem

type ProviderModelCostPointsTiersElemTier_1TimeWindowsElemDaysElem string
const ProviderModelCostPointsTiersElemTier_1TimeWindowsElemDaysElemFriday ProviderModelCostPointsTiersElemTier_1TimeWindowsElemDaysElem = "friday"
const ProviderModelCostPointsTiersElemTier_1TimeWindowsElemDaysElemMonday ProviderModelCostPointsTiersElemTier_1TimeWindowsElemDaysElem = "monday"
const ProviderModelCostPointsTiersElemTier_1TimeWindowsElemDaysElemSaturday ProviderModelCostPointsTiersElemTier_1TimeWindowsElemDaysElem = "saturday"
const ProviderModelCostPointsTiersElemTier_1TimeWindowsElemDaysElemSunday ProviderModelCostPointsTiersElemTier_1TimeWindowsElemDaysElem = "sunday"
const ProviderModelCostPointsTiersElemTier_1TimeWindowsElemDaysElemThursday ProviderModelCostPointsTiersElemTier_1TimeWindowsElemDaysElem = "thursday"
const ProviderModelCostPointsTiersElemTier_1TimeWindowsElemDaysElemTuesday ProviderModelCostPointsTiersElemTier_1TimeWindowsElemDaysElem = "tuesday"
const ProviderModelCostPointsTiersElemTier_1TimeWindowsElemDaysElemWednesday ProviderModelCostPointsTiersElemTier_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"`

	// 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"`

	// Tier corresponds to the JSON schema field "tier".
	Tier ProviderModelCostTiersElemTier `json:"tier"`
}

type ProviderModelCostTiersElemTier

type ProviderModelCostTiersElemTier struct {
	// Input corresponds to the JSON schema field "input".
	Input *ProviderModelCostTiersElemTier_1Input `json:"input,omitempty"`

	// Label corresponds to the JSON schema field "label".
	Label *string `json:"label,omitempty"`

	// Output corresponds to the JSON schema field "output".
	Output *ProviderModelCostTiersElemTier_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 *ProviderModelCostTiersElemTier_1Time `json:"time,omitempty"`

	// Type corresponds to the JSON schema field "type".
	Type string `json:"type"`
}

type ProviderModelCostTiersElemTier_0

type ProviderModelCostTiersElemTier_0 struct {
	// Size corresponds to the JSON schema field "size".
	Size int `json:"size"`

	// Type corresponds to the JSON schema field "type".
	Type string `json:"type"`
}

type ProviderModelCostTiersElemTier_1

type ProviderModelCostTiersElemTier_1 struct {
	// Input corresponds to the JSON schema field "input".
	Input *ProviderModelCostTiersElemTier_1Input `json:"input,omitempty"`

	// Label corresponds to the JSON schema field "label".
	Label *string `json:"label,omitempty"`

	// Output corresponds to the JSON schema field "output".
	Output *ProviderModelCostTiersElemTier_1Output `json:"output,omitempty"`

	// Time corresponds to the JSON schema field "time".
	Time *ProviderModelCostTiersElemTier_1Time `json:"time,omitempty"`

	// Type corresponds to the JSON schema field "type".
	Type string `json:"type"`
}

type ProviderModelCostTiersElemTier_1Input

type ProviderModelCostTiersElemTier_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 ProviderModelCostTiersElemTier_1Output

type ProviderModelCostTiersElemTier_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 ProviderModelCostTiersElemTier_1Time

type ProviderModelCostTiersElemTier_1Time struct {
	// Timezone corresponds to the JSON schema field "timezone".
	Timezone string `json:"timezone"`

	// Windows corresponds to the JSON schema field "windows".
	Windows []ProviderModelCostTiersElemTier_1TimeWindowsElem `json:"windows"`
}

type ProviderModelCostTiersElemTier_1TimeWindowsElem

type ProviderModelCostTiersElemTier_1TimeWindowsElem struct {
	// Days corresponds to the JSON schema field "days".
	Days []ProviderModelCostTiersElemTier_1TimeWindowsElemDaysElem `json:"days,omitempty"`

	// End corresponds to the JSON schema field "end".
	End string `json:"end"`

	// Start corresponds to the JSON schema field "start".
	Start string `json:"start"`
}

type ProviderModelCostTiersElemTier_1TimeWindowsElemDaysElem

type ProviderModelCostTiersElemTier_1TimeWindowsElemDaysElem string
const ProviderModelCostTiersElemTier_1TimeWindowsElemDaysElemFriday ProviderModelCostTiersElemTier_1TimeWindowsElemDaysElem = "friday"
const ProviderModelCostTiersElemTier_1TimeWindowsElemDaysElemMonday ProviderModelCostTiersElemTier_1TimeWindowsElemDaysElem = "monday"
const ProviderModelCostTiersElemTier_1TimeWindowsElemDaysElemSaturday ProviderModelCostTiersElemTier_1TimeWindowsElemDaysElem = "saturday"
const ProviderModelCostTiersElemTier_1TimeWindowsElemDaysElemSunday ProviderModelCostTiersElemTier_1TimeWindowsElemDaysElem = "sunday"
const ProviderModelCostTiersElemTier_1TimeWindowsElemDaysElemThursday ProviderModelCostTiersElemTier_1TimeWindowsElemDaysElem = "thursday"
const ProviderModelCostTiersElemTier_1TimeWindowsElemDaysElemTuesday ProviderModelCostTiersElemTier_1TimeWindowsElemDaysElem = "tuesday"
const ProviderModelCostTiersElemTier_1TimeWindowsElemDaysElemWednesday ProviderModelCostTiersElemTier_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"`

	// 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"`

	// 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 ProviderModelExperimentalModesValueProviderBody

type ProviderModelExperimentalModesValueProviderBody map[string]JSONValue

type ProviderModelExperimentalModesValueProviderHeaders

type ProviderModelExperimentalModesValueProviderHeaders map[string]string

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 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 ProviderModelProviderBody

type ProviderModelProviderBody map[string]JSONValue

type ProviderModelProviderHeaders

type ProviderModelProviderHeaders map[string]string

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 Providers

type Providers map[string]Provider

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) File

func (snapshot *Snapshot) File(name DataFile) ([]byte, bool)

File returns a copy of a verified raw JSON file.

func (*Snapshot) Model

func (snapshot *Snapshot) Model(id string) (ModelMetadata, bool)

Model returns canonical base-model metadata by its globally unique ID.

func (*Snapshot) Provider

func (snapshot *Snapshot) Provider(id string) (Provider, bool)

Provider returns a provider and all of its callable models.

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.

func (*Snapshot) Schema

func (snapshot *Snapshot) Schema() []byte

Schema returns a copy of the schema published with this snapshot.

func (*Snapshot) Warnings

func (snapshot *Snapshot) Warnings() []Warning

Warnings returns a copy of the non-fatal compatibility warnings found while loading this snapshot.

type UpdateStatus

type UpdateStatus struct {
	CurrentVersion  string
	LatestVersion   string
	UpdateAvailable bool
	RegistryBehind  bool
}

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"
)

Directories

Path Synopsis
examples
basic command
file-cache 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

Jump to

Keyboard shortcuts

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