provider-apis
Use when building or changing a Mercury model-provider road, or choosing its request shapes, streaming, tools, caching or usage reader. Not for account sign-in, choosing a model in the UI or unrelated SDKs.
- License 许可
- Apache-2.0
- 所属仓库
- Whq02/MercuryCLI
- 最近更新
- 2026-11-12
- Stars
- ★ 31
- Forks
- 3
01 前言 Front Matter
- name
- provider-apis
- description
- Use when building or changing a Mercury model-provider road, or choosing its request shapes, streaming, tools, caching or usage reader. Not for account sign-in, choosing a model in the UI or unrelated SDKs.
- argument-hint
- [provider road or task]
02 资源文件 9
- 参考文档references/anthropic-messages.md3.4 KB
- 参考文档references/chat-completions.md2.0 KB
- 参考文档references/chat-hosted.md4.6 KB
- 参考文档references/chat-local.md2.6 KB
- 参考文档references/chat-native.md5.9 KB
- 参考文档references/live-sources.md12.0 KB
- 参考文档references/models.md1.9 KB
- 参考文档references/openai-responses.md3.7 KB
- 参考文档references/proof-road.md3.1 KB
03 SKILL.md 正文
Provider APIs
Account sign-in and account choice are the /logins and /accounts surfaces, not this skill. Start with the symptom and the identity it depends on: account kind, endpoint, selected and served model. Follow src/services/providers/callModelRouter.ts to the owning implementation; a provider label alone does not identify the wire. Read the changed request, replay, transport or usage owner, not every subsystem.
Choose the relevant reference
Checkout paths start at the repository; references start at this skill's supplied base. Read only the relevant section.
- Identity, capabilities and prices: models.
- Messages: Anthropic.
- Responses, including carrier/account variants: Responses.
- Shared runtime: chat index. Family/account detail: native providers, hosted providers, local and rented engines.
- Verification: proof road. Dated source readings and refresh limits: vendor index.
Invariants
- Keep credential and endpoint together across refresh. Resolve identity through the classifier and pins, not a copied prefix list; an unknown ID is not an Anthropic identity and a failed route never falls through to another provider.
- The provider decides on usage. A reading is information, never a door that prevents sending. Retry/resume refreshes the sign-in and reading as needed, then asks the provider; a served request clears the remembered refusal. Follow explicit
Retry-Afterfirst; call it a plan window only when the response body identifies that window. - Every family must show a meter. Inspect management, billing and admin APIs before declaring one unavailable; separate optional billing credentials from inference credentials. Unknown is not zero.
- Preserve selected effort, output capability and supported signed/encrypted replay. No thinking-time guard or silent downgrade.
src/services/providers/toolEconomy.tsrestores the recorded roster;src/utils/attachments/toolSchemaDelta.tscarries bound-tool changes without moving that prefix. Under the local prompt profile (src/constants/localPromptProfile.ts), local models load the core tools in full and defer the rest behindToolSearch. src/services/providers/toolCallGate.tsanswers malformed calls with an error tool result when ID/name are pairable, otherwise a visible refusal note. Preserve tool/result identity, ordered replay and the operator's verbatim turn (src/utils/messages/apiPlan.ts); do not merge resume text into tool results.- A missing terminal event is not success. Keep partial content, fault and measured usage distinct. Read the road's event/fault union and
src/services/providers/streamIdleBudget.tsbefore changing settlement. - API dispatchers retain
allowH2: falseinsrc/utils/proxy.tsandsrc/utils/mtls.ts; this is Mercury policy, not a vendor protocol requirement.
Reproduce the defect on the base, then capture the changed route over a loopback fixture with a scratch home. A fixture is not live compatibility; a live model call needs the operator's explicit authorisation. Report observed outcomes and unverified limits, not just valid request JSON.
04 同仓库更多 Skills
skill-forge
Use when writing or fixing a Mercury SKILL.md and its discovery rules. Not for /skillify session capture or extension packaging.
research
Use when researching papers or a document corpus and producing a cited report with document deliverables. Not for a quick factual lookup or editing application code.
provider-apis
Use when building or changing a Mercury model-provider road, or choosing its request shapes, streaming, tools, caching or usage reader. Not for account sign-in, choosing a model in the UI or unrelated SDKs.
mcp-smithy
Use when building an MCP server for a Mercury session and proving its tool contract. Not for configuring an existing server.
image-generation
暂无简介
extension-maker
Use when building or repairing a Mercury extension or catalogue. Not for installing or approving one for the operator.