Are you an LLM? Read llms.txt for a summary of the docs, or llms-full.txt for the full context.
Skip to content

模型目录

Lazu 会按当前 API Key 返回可访问模型集合。生产客户端、agent 和脚本应在运行时读取 catalog,而不是把模型名写死。模型是否可用取决于 key 的权限、channel 状态和模型配置。

GET /api/models/catalog

curl https://api.lazu.ai/api/models/catalog \
  -H "Authorization: Bearer $LAZU_API_KEY"

响应会包含:

  • idproviderowned_by
  • modality.input / modality.output
  • capabilities
  • supported_endpoint_types
  • supported_endpoints
  • default_endpoint_type
  • context_lengthmax_output_tokens
  • 当前 key 的有效 pricing
  • usage_capabilities
  • supported_parametersparameters
  • 可直接复用的 example

如何选模型

需求关注字段常用 endpoint
文本聊天modality.output 包含 text/v1/chat/completions
多模态/图片输入modality.input 包含 image/v1/chat/completions/v1/responses
推理模型capabilities.supports_reasoning === true/v1/responses
Embeddingssupported_endpoint_types 包含 embeddings/v1/embeddings
工具调用capabilities.supports_function_calling === true/v1/chat/completions

除非客户端 SDK 明确需要 Anthropic/Gemini 原生接口,否则优先使用 default_endpoint_type

Usage 和 cache metadata

每个模型都有 usage_capabilities,让客户端在发请求前知道可能出现哪些 usage 维度:

维度含义
cache_read命中并读取已有 cache 的输入 token
cache_writeprovider 返回总 cache write token 但没有 TTL bucket
cache_write_5m5 分钟 TTL 的 cache creation/write token
cache_write_1h1 小时 TTL 的 cache creation/write token
cache_missprovider 单独上报的 cache miss token

不同 provider 的字段不同:OpenAI 常见 cached_tokens;Anthropic 会上报 cache creation/read;Gemini 使用 cached content 计数;DeepSeek 使用 prompt_cache_hit_tokensprompt_cache_miss_tokens,Lazu 会标准化为 cache_readcache_miss

使用 reported_dimensions 判断哪些字段可能出现,使用 billable_dimensions 判断哪些维度会影响价格。

/v1/models

如果你的 SDK 调用 OpenAI 风格的 models.list(),Lazu 也提供扁平响应:

curl https://api.lazu.ai/v1/models \
  -H "Authorization: Bearer $LAZU_API_KEY"

但它只适合 SDK 兼容。需要路由、价格、能力、参数和 usage metadata 时,请使用 /api/models/catalog

相关页面