Versions Class — anthropic-sdk-python Architecture
Architecture documentation for the Versions class in versions.py from the anthropic-sdk-python codebase.
Entity Profile
Dependency Diagram
graph TD 843974dc_2b09_9927_fd27_81ed9766a677["Versions"] 32bd9d9e_8b62_b229_7718_45771b424c40["SyncAPIResource"] 843974dc_2b09_9927_fd27_81ed9766a677 -->|extends| 32bd9d9e_8b62_b229_7718_45771b424c40 8f4235f7_1068_d73a_ef9a_a3e53fdce1e0["versions.py"] 843974dc_2b09_9927_fd27_81ed9766a677 -->|defined in| 8f4235f7_1068_d73a_ef9a_a3e53fdce1e0 e42f61c8_3de7_cfb6_1bb6_d7a42d9c9702["with_raw_response()"] 843974dc_2b09_9927_fd27_81ed9766a677 -->|method| e42f61c8_3de7_cfb6_1bb6_d7a42d9c9702 b05b4315_502e_8b80_401e_a1fc85b234c8["with_streaming_response()"] 843974dc_2b09_9927_fd27_81ed9766a677 -->|method| b05b4315_502e_8b80_401e_a1fc85b234c8 0105cbce_1b49_4384_5e7f_5814257c1385["create()"] 843974dc_2b09_9927_fd27_81ed9766a677 -->|method| 0105cbce_1b49_4384_5e7f_5814257c1385 884fb36e_3f9c_5ea3_b0ba_f90f9a6de1c9["retrieve()"] 843974dc_2b09_9927_fd27_81ed9766a677 -->|method| 884fb36e_3f9c_5ea3_b0ba_f90f9a6de1c9 8e40861b_6b03_ab1f_731a_c040b337742c["list()"] 843974dc_2b09_9927_fd27_81ed9766a677 -->|method| 8e40861b_6b03_ab1f_731a_c040b337742c a7026cea_7b0c_1c92_ef4d_b0bb67e85f25["delete()"] 843974dc_2b09_9927_fd27_81ed9766a677 -->|method| a7026cea_7b0c_1c92_ef4d_b0bb67e85f25
Relationship Graph
Source Code
src/anthropic/resources/beta/skills/versions.py lines 45–314
class Versions(SyncAPIResource):
@cached_property
def with_raw_response(self) -> VersionsWithRawResponse:
"""
This property can be used as a prefix for any HTTP method call to return
the raw response object instead of the parsed content.
For more information, see https://www.github.com/anthropics/anthropic-sdk-python#accessing-raw-response-data-eg-headers
"""
return VersionsWithRawResponse(self)
@cached_property
def with_streaming_response(self) -> VersionsWithStreamingResponse:
"""
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
For more information, see https://www.github.com/anthropics/anthropic-sdk-python#with_streaming_response
"""
return VersionsWithStreamingResponse(self)
def create(
self,
skill_id: str,
*,
files: Optional[SequenceNotStr[FileTypes]] | Omit = omit,
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,
) -> VersionCreateResponse:
"""
Create Skill Version
Args:
skill_id: Unique identifier for the skill.
The format and length of IDs may change over time.
files: Files to upload for the skill.
All files must be in the same top-level directory and must include a SKILL.md
file at the root of that directory.
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 skill_id:
raise ValueError(f"Expected a non-empty value for `skill_id` but received {skill_id!r}")
extra_headers = {
**strip_not_given(
{
"anthropic-beta": ",".join(chain((str(e) for e in betas), ["skills-2025-10-02"]))
if is_given(betas)
else not_given
}
),
**(extra_headers or {}),
}
extra_headers = {"anthropic-beta": "skills-2025-10-02", **(extra_headers or {})}
body = deepcopy_minimal({"files": files})
extracted_files = extract_files(cast(Mapping[str, object], body), paths=[["files", "<array>"]])
# It should be noted that the actual Content-Type header that will be
# sent to the server will contain a `boundary` parameter, e.g.
# multipart/form-data; boundary=---abc--
extra_headers["Content-Type"] = "multipart/form-data"
return self._post(
f"/v1/skills/{skill_id}/versions?beta=true",
body=maybe_transform(body, version_create_params.VersionCreateParams),
files=extracted_files,
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
Domain
Extends
Source
Frequently Asked Questions
What is the Versions class?
Versions is a class in the anthropic-sdk-python codebase, defined in src/anthropic/resources/beta/skills/versions.py.
Where is Versions defined?
Versions is defined in src/anthropic/resources/beta/skills/versions.py at line 45.
What does Versions extend?
Versions extends SyncAPIResource.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free