class

Anthropic::Skills::API

Inherits Reference < Object

Skills API client for managing Anthropic Skills.

Skills require the beta header skills-2025-10-02. All methods automatically inject the required beta header.

Usage

client = Anthropic::Client.new
skills = client.skills.list
skills.data.each { |s| puts s.display_title }

Constants

BETA_HEADER = "skills-2025-10-02"
ENDPOINT = "/v1/skills"

Constructors

new(client : Client, *, namespace_beta_headers : Array(String) = [] of String)
Source

Instance methods

create(request : UploadSkillRequest, request_options : RequestOptions | Nil = nil) : Skill

Create a new skill by uploading content as multipart form data.

This is the primary creation method. It uploads a zip archive containing the skill definition (including SKILL.md and any supporting files) as a multipart form-data POST.

Parameters:

  • request: An UploadSkillRequest containing the file content
  • request_options: Optional per-request options

Example:

req = Anthropic::UploadSkillRequest.from_file("my_skill.zip")
skill = client.skills.create(req)
Source
create(request_options : RequestOptions | Nil = nil) : Skill

Create a new skill without uploading content (sends an empty JSON body).

This overload sends {} as a JSON POST body instead of multipart upload. Use this when you want to register a skill placeholder and upload content later via create_version(skill_id, upload_request).

NOTE: This is a convenience overload. Not all Skills API versions may support creation without content. Consult the Anthropic API documentation for your beta version.

Example:

skill = client.skills.create
req = Anthropic::UploadSkillRequest.from_file("my_skill.zip")
version = client.skills.create_version(skill.id, req)
Source
create_version(skill_id : String, request : UploadSkillRequest, request_options : RequestOptions | Nil = nil) : SkillVersion

Create a new version of a skill by uploading content as multipart form data.

This is the primary version creation method. It uploads a zip archive containing the updated skill definition as multipart form-data.

Parameters:

  • skill_id: The ID of the skill to create a version for
  • request: An UploadSkillRequest containing the file content
  • request_options: Optional per-request options

Example:

req = Anthropic::UploadSkillRequest.from_file("my_skill_v2.zip")
version = client.skills.create_version("skill_01ABC123", req)
Source
create_version(skill_id : String, request_options : RequestOptions | Nil = nil) : SkillVersion

Create a new version of a skill without uploading content (sends an empty JSON body).

This overload sends {} as a JSON POST body instead of multipart upload. Use this when the API supports version creation without content, e.g. to trigger a rebuild from existing server-side content.

NOTE: This is a convenience overload. Not all Skills API versions may support version creation without content. Consult the Anthropic API documentation for your beta version.

Example:

version = client.skills.create_version("skill_01ABC123")
Source
delete(skill_id : String, request_options : RequestOptions | Nil = nil) : SkillDeleted

Delete a skill.

Source
delete_version(skill_id : String, version : String, request_options : RequestOptions | Nil = nil) : SkillVersionDeleted

Delete a specific version of a skill.

Source
list(params : SkillsListParams = SkillsListParams.new, request_options : RequestOptions | Nil = nil) : SkillsListResponse

List skills with optional filtering and pagination.

Source
list_versions(skill_id : String, params : SkillVersionsListParams = SkillVersionsListParams.new, request_options : RequestOptions | Nil = nil) : SkillVersionsListResponse

List versions of a skill.

Source
retrieve(skill_id : String, request_options : RequestOptions | Nil = nil) : Skill

Retrieve a specific skill by ID.

Source
retrieve_version(skill_id : String, version : String, request_options : RequestOptions | Nil = nil) : SkillVersion

Retrieve a specific version of a skill.

Source