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

retrieve() — anthropic-sdk-python Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  14c9f0c3_35bc_6c50_343b_3991164794b7["retrieve()"]
  feefa0ea_204d_3792_0bc0_49d99e6cc984["Models"]
  14c9f0c3_35bc_6c50_343b_3991164794b7 -->|defined in| feefa0ea_204d_3792_0bc0_49d99e6cc984
  3c9a7342_962d_e68e_1120_a94b887906bb["retrieve()"]
  3c9a7342_962d_e68e_1120_a94b887906bb -->|calls| 14c9f0c3_35bc_6c50_343b_3991164794b7
  3c9a7342_962d_e68e_1120_a94b887906bb["retrieve()"]
  14c9f0c3_35bc_6c50_343b_3991164794b7 -->|calls| 3c9a7342_962d_e68e_1120_a94b887906bb
  style 14c9f0c3_35bc_6c50_343b_3991164794b7 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

src/anthropic/resources/models.py lines 44–87

    def retrieve(
        self,
        model_id: str,
        *,
        betas: List[AnthropicBetaParam] | Omit = omit,
        # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
        # The extra values given here take precedence over values defined on the client or passed to this method.
        extra_headers: Headers | None = None,
        extra_query: Query | None = None,
        extra_body: Body | None = None,
        timeout: float | httpx.Timeout | None | NotGiven = not_given,
    ) -> ModelInfo:
        """
        Get a specific model.

        The Models API response can be used to determine information about a specific
        model or resolve a model alias to a model ID.

        Args:
          model_id: Model identifier or alias.

          betas: Optional header to specify the beta version(s) you want to use.

          extra_headers: Send extra headers

          extra_query: Add additional query parameters to the request

          extra_body: Add additional JSON properties to the request

          timeout: Override the client-level default timeout for this request, in seconds
        """
        if not model_id:
            raise ValueError(f"Expected a non-empty value for `model_id` but received {model_id!r}")
        extra_headers = {
            **strip_not_given({"anthropic-beta": ",".join(str(e) for e in betas) if is_given(betas) else not_given}),
            **(extra_headers or {}),
        }
        return self._get(
            f"/v1/models/{model_id}",
            options=make_request_options(
                extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
            ),
            cast_to=ModelInfo,
        )

Subdomains

Calls

Called By

Frequently Asked Questions

What does retrieve() do?
retrieve() is a function in the anthropic-sdk-python codebase, defined in src/anthropic/resources/models.py.
Where is retrieve() defined?
retrieve() is defined in src/anthropic/resources/models.py at line 44.
What does retrieve() call?
retrieve() calls 1 function(s): retrieve.
What calls retrieve()?
retrieve() is called by 1 function(s): retrieve.

Analyze Your Own Codebase

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

Try Supermodel Free