provider::anthropic::abort
Cancel the in-flight upstream stream for a request_id (router::abort fan-out), stopping billed generation immediately.
- request_idstringrequired
- abortedbooleanrequired
Anthropic Messages API provider worker; implements provider::anthropic::stream and provider::anthropic::refresh_models behind llm-router.
exact versions are immutable; binary and bundle artifacts are digest-pinned.
Cancel the in-flight upstream stream for a request_id (router::abort fan-out), stopping billed generation immediately.
Count prompt tokens for {model, system_prompt?, tools?, messages} via the upstream count_tokens metering endpoint; never runs the model and costs nothing.
Wire agent messages, the same shape `provider::anthropic::stream` accepts. Must be non-empty.
Single-variant role tags: exact-match on deserialize, correct wire string on serialize, and they let `AgentMessage` be an untagged union.
Model id the prompt targets (required by the upstream endpoint).
System prompt counted as the wire `system` field when present.
Function invocation schemas; mapped to the wire `tools` array.
Always `provider`: the count came from the upstream metering API.
Prompt tokens the upstream endpoint counted for the assembled request.
Internal: router::ready subscriber that re-declares this provider and refreshes its catalog.
Refresh the Anthropic catalog slice from the upstream models endpoint and reconcile it through the router; returns the model count written.
Stream an Anthropic chat completion: resolve credentials, call the upstream Messages API, and relay AssistantMessageEvent frames to writer_ref.
Single-variant role tags: exact-match on deserialize, correct wire string on serialize, and they let `AgentMessage` be an untagged union.