Home / Function/ default_headers() — anthropic-sdk-python Function Reference

default_headers() — anthropic-sdk-python Function Reference

Architecture documentation for the default_headers() function in _base_client.py from the anthropic-sdk-python codebase.

Entity Profile

Dependency Diagram

graph TD
  83af8662_cd81_a703_c3d4_19c8a07b32e2["default_headers()"]
  842ce0be_ea56_b939_960f_13eb61230daf["BaseClient"]
  83af8662_cd81_a703_c3d4_19c8a07b32e2 -->|defined in| 842ce0be_ea56_b939_960f_13eb61230daf
  d18455a7_e20e_afcf_998c_6a7e7521b9b9["platform_headers()"]
  83af8662_cd81_a703_c3d4_19c8a07b32e2 -->|calls| d18455a7_e20e_afcf_998c_6a7e7521b9b9
  style 83af8662_cd81_a703_c3d4_19c8a07b32e2 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

src/anthropic/_base_client.py lines 681–689

    def default_headers(self) -> dict[str, str | Omit]:
        return {
            "Accept": "application/json",
            "Content-Type": "application/json",
            "User-Agent": self.user_agent,
            **self.platform_headers(),
            **self.auth_headers,
            **self._custom_headers,
        }

Subdomains

Frequently Asked Questions

What does default_headers() do?
default_headers() is a function in the anthropic-sdk-python codebase, defined in src/anthropic/_base_client.py.
Where is default_headers() defined?
default_headers() is defined in src/anthropic/_base_client.py at line 681.
What does default_headers() call?
default_headers() calls 1 function(s): platform_headers.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free