Skip to content

angee.agents_integrate_anthropic.backend

Anthropic SDK implementation of the agents inference backend.

oauth_system_blocks

python
def oauth_system_blocks(system: Any) -> list[dict[str, Any]]

Return system as the block list an OAuth request must open with.

The OAuth edge matches the FIRST system block exactly against the Claude Code identity line — a concatenated "<preamble>\n\n<rest>" string is refused (verified empirically 2026-07-20), so the preamble rides as its own leading block and any caller-supplied system follows it.

AnthropicInferenceBackend

python
class AnthropicInferenceBackend(SDKInferenceBackend)

Inference backend backed by Anthropic's official Python SDK.

system_preamble

python
def system_preamble(credential: Any | None = None) -> str

Return the Claude Code identity line an OAuth token's requests must open with.

list_models

python
def list_models() -> Sequence[InferenceModelSpec]

List Anthropic models and their broker-prefixed aliases.

chat

python
def chat(request: InferenceRequest) -> InferenceResponse

Send one non-streaming Messages API request through Anthropic.

Released under the AGPL-3.0 License.