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

delete() — anthropic-sdk-python Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  025b44d7_a99f_b2c7_74d7_3cf7d2665168["delete()"]
  e4e596a3_8f28_361a_1681_29f79feb432d["AsyncFiles"]
  025b44d7_a99f_b2c7_74d7_3cf7d2665168 -->|defined in| e4e596a3_8f28_361a_1681_29f79feb432d
  style 025b44d7_a99f_b2c7_74d7_3cf7d2665168 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

src/anthropic/resources/beta/files.py lines 421–468

    async def delete(
        self,
        file_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,
    ) -> DeletedFile:
        """
        Delete File

        Args:
          file_id: ID of the File.

          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 file_id:
            raise ValueError(f"Expected a non-empty value for `file_id` but received {file_id!r}")
        extra_headers = {
            **strip_not_given(
                {
                    "anthropic-beta": ",".join(chain((str(e) for e in betas), ["files-api-2025-04-14"]))
                    if is_given(betas)
                    else not_given
                }
            ),
            **(extra_headers or {}),
        }
        extra_headers = {"anthropic-beta": "files-api-2025-04-14", **(extra_headers or {})}
        return await self._delete(
            f"/v1/files/{file_id}?beta=true",
            options=make_request_options(
                extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
            ),
            cast_to=DeletedFile,
        )

Subdomains

Frequently Asked Questions

What does delete() do?
delete() is a function in the anthropic-sdk-python codebase, defined in src/anthropic/resources/beta/files.py.
Where is delete() defined?
delete() is defined in src/anthropic/resources/beta/files.py at line 421.

Analyze Your Own Codebase

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

Try Supermodel Free