MCPcopy Create free account
hub / github.com/anthropics/anthropic-sdk-python / my_provider

Function my_provider

examples/workload_identity.py:147–149  ·  view source on GitHub ↗
(*, force_refresh: bool = False)

Source from the content-addressed store, hash-verified

145# If your token source already does its own caching, use expires_at=0 and
146# the client will call your provider before every request instead of caching.
147def my_provider(*, force_refresh: bool = False) -> AccessToken: # noqa: ARG001
148 # call your internal auth service here
149 return AccessToken(token="sk-ant-oat01-...", expires_at=1775000000)
150
151
152client = anthropic.Anthropic(credentials=my_provider)

Callers

nothing calls this directly

Calls 1

AccessTokenClass · 0.90

Tested by

no test coverage detected