Follow Discord
Sweep 22 Oct 2026 · 21:04Z Build v2.1.309 528 read Stable v2.1.308 Latest v2.1.309 Next v2.1.309 Feeds RSS JSON llms.txt llms-full.txt Unofficial
One capture · api

One read of Claude Developer Platformapi-20260820T170710Z

229 pages moved out of 583 read.

Pages moved 229 significant first
Pages read 583 in this capture
Captured 17:07 UTC
Corpus hash 9cf0330dc487 corpus-hash

What this read moved

101-125 of 229, page 5 of 10

This capture is too large to show at once. Changes 101-125 of 229 are below, significant first; the rest are on the following screens.

api/skills/list New page · 136 lines, new page

## List Skills ### Query Parameters ### Returns ### Example #### Response

A whole new page. There's nothing to diff it against, so here is what it says.

---
title: List Skills
url: https://platform.claude.com/docs/en/api/skills/list
---

## List Skills

**get** `/v1/skills`

List Skills

### Query Parameters

- `limit: optional number`

  Number of results to return per page.

  Ranges from `1` to `1000`. Defaults to `20`.

- `page: optional string`

  Pagination token for fetching a specific page of results.

  Pass the value from a previous response's `next_page` field to get the next page of results.

- `source: optional string`

  Filter skills by source.

  If provided, only skills from the specified source will be returned:

  * `"custom"`: only return user-created skills
  * `"anthropic"`: only return Anthropic-created skills

### Returns

- `data: array of Skill`

  List of skills.

  - `id: string`

    Unique identifier for the skill.

    The format and length of IDs may change over time.

  - `created_at: string`

    ISO 8601 timestamp of when the skill was created.

  - `display_name: string`

    Human-readable, single-line label for the Skill. Maximum 255 characters.
    Always set: derived from the SKILL.md frontmatter `name` when omitted at
    creation. Not unique.

  - `latest_version_id: string`

    ID of the newest Skill Version — what `latest` references resolve to. Always set: a Skill holds at least one version.

  - `source: SkillSource`

    Where the Skill comes from.

    Possible values:

    * `"custom"`: authored by the platform user; private to their workspace
    * `"anthropic"`: published by Anthropic; shared and read-only
    * `"anthropic_example"`: Anthropic-published sample Skill
    * `"plugin"`: resolved from an installed plugin

    - `type: "custom" or "anthropic" or "anthropic_example" or "plugin"`

      Where the Skill comes from.

      Possible values:

      * `"custom"`: authored by the platform user; private to their workspace
      * `"anthropic"`: published by Anthropic; shared and read-only
      * `"anthropic_example"`: Anthropic-published sample Skill
      * `"plugin"`: resolved from an installed plugin

      - `"custom"`

      - `"anthropic"`

      - `"anthropic_example"`

      - `"plugin"`

  - `type: "skill"`

    Object type.

    For Skills, this is always `"skill"`.

    - `"skill"`

  - `updated_at: string`

    ISO 8601 timestamp of when the skill was last updated.

- `next_page: string or null`

  Token for fetching the next page of results.

  If `null`, there are no more results available. Pass this value to the `page` parameter in the next request to get the next page.

### Example

```http
curl https://api.anthropic.com/v1/skills \
    -H 'anthropic-version: 2023-06-01' \
    -H "X-Api-Key: $ANTHROPIC_API_KEY"
```

#### Response

```json
{
  "data": [
    {
      "id": "skill_01JAbcdefghijklmnopqrstuvw",
      "created_at": "2024-10-30T23:58:27.427722Z",
      "display_name": "display_name",
      "latest_version_id": "latest_version_id",
      "source": {
        "type": "custom"
      },
      "type": "skill",
      "updated_at": "2024-10-30T23:58:27.427722Z"
    }
  ],
  "next_page": "next_page"
}
```

api/skills/retrieve New page · 108 lines, new page

## Get Skill ### Path Parameters ### Returns ### Example #### Response

A whole new page. There's nothing to diff it against, so here is what it says.

---
title: Get Skill
url: https://platform.claude.com/docs/en/api/skills/retrieve
---

## Get Skill

**get** `/v1/skills/{skill_id}`

Get Skill

### Path Parameters

- `skill_id: string`

  Unique identifier for the skill.

  The format and length of IDs may change over time.

### Returns

- `Skill object { id, created_at, display_name, 4 more }`

  - `id: string`

    Unique identifier for the skill.

    The format and length of IDs may change over time.

  - `created_at: string`

    ISO 8601 timestamp of when the skill was created.

  - `display_name: string`

    Human-readable, single-line label for the Skill. Maximum 255 characters.
    Always set: derived from the SKILL.md frontmatter `name` when omitted at
    creation. Not unique.

  - `latest_version_id: string`

    ID of the newest Skill Version — what `latest` references resolve to. Always set: a Skill holds at least one version.

  - `source: SkillSource`

    Where the Skill comes from.

    Possible values:

    * `"custom"`: authored by the platform user; private to their workspace
    * `"anthropic"`: published by Anthropic; shared and read-only
    * `"anthropic_example"`: Anthropic-published sample Skill
    * `"plugin"`: resolved from an installed plugin

    - `type: "custom" or "anthropic" or "anthropic_example" or "plugin"`

      Where the Skill comes from.

      Possible values:

      * `"custom"`: authored by the platform user; private to their workspace
      * `"anthropic"`: published by Anthropic; shared and read-only
      * `"anthropic_example"`: Anthropic-published sample Skill
      * `"plugin"`: resolved from an installed plugin

      - `"custom"`

      - `"anthropic"`

      - `"anthropic_example"`

      - `"plugin"`

  - `type: "skill"`

    Object type.

    For Skills, this is always `"skill"`.

    - `"skill"`

  - `updated_at: string`

    ISO 8601 timestamp of when the skill was last updated.

### Example

```http
curl https://api.anthropic.com/v1/skills/$SKILL_ID \
    -H 'anthropic-version: 2023-06-01' \
    -H "X-Api-Key: $ANTHROPIC_API_KEY"
```

#### Response

```json
{
  "id": "skill_01JAbcdefghijklmnopqrstuvw",
  "created_at": "2024-10-30T23:58:27.427722Z",
  "display_name": "display_name",
  "latest_version_id": "latest_version_id",
  "source": {
    "type": "custom"
  },
  "type": "skill",
  "updated_at": "2024-10-30T23:58:27.427722Z"
}
```

api/skills/versions New page · 378 lines, new page

# Versions ## Create Skill Version ### Path Parameters ### Returns ### Example #### Response ## List Skill Versions ### Path Parameters ### Query Parameters ### Returns ### Example #### Response ## Get Skill Version ### Path Parameters ### Returns ### Example #### Response ## Delete Skill Version ### Path Parameters ### Returns ### Example #### Response ## Domain Types ### Deleted Skill Version ### Skill Version

A whole new page. There's nothing to diff it against, so here is what it says.

---
title: Versions
url: https://platform.claude.com/docs/en/api/skills/versions
---

# Versions

## Create Skill Version

**post** `/v1/skills/{skill_id}/versions`

Create Skill Version

### Path Parameters

- `skill_id: string`

  Unique identifier for the skill.

  The format and length of IDs may change over time.

### Returns

- `SkillVersion object { id, created_at, description, 3 more }`

  - `id: string`

    Unique identifier for this Skill Version. The id addresses the version in
    paths and pins it in references.

  - `created_at: string`

    ISO 8601 timestamp of when the skill was created.

  - `description: string`

    Description of the skill version.

    This is extracted from the SKILL.md file in the skill upload.

  - `name: string`

    The Skill's immutable kebab-case slug, set at creation from the first
    upload's SKILL.md frontmatter `name` (or its enclosing directory). Every
    later upload must resolve to the same value. Also the top-level directory
    of the Skill's mounted files and the base name of a downloaded archive.

  - `skill_id: string`

    Unique identifier for the skill.

    The format and length of IDs may change over time.

  - `type: "skill_version"`

    Object type.

    For Skill Versions, this is always `"skill_version"`.

    - `"skill_version"`

### Example

```http
curl https://api.anthropic.com/v1/skills/$SKILL_ID/versions \
    -H 'Content-Type: multipart/form-data' \
    -H 'anthropic-version: 2023-06-01' \
    -H "X-Api-Key: $ANTHROPIC_API_KEY" \
    -F files='["Example data"]'
```

#### Response

```json
{
  "id": "id",
  "created_at": "2024-10-30T23:58:27.427722Z",
  "description": "description",
  "name": "name",
  "skill_id": "skill_01JAbcdefghijklmnopqrstuvw",
  "type": "skill_version"
}
```

## List Skill Versions

**get** `/v1/skills/{skill_id}/versions`

List Skill Versions

### Path Parameters

- `skill_id: string`

  Unique identifier for the skill.

  The format and length of IDs may change over time.

### Query Parameters

- `limit: optional number`

  Number of results to return per page.

  Ranges from `1` to `1000`. Defaults to `20`.

- `page: optional string`

  Optionally set to the `next_page` token from the previous response.

### Returns

- `data: array of SkillVersion`

  List of skills.

  - `id: string`

    Unique identifier for this Skill Version. The id addresses the version in
    paths and pins it in references.

  - `created_at: string`

    ISO 8601 timestamp of when the skill was created.

  - `description: string`

    Description of the skill version.

    This is extracted from the SKILL.md file in the skill upload.

  - `name: string`

    The Skill's immutable kebab-case slug, set at creation from the first
    upload's SKILL.md frontmatter `name` (or its enclosing directory). Every
    later upload must resolve to the same value. Also the top-level directory
    of the Skill's mounted files and the base name of a downloaded archive.

  - `skill_id: string`

    Unique identifier for the skill.

    The format and length of IDs may change over time.

  - `type: "skill_version"`

    Object type.

    For Skill Versions, this is always `"skill_version"`.

    - `"skill_version"`

- `next_page: string or null`

  Token for fetching the next page of results.

  If `null`, there are no more results available. Pass this value to the `page` parameter in the next request to get the next page.

### Example

```http
curl https://api.anthropic.com/v1/skills/$SKILL_ID/versions \
    -H 'anthropic-version: 2023-06-01' \
    -H "X-Api-Key: $ANTHROPIC_API_KEY"
```

#### Response

```json
{
  "data": [
    {
      "id": "id",
      "created_at": "2024-10-30T23:58:27.427722Z",
      "description": "description",
      "name": "name",
      "skill_id": "skill_01JAbcdefghijklmnopqrstuvw",
      "type": "skill_version"
    }
  ],
  "next_page": "next_page"
}
```

## Get Skill Version

**get** `/v1/skills/{skill_id}/versions/{version}`

Get Skill Version

### Path Parameters

- `skill_id: string`

  Unique identifier for the skill.

  The format and length of IDs may change over time.

- `version: string`

  Identifies the skill version: a version ID, or — where the endpoint accepts it — the literal `latest` for the skill's most recent version.

  Requests carrying the `skills-2025-10-02` beta header address versions by their Unix epoch timestamp instead (e.g., "1759178010641129").

### Returns

- `SkillVersion object { id, created_at, description, 3 more }`

  - `id: string`

    Unique identifier for this Skill Version. The id addresses the version in
    paths and pins it in references.

  - `created_at: string`

    ISO 8601 timestamp of when the skill was created.

  - `description: string`

    Description of the skill version.

    This is extracted from the SKILL.md file in the skill upload.

  - `name: string`

    The Skill's immutable kebab-case slug, set at creation from the first
    upload's SKILL.md frontmatter `name` (or its enclosing directory). Every
    later upload must resolve to the same value. Also the top-level directory
    of the Skill's mounted files and the base name of a downloaded archive.

  - `skill_id: string`

    Unique identifier for the skill.

    The format and length of IDs may change over time.

  - `type: "skill_version"`

    Object type.

    For Skill Versions, this is always `"skill_version"`.

    - `"skill_version"`

### Example

```http
curl https://api.anthropic.com/v1/skills/$SKILL_ID/versions/$VERSION \
    -H 'anthropic-version: 2023-06-01' \
    -H "X-Api-Key: $ANTHROPIC_API_KEY"
```

#### Response

```json
{
  "id": "id",
  "created_at": "2024-10-30T23:58:27.427722Z",
  "description": "description",
  "name": "name",
  "skill_id": "skill_01JAbcdefghijklmnopqrstuvw",
  "type": "skill_version"
}
```

## Delete Skill Version

**delete** `/v1/skills/{skill_id}/versions/{version}`

Delete Skill Version

### Path Parameters

- `skill_id: string`

  Unique identifier for the skill.

  The format and length of IDs may change over time.

- `version: string`

  Identifies the skill version: a version ID, or — where the endpoint accepts it — the literal `latest` for the skill's most recent version.

  Requests carrying the `skills-2025-10-02` beta header address versions by their Unix epoch timestamp instead (e.g., "1759178010641129").

### Returns

- `DeletedSkillVersion object { id, type }`

  - `id: string`

    Unique identifier for this Skill Version. The id addresses the version in
    paths and pins it in references.

  - `type: "skill_version_deleted"`

    Deleted object type.

    For Skill Versions, this is always `"skill_version_deleted"`.

Cut at 300 lines. The page has the rest.

api/skills/versions/create New page · 81 lines, new page

## Create Skill Version ### Path Parameters ### Returns ### Example #### Response

A whole new page. There's nothing to diff it against, so here is what it says.

---
title: Create Skill Version
url: https://platform.claude.com/docs/en/api/skills/versions/create
---

## Create Skill Version

**post** `/v1/skills/{skill_id}/versions`

Create Skill Version

### Path Parameters

- `skill_id: string`

  Unique identifier for the skill.

  The format and length of IDs may change over time.

### Returns

- `SkillVersion object { id, created_at, description, 3 more }`

  - `id: string`

    Unique identifier for this Skill Version. The id addresses the version in
    paths and pins it in references.

  - `created_at: string`

    ISO 8601 timestamp of when the skill was created.

  - `description: string`

    Description of the skill version.

    This is extracted from the SKILL.md file in the skill upload.

  - `name: string`

    The Skill's immutable kebab-case slug, set at creation from the first
    upload's SKILL.md frontmatter `name` (or its enclosing directory). Every
    later upload must resolve to the same value. Also the top-level directory
    of the Skill's mounted files and the base name of a downloaded archive.

  - `skill_id: string`

    Unique identifier for the skill.

    The format and length of IDs may change over time.

  - `type: "skill_version"`

    Object type.

    For Skill Versions, this is always `"skill_version"`.

    - `"skill_version"`

### Example

```http
curl https://api.anthropic.com/v1/skills/$SKILL_ID/versions \
    -H 'Content-Type: multipart/form-data' \
    -H 'anthropic-version: 2023-06-01' \
    -H "X-Api-Key: $ANTHROPIC_API_KEY" \
    -F files='["Example data"]'
```

#### Response

```json
{
  "id": "id",
  "created_at": "2024-10-30T23:58:27.427722Z",
  "description": "description",
  "name": "name",
  "skill_id": "skill_01JAbcdefghijklmnopqrstuvw",
  "type": "skill_version"
}
```

api/skills/versions/delete New page · 59 lines, new page

## Delete Skill Version ### Path Parameters ### Returns ### Example #### Response

A whole new page. There's nothing to diff it against, so here is what it says.

---
title: Delete Skill Version
url: https://platform.claude.com/docs/en/api/skills/versions/delete
---

## Delete Skill Version

**delete** `/v1/skills/{skill_id}/versions/{version}`

Delete Skill Version

### Path Parameters

- `skill_id: string`

  Unique identifier for the skill.

  The format and length of IDs may change over time.

- `version: string`

  Identifies the skill version: a version ID, or — where the endpoint accepts it — the literal `latest` for the skill's most recent version.

  Requests carrying the `skills-2025-10-02` beta header address versions by their Unix epoch timestamp instead (e.g., "1759178010641129").

### Returns

- `DeletedSkillVersion object { id, type }`

  - `id: string`

    Unique identifier for this Skill Version. The id addresses the version in
    paths and pins it in references.

  - `type: "skill_version_deleted"`

    Deleted object type.

    For Skill Versions, this is always `"skill_version_deleted"`.

    - `"skill_version_deleted"`

### Example

```http
curl https://api.anthropic.com/v1/skills/$SKILL_ID/versions/$VERSION \
    -X DELETE \
    -H 'anthropic-version: 2023-06-01' \
    -H "X-Api-Key: $ANTHROPIC_API_KEY"
```

#### Response

```json
{
  "id": "id",
  "type": "skill_version_deleted"
}
```

api/skills/versions/list New page · 104 lines, new page

## List Skill Versions ### Path Parameters ### Query Parameters ### Returns ### Example #### Response

A whole new page. There's nothing to diff it against, so here is what it says.

---
title: List Skill Versions
url: https://platform.claude.com/docs/en/api/skills/versions/list
---

## List Skill Versions

**get** `/v1/skills/{skill_id}/versions`

List Skill Versions

### Path Parameters

- `skill_id: string`

  Unique identifier for the skill.

  The format and length of IDs may change over time.

### Query Parameters

- `limit: optional number`

  Number of results to return per page.

  Ranges from `1` to `1000`. Defaults to `20`.

- `page: optional string`

  Optionally set to the `next_page` token from the previous response.

### Returns

- `data: array of SkillVersion`

  List of skills.

  - `id: string`

    Unique identifier for this Skill Version. The id addresses the version in
    paths and pins it in references.

  - `created_at: string`

    ISO 8601 timestamp of when the skill was created.

  - `description: string`

    Description of the skill version.

    This is extracted from the SKILL.md file in the skill upload.

  - `name: string`

    The Skill's immutable kebab-case slug, set at creation from the first
    upload's SKILL.md frontmatter `name` (or its enclosing directory). Every
    later upload must resolve to the same value. Also the top-level directory
    of the Skill's mounted files and the base name of a downloaded archive.

  - `skill_id: string`

    Unique identifier for the skill.

    The format and length of IDs may change over time.

  - `type: "skill_version"`

    Object type.

    For Skill Versions, this is always `"skill_version"`.

    - `"skill_version"`

- `next_page: string or null`

  Token for fetching the next page of results.

  If `null`, there are no more results available. Pass this value to the `page` parameter in the next request to get the next page.

### Example

```http
curl https://api.anthropic.com/v1/skills/$SKILL_ID/versions \
    -H 'anthropic-version: 2023-06-01' \
    -H "X-Api-Key: $ANTHROPIC_API_KEY"
```

#### Response

```json
{
  "data": [
    {
      "id": "id",
      "created_at": "2024-10-30T23:58:27.427722Z",
      "description": "description",
      "name": "name",
      "skill_id": "skill_01JAbcdefghijklmnopqrstuvw",
      "type": "skill_version"
    }
  ],
  "next_page": "next_page"
}
```

api/skills/versions/retrieve New page · 85 lines, new page

## Get Skill Version ### Path Parameters ### Returns ### Example #### Response

A whole new page. There's nothing to diff it against, so here is what it says.

---
title: Get Skill Version
url: https://platform.claude.com/docs/en/api/skills/versions/retrieve
---

## Get Skill Version

**get** `/v1/skills/{skill_id}/versions/{version}`

Get Skill Version

### Path Parameters

- `skill_id: string`

  Unique identifier for the skill.

  The format and length of IDs may change over time.

- `version: string`

  Identifies the skill version: a version ID, or — where the endpoint accepts it — the literal `latest` for the skill's most recent version.

  Requests carrying the `skills-2025-10-02` beta header address versions by their Unix epoch timestamp instead (e.g., "1759178010641129").

### Returns

- `SkillVersion object { id, created_at, description, 3 more }`

  - `id: string`

    Unique identifier for this Skill Version. The id addresses the version in
    paths and pins it in references.

  - `created_at: string`

    ISO 8601 timestamp of when the skill was created.

  - `description: string`

    Description of the skill version.

    This is extracted from the SKILL.md file in the skill upload.

  - `name: string`

    The Skill's immutable kebab-case slug, set at creation from the first
    upload's SKILL.md frontmatter `name` (or its enclosing directory). Every
    later upload must resolve to the same value. Also the top-level directory
    of the Skill's mounted files and the base name of a downloaded archive.

  - `skill_id: string`

    Unique identifier for the skill.

    The format and length of IDs may change over time.

  - `type: "skill_version"`

    Object type.

    For Skill Versions, this is always `"skill_version"`.

    - `"skill_version"`

### Example

```http
curl https://api.anthropic.com/v1/skills/$SKILL_ID/versions/$VERSION \
    -H 'anthropic-version: 2023-06-01' \
    -H "X-Api-Key: $ANTHROPIC_API_KEY"
```

#### Response

```json
{
  "id": "id",
  "created_at": "2024-10-30T23:58:27.427722Z",
  "description": "description",
  "name": "name",
  "skill_id": "skill_01JAbcdefghijklmnopqrstuvw",
  "type": "skill_version"
}
```

build-with-claude/citations Changed · +58 / -72 lines

from line 740
740740 
741741 <Tab title="Files API">
742742 <Note>
743 These examples reference the uploaded file as a `document` source. They use the SDK `beta` client path and send the `anthropic-beta: files-api-2025-04-14` header, which the API accepts but does not require. See [Files API](https://platform.claude.com/docs/en/build-with-claude/files) for upload details.
743 These examples reference the uploaded file as a `document` source, and no beta header is required. See [Files API](https://platform.claude.com/docs/en/build-with-claude/files) for upload details.
744744 </Note>
745745 
746746 <CodeGroup>
from line 748
748748 curl -X POST https://api.anthropic.com/v1/messages \
749749 -H "x-api-key: $ANTHROPIC_API_KEY" \
750750 -H "anthropic-version: 2023-06-01" \
751 -H "anthropic-beta: files-api-2025-04-14" \
752751 -H "content-type: application/json" \
753752 -d @- <<EOF
754753 {
from line 776
777776 ```
778777 
779778 ```bash CLI
780 ant beta:messages create --beta files-api-2025-04-14 <<YAML
779 ant messages create <<YAML
781780 model: claude-opus-5
782781 max_tokens: 1024
783782 messages:
from line 796
797796 ```
798797 
799798 ```python Python
800 cited_response = client.beta.messages.create(
799 cited_response = client.messages.create(
801800 model="claude-opus-5",
802801 max_tokens=1024,
803802 messages=[
from line 814
815814 ],
816815 }
817816 ],
818 betas=["files-api-2025-04-14"],
819817 )
820818 print(cited_response)
821819 ```
822820 
823821 ```typescript TypeScript
824 const citedResponse = await client.beta.messages.create({
822 const citedResponse = await client.messages.create({
825823 model: "claude-opus-5",
826824 max_tokens: 1024,
827825 messages: [
from line 840
842840 ],
843841 },
844842 ],
845 betas: ["files-api-2025-04-14"],
846843 });
847844 console.log(citedResponse);
848845 ```
849846 
850847 ```csharp C#
851 var citedResponse = await client.Beta.Messages.Create(
848 var citedResponse = await client.Messages.Create(
852849 new MessageCreateParams
853850 {
854 Model = Messages::Model.ClaudeOpus5,
851 Model = Model.ClaudeOpus5,
855852 MaxTokens = 1024,
856 Betas = [AnthropicBeta.FilesApi2025_04_14],
857853 Messages =
858854 [
859 new BetaMessageParam
855 new MessageParam
860856 {
861857 Role = Role.User,
862 Content = new List<BetaContentBlockParam>
858 Content = new List<ContentBlockParam>
863859 {
864 new BetaRequestDocumentBlock
860 new DocumentBlockParam
865861 {
866 Source = new BetaFileDocumentSource { FileID = fileId },
862 Source = new FileDocumentSource { FileID = fileId },
867863 Title = "Document Title",
868864 Context = "Context about the document that will not be cited from",
869 Citations = new BetaCitationsConfigParam { Enabled = true },
865 Citations = new CitationsConfigParam { Enabled = true },
870866 },
871 new BetaTextBlockParam { Text = "Summarize this document." },
867 new TextBlockParam { Text = "Summarize this document." },
872868 }
873869 }
874870 ]
from line 874
878874 ```
879875 
880876 ```go Go
881 citedMsg, err := client.Beta.Messages.New(context.Background(),
882 anthropic.BetaMessageNewParams{
877 citedMsg, err := client.Messages.New(context.Background(),
878 anthropic.MessageNewParams{
883879 Model: anthropic.ModelClaudeOpus5,
884880 MaxTokens: 1024,
885 Betas: []anthropic.AnthropicBeta{anthropic.AnthropicBetaFilesAPI2025_04_14},
886 Messages: []anthropic.BetaMessageParam{
887 anthropic.NewBetaUserMessage(
888 anthropic.BetaContentBlockParamUnion{
889 OfDocument: &anthropic.BetaRequestDocumentBlockParam{
890 Source: anthropic.BetaRequestDocumentBlockSourceUnionParam{
891 OfFile: &anthropic.BetaFileDocumentSourceParam{FileID: fileID},
881 Messages: []anthropic.MessageParam{
882 anthropic.NewUserMessage(
883 anthropic.ContentBlockParamUnion{
884 OfDocument: &anthropic.DocumentBlockParam{
885 Source: anthropic.DocumentBlockParamSourceUnion{
886 OfFile: &anthropic.FileDocumentSourceParam{FileID: fileID},
892887 },
893888 Title: anthropic.String("Document Title"),
894889 Context: anthropic.String("Context about the document that will not be cited from"),
895 Citations: anthropic.BetaCitationsConfigParam{Enabled: anthropic.Bool(true)},
890 Citations: anthropic.CitationsConfigParam{Enabled: anthropic.Bool(true)},
896891 },
897892 },
898 anthropic.NewBetaTextBlock("Summarize this document."),
893 anthropic.NewTextBlock("Summarize this document."),
899894 ),
900895 },
901896 })
from line 903
908903 ```java Java
909904 MessageCreateParams citedParams = MessageCreateParams.builder()
910905 .model(Model.CLAUDE_OPUS_5)
911 .addBeta("files-api-2025-04-14")
912906 .maxTokens(1024)
913 .addUserMessageOfBetaContentBlockParams(List.of(
914 BetaContentBlockParam.ofDocument(BetaRequestDocumentBlock.builder()
915 .source(BetaFileDocumentSource.builder().fileId(fileId).build())
907 .addUserMessageOfBlockParams(List.of(
908 ContentBlockParam.ofDocument(DocumentBlockParam.builder()
909 .fileSource(fileId)
916910 .title("Document Title")
917911 .context("Context about the document that will not be cited from")
918 .citations(BetaCitationsConfigParam.builder().enabled(true).build())
912 .citations(CitationsConfigParam.builder().enabled(true).build())
919913 .build()),
920 BetaContentBlockParam.ofText(BetaTextBlockParam.builder()
914 ContentBlockParam.ofText(TextBlockParam.builder()
921915 .text("Summarize this document.")
922916 .build())
923917 ))
924918 .build();
925919 
926 BetaMessage citedMessage = client.beta().messages().create(citedParams);
920 Message citedMessage = client.messages().create(citedParams);
927921 System.out.println(citedMessage);
928922 ```
929923 
from line 947
953947 ```
954948 
955949 ```ruby Ruby
956 cited_response = client.beta.messages.create(
950 cited_response = client.messages.create(
957951 model: "claude-opus-5",
958952 max_tokens: 1024,
959 betas: ["files-api-2025-04-14"],
960953 messages: [
961954 {
962955 role: "user",
from line 1564
15711564 
15721565 <Tab title="Files API">
15731566 <Note>
1574 These examples reference the uploaded file as a `document` source. They use the SDK `beta` client path and send the `anthropic-beta: files-api-2025-04-14` header, which the API accepts but does not require. See [Files API](https://platform.claude.com/docs/en/build-with-claude/files) for upload details.
1567 These examples reference the uploaded file as a `document` source, and no beta header is required. See [Files API](https://platform.claude.com/docs/en/build-with-claude/files) for upload details.
15751568 </Note>
15761569 
15771570 <CodeGroup>
from line 1572
15791572 curl -X POST https://api.anthropic.com/v1/messages \
15801573 -H "x-api-key: $ANTHROPIC_API_KEY" \
15811574 -H "anthropic-version: 2023-06-01" \
1582 -H "anthropic-beta: files-api-2025-04-14" \
15831575 -H "content-type: application/json" \
15841576 -d @- <<EOF
15851577 {
from line 1600
16081600 ```
16091601 
16101602 ```bash CLI
1611 ant beta:messages create --beta files-api-2025-04-14 <<YAML
1603 ant messages create <<YAML
16121604 model: claude-opus-5
16131605 max_tokens: 1024
16141606 messages:
from line 1620
16281620 ```
16291621 
16301622 ```python Python
1631 cited_response = client.beta.messages.create(
1623 cited_response = client.messages.create(
16321624 model="claude-opus-5",
16331625 max_tokens=1024,
16341626 messages=[
from line 1638
16461638 ],
16471639 }
16481640 ],
1649 betas=["files-api-2025-04-14"],
16501641 )
16511642 print(cited_response)
16521643 ```
16531644 
16541645 ```typescript TypeScript
1655 const citedResponse = await client.beta.messages.create({
1646 const citedResponse = await client.messages.create({
16561647 model: "claude-opus-5",
16571648 max_tokens: 1024,
16581649 messages: [
from line 1664
16731664 ],
16741665 },
16751666 ],
1676 betas: ["files-api-2025-04-14"],
16771667 });
16781668 console.log(citedResponse);
16791669 ```
16801670 
16811671 ```csharp C#
1682 var citedResponse = await client.Beta.Messages.Create(
1672 var citedResponse = await client.Messages.Create(
16831673 new MessageCreateParams
16841674 {
1685 Model = Messages::Model.ClaudeOpus5,
1675 Model = Model.ClaudeOpus5,
16861676 MaxTokens = 1024,
1687 Betas = [AnthropicBeta.FilesApi2025_04_14],
16881677 Messages =
16891678 [
1690 new BetaMessageParam
1679 new MessageParam
16911680 {
16921681 Role = Role.User,
1693 Content = new List<BetaContentBlockParam>
1682 Content = new List<ContentBlockParam>
16941683 {
1695 new BetaRequestDocumentBlock
1684 new DocumentBlockParam
16961685 {
1697 Source = new BetaFileDocumentSource { FileID = fileId },
1686 Source = new FileDocumentSource { FileID = fileId },
16981687 Title = "Document Title",
16991688 Context = "Context about the document that will not be cited from",
1700 Citations = new BetaCitationsConfigParam { Enabled = true },
1689 Citations = new CitationsConfigParam { Enabled = true },
17011690 },
1702 new BetaTextBlockParam { Text = "Summarize this document." },
1691 new TextBlockParam { Text = "Summarize this document." },
17031692 }
17041693 }
17051694 ]
from line 1698
17091698 ```
17101699 
17111700 ```go Go
1712 citedMsg, err := client.Beta.Messages.New(context.Background(),
1713 anthropic.BetaMessageNewParams{
1701 citedMsg, err := client.Messages.New(context.Background(),
1702 anthropic.MessageNewParams{
17141703 Model: anthropic.ModelClaudeOpus5,
17151704 MaxTokens: 1024,
1716 Betas: []anthropic.AnthropicBeta{anthropic.AnthropicBetaFilesAPI2025_04_14},
1717 Messages: []anthropic.BetaMessageParam{
1718 anthropic.NewBetaUserMessage(
1719 anthropic.BetaContentBlockParamUnion{
1720 OfDocument: &anthropic.BetaRequestDocumentBlockParam{
1721 Source: anthropic.BetaRequestDocumentBlockSourceUnionParam{
1722 OfFile: &anthropic.BetaFileDocumentSourceParam{FileID: fileID},
1705 Messages: []anthropic.MessageParam{
1706 anthropic.NewUserMessage(
1707 anthropic.ContentBlockParamUnion{
1708 OfDocument: &anthropic.DocumentBlockParam{
1709 Source: anthropic.DocumentBlockParamSourceUnion{
1710 OfFile: &anthropic.FileDocumentSourceParam{FileID: fileID},
17231711 },
17241712 Title: anthropic.String("Document Title"),
17251713 Context: anthropic.String("Context about the document that will not be cited from"),
1726 Citations: anthropic.BetaCitationsConfigParam{Enabled: anthropic.Bool(true)},
1714 Citations: anthropic.CitationsConfigParam{Enabled: anthropic.Bool(true)},
17271715 },
17281716 },
1729 anthropic.NewBetaTextBlock("Summarize this document."),
1717 anthropic.NewTextBlock("Summarize this document."),
17301718 ),
17311719 },
17321720 })
from line 1727
17391727 ```java Java
17401728 MessageCreateParams citedParams = MessageCreateParams.builder()
17411729 .model(Model.CLAUDE_OPUS_5)
1742 .addBeta("files-api-2025-04-14")
17431730 .maxTokens(1024)
1744 .addUserMessageOfBetaContentBlockParams(List.of(
1745 BetaContentBlockParam.ofDocument(BetaRequestDocumentBlock.builder()
1746 .source(BetaFileDocumentSource.builder().fileId(fileId).build())
1731 .addUserMessageOfBlockParams(List.of(
1732 ContentBlockParam.ofDocument(DocumentBlockParam.builder()
1733 .fileSource(fileId)
17471734 .title("Document Title")
17481735 .context("Context about the document that will not be cited from")
1749 .citations(BetaCitationsConfigParam.builder().enabled(true).build())
1736 .citations(CitationsConfigParam.builder().enabled(true).build())
17501737 .build()),
1751 BetaContentBlockParam.ofText(BetaTextBlockParam.builder()
1738 ContentBlockParam.ofText(TextBlockParam.builder()
17521739 .text("Summarize this document.")
17531740 .build())
17541741 ))
17551742 .build();
17561743 
1757 BetaMessage citedMessage = client.beta().messages().create(citedParams);
1744 Message citedMessage = client.messages().create(citedParams);
17581745 System.out.println(citedMessage);
17591746 ```
17601747 
from line 1771
17841771 ```
17851772 
17861773 ```ruby Ruby
1787 cited_response = client.beta.messages.create(
1774 cited_response = client.messages.create(
17881775 model: "claude-opus-5",
17891776 max_tokens: 1024,
1790 betas: ["files-api-2025-04-14"],
17911777 messages: [
17921778 {
17931779 role: "user",

build-with-claude/claude-on-vertex-ai Changed · +4 / -4 lines

from line 45
4545 <Tab title="Java">
4646 <CodeGroup exclude="shell, python, typescript, csharp, go, php, ruby">
4747 ```groovy Gradle
48 implementation("com.anthropic:anthropic-java:2.53.0")
49 implementation("com.anthropic:anthropic-java-vertex:2.53.0")
48 implementation("com.anthropic:anthropic-java:2.57.0")
49 implementation("com.anthropic:anthropic-java-vertex:2.57.0")
5050 ```
5151 
5252 ```xml Maven
from line 53
5353 <dependency>
5454 <groupId>com.anthropic</groupId>
5555 <artifactId>anthropic-java</artifactId>
56 <version>2.53.0</version>
56 <version>2.57.0</version>
5757 </dependency>
5858 <dependency>
5959 <groupId>com.anthropic</groupId>
6060 <artifactId>anthropic-java-vertex</artifactId>
61 <version>2.53.0</version>
61 <version>2.57.0</version>
6262 </dependency>
6363 ```
6464 

build-with-claude/claude-platform-on-aws Changed · +13 / -11 lines

from line 116
116116 
117117Once the new organization is running, the differences are concentrated in billing and authentication, which are handled through AWS:
118118 
119* **Billing** moves to AWS Marketplace: usage is billed in Claude Consumption Units rather than prepaid credits (see [Billing](https://platform.claude.com/docs/en/build-with-claude/claude-platform-on-aws#billing)), and spend limits are managed on the Billing page rather than the Limits page (see [Spend limits](https://platform.claude.com/docs/en/build-with-claude/claude-platform-on-aws#spend-limits)). During the transition, billing stays separate: the existing organization continues to be billed as it is today.
119* **Billing** moves to AWS Marketplace: usage is billed in Claude Consumption Units rather than prepaid credits (see [Billing](https://platform.claude.com/docs/en/build-with-claude/claude-platform-on-aws#billing)), and you set spend limits on the Billing page (see [Spend limits](https://platform.claude.com/docs/en/build-with-claude/claude-platform-on-aws#spend-limits)). During the transition, billing stays separate: the existing organization continues to be billed as it is today.
120120* **Authentication and access** move to AWS: requests authenticate with AWS credentials or with API keys generated in the AWS Console, not the Claude Console (see [Authentication](https://platform.claude.com/docs/en/build-with-claude/claude-platform-on-aws#authentication)). Organization membership is managed through AWS IAM rather than the Claude Console (see [Available pages](https://platform.claude.com/docs/en/build-with-claude/claude-platform-on-aws#available-pages)), and Anthropic's client SDKs provide platform-specific client classes (see [Install an SDK](https://platform.claude.com/docs/en/build-with-claude/claude-platform-on-aws#install-an-sdk)).
121121* **Day-to-day API usage** works the way it does on the first-party Claude API, except where noted in the [feature limitations](https://platform.claude.com/docs/en/build-with-claude/claude-platform-on-aws#features-not-supported). Before shifting production traffic, check your rate limits: new organizations are placed on the Start tier, and limit increases go through your Anthropic account representative (see [Rate limits and quotas](https://platform.claude.com/docs/en/build-with-claude/claude-platform-on-aws#rate-limits-and-quotas)).
122122 
from line 305
305305 
306306 <Tab title="Java">
307307 ```kotlin Gradle
308 implementation("com.anthropic:anthropic-java-aws:2.53.0")
308 implementation("com.anthropic:anthropic-java-aws:2.57.0")
309309 ```
310310 
311311 ```xml Maven
from line 312
312312 <dependency>
313313 <groupId>com.anthropic</groupId>
314314 <artifactId>anthropic-java-aws</artifactId>
315 <version>2.53.0</version>
315 <version>2.57.0</version>
316316 </dependency>
317317 ```
318318 </Tab>
from line 533
533533 
534534* **Feature access:** Because Anthropic operates both platforms, most new features and beta headers become available on Claude Platform on AWS without a separate integration step. See [feature limitations](https://platform.claude.com/docs/en/build-with-claude/claude-platform-on-aws#features-not-supported) for exceptions.
535535* **Beta features:** Pass the standard `anthropic-beta` header to access beta features, just as you would with the Claude API.
536* **Agent Skills:** Use pre-built and custom [Agent Skills](https://platform.claude.com/docs/en/agents-and-tools/agent-skills/overview) with the same `container.skills` parameter and beta headers as the Claude API. All pre-built Skills (PowerPoint, Excel, Word, PDF) work out of the box.
536* **Agent Skills:** Use pre-built and custom [Agent Skills](https://platform.claude.com/docs/en/agents-and-tools/agent-skills/overview) with the same `container.skills` parameter as the Claude API. All pre-built Skills (PowerPoint, Excel, Word, PDF) work out of the box.
537537* **Code execution:** Run code in Anthropic's managed sandbox using the [code execution tool](https://platform.claude.com/docs/en/agents-and-tools/tool-use/code-execution-tool).
538538* **Tool use:** Computer use and all other [tool use capabilities](https://platform.claude.com/docs/en/agents-and-tools/tool-use/overview) are available.
539539* **Extended thinking:** Enable extended thinking with the same parameters as the Claude API.
from line 797
797797| **Usage** | Yes | No | View token usage by model, workspace, and dimension. Data can take a few minutes to appear after a request. |
798798| **Cost** | Yes | No | View cost breakdowns by model and workspace. AWS Cost Explorer shows the aggregated [Claude Consumption Unit (CCU)](https://platform.claude.com/docs/en/build-with-claude/claude-platform-on-aws#billing) line item. |
799799| **Rate limits** | Yes | No | View rate limits (read-only). Tier increases go through your Anthropic account representative; see [Rate limits and quotas](https://platform.claude.com/docs/en/build-with-claude/claude-platform-on-aws#rate-limits-and-quotas). |
800| **Workspaces** | Yes | No | View per-region workspaces (read-only). |
800| **Workspaces** | Yes | No | View per-region workspaces (read-only) and set per-workspace [spend limits](https://platform.claude.com/docs/en/build-with-claude/claude-platform-on-aws#spend-limits). |
801801| **Files** | Yes | Yes | View and manage uploaded files. |
802802| **Skills** | Yes | Yes | View and manage Agent Skills. |
803803| **Batches** | Yes | Yes | View and manage batch processing jobs. |
from line 838
838838 
839839### Spend limits
840840 
841The Start, Build, and Scale usage tiers each carry a monthly spend cap; see [the per-tier spend caps](https://platform.claude.com/docs/en/api/rate-limits#spend-limits) for current values. The spend cap and rate limits belong to the same tier, so to raise the cap, request a tier increase through your Anthropic account representative or [support](https://support.claude.com) (see [Rate limits and quotas](https://platform.claude.com/docs/en/build-with-claude/claude-platform-on-aws#rate-limits-and-quotas)).
841The Start, Build, and Scale usage tiers each carry a monthly spend cap; see the [per-tier spend caps](https://platform.claude.com/docs/en/api/rate-limits#spend-limits) for current values. When your organization's usage for the calendar month reaches its tier's cap, API requests fail with the [spend-cap error](https://platform.claude.com/docs/en/api/rate-limits#reaching-your-spend-cap) until 00UTC on the first day of the next month, and retrying sooner doesn't succeed. The spend cap and rate limits belong to the same tier. To raise the cap, or to restore access after reaching it, request a tier increase through your Anthropic account representative or [Anthropic support](https://support.claude.com) (see [Rate limits and quotas](https://platform.claude.com/docs/en/build-with-claude/claude-platform-on-aws#rate-limits-and-quotas)).
842842 
843You can also set your own monthly spend limit to cap what your organization spends:
843You can also set your own monthly spend limits below the cap, after adding at least one recipient under **Email notifications** on the Billing page:
844844 
845845* **Organization spend limit:** Go to [Settings > Billing](https://platform.claude.com/settings/billing) in the [Claude Console](https://platform.claude.com/docs/en/build-with-claude/claude-platform-on-aws#using-the-claude-console) to set a monthly spend limit.
846* **Workspace spend limits:** Set monthly spend limits for individual workspaces from each workspace's **Spend limits** settings.
846* **Workspace spend limits:** Select a workspace under [Settings > Workspaces](https://platform.claude.com/settings/workspaces) and open its **Spend limits** page. Workspace details are otherwise read-only in the Claude Console on Claude Platform on AWS.
847847 
848The spend limits you set are soft limits: spend is calculated at list prices and can take about two hours to reflect recent usage.
848When usage reaches a limit you set, requests fail with HTTP 400 (see the [spend limit error](https://platform.claude.com/docs/en/api/rate-limits#setting-your-own-spend-limit)) until 00UTC on the first day of the next month, or until you raise or remove the limit.
849 
850Spend is calculated at list prices and can take about 2 hours to reflect recent usage, so usage can exceed the cap or a limit before requests start failing. The overshoot is billed. When the tier cap or an organization spend limit stops your requests, an email notice goes to the recipients listed under **Email notifications** on the Billing page. Role-based recipients, such as all admins, aren't available on Claude Platform on AWS. The tier-cap notice also goes to the email address used at AWS Marketplace sign-up.
849851 
850852## Monitoring and logging
851853 

build-with-claude/files Changed · +66 / -95 lines

from line 9
99- Platforms: Claude API, Claude Platform on AWS (beta), Microsoft Foundry (beta) [1]; not available on Amazon Bedrock, Google Cloud
10101. On [Microsoft Foundry](https://platform.claude.com/docs/en/build-with-claude/claude-in-microsoft-foundry), the Files API requires a [Hosted on Anthropic deployment](https://platform.claude.com/docs/en/build-with-claude/claude-in-microsoft-foundry#additional-features-not-supported-when-hosted-on-azure).
1111 
12The Files API lets you upload and manage files to use with the Claude API without re-uploading content with each request. This is particularly useful when using the [code execution tool](https://platform.claude.com/docs/en/agents-and-tools/tool-use/code-execution-tool) to provide inputs (for example, datasets and documents) and then download outputs (for example, charts). You can [explore the API reference directly](https://platform.claude.com/docs/en/api/beta/files/upload), in addition to this guide.
12The Files API lets you upload and manage files to use with the Claude API without re-uploading content with each request. This is particularly useful when using the [code execution tool](https://platform.claude.com/docs/en/agents-and-tools/tool-use/code-execution-tool) to provide inputs (for example, datasets and documents) and then download outputs (for example, charts). You can [explore the API reference directly](https://platform.claude.com/docs/en/api/files/upload), in addition to this guide.
1313 
1414## File type support
1515 
from line 33
3333## How to use the Files API
3434 
3535<Note>
36 Requests to the Files API endpoints (`/v1/files`) don't need a beta header, and neither do Messages or Message Batches requests that reference an uploaded file. Two things to know about the `anthropic-beta: files-api-2025-04-14` header the examples on this page still send:
37 
38 * **Referencing a file from the Messages API.** Requests that use an uploaded file as a `document` or `image` source, or in a `container_upload` block for the code execution tool, work with or without the header. The SDK examples on this page still pass it through their `betas` parameter, which continues to work.
39 * **Sending the header on Files API requests.** The SDK `beta.files` methods and the CLI `ant beta:files` commands add the header automatically, and the cURL examples on this page include it. Those requests keep working and return the earlier response format: the list endpoint paginates with `before_id` and `after_id`, returns `has_more`, `first_id`, and `last_id` instead of `next_page`, and rejects the `page` and `ids[]` parameters as unknown fields. File objects returned under the header omit `expires_at` instead of returning `null` when no expiration is set. To use `page` and `ids[]` as described under [List files](https://platform.claude.com/docs/en/build-with-claude/files#list-files), send the request without the beta header.
36 Requests to the Files API endpoints (`/v1/files`) don't need a beta header. Neither do Messages or Message Batches requests that reference an uploaded file as a `document` or `image` source, or in a `container_upload` block for the code execution tool. Requests that still send the `anthropic-beta: files-api-2025-04-14` header keep working. On Files API requests, that header also selects the earlier response format: the list endpoint paginates with `before_id` and `after_id`, returns `has_more`, `first_id`, and `last_id` instead of `next_page`, and rejects the `page` and `ids[]` parameters as unknown fields. File objects returned under the header omit `expires_at` instead of returning `null` when no expiration is set. To use `page` and `ids[]` as described under [List files](https://platform.claude.com/docs/en/build-with-claude/files#list-files), send the request without the header. The PHP tabs on this page still call the SDK's `beta` namespace, which sends the header, so their list output uses the earlier format.
4037</Note>
4138 
4239### Uploading a file
from line 45
4845 FILE_ID=$(curl -X POST https://api.anthropic.com/v1/files \
4946 -H "x-api-key: $ANTHROPIC_API_KEY" \
5047 -H "anthropic-version: 2023-06-01" \
51 -H "anthropic-beta: files-api-2025-04-14" \
5248 -F "file=@/path/to/document.pdf" | jq -r '.id')
5349 echo "$FILE_ID"
5450 ```
5551 
5652 ```bash CLI
57 FILE_ID=$(ant beta:files upload \
53 FILE_ID=$(ant files upload \
5854 --file /path/to/document.pdf \
5955 --transform id \
6056 --raw-output)
from line 58
6258 ```
6359 
6460 ```python Python
65 uploaded = client.beta.files.upload(
61 uploaded = client.files.upload(
6662 file=("document.pdf", open("/path/to/document.pdf", "rb"), "application/pdf"),
6763 )
6864 file_id = uploaded.id
from line 66
7066 ```
7167 
7268 ```typescript TypeScript
73 const uploaded = await client.beta.files.upload({
69 const uploaded = await client.files.upload({
7470 file: await toFile(
7571 fs.createReadStream("/path/to/document.pdf"),
7672 undefined,
from line 77
8177 ```
8278 
8379 ```csharp C#
84 var uploaded = await client.Beta.Files.Upload(
80 var uploaded = await client.Files.Upload(
8581 new FileUploadParams
8682 {
8783 File = new BinaryContent
from line 99
10399 }
104100 defer f.Close()
105101 
106 response, err := client.Beta.Files.Upload(context.Background(),
107 anthropic.BetaFileUploadParams{
102 response, err := client.Files.Upload(context.Background(),
103 anthropic.FileUploadParams{
108104 File: anthropic.File(f, "document.pdf", "application/pdf"),
109105 })
110106 if err != nil {
from line 112
116112 ```
117113 
118114 ```java Java
119 FileMetadata file = client.beta().files().upload(
115 FileMetadata file = client.files().upload(
120116 FileUploadParams.builder()
121117 .file(MultipartField.<InputStream>builder()
122118 .value(Files.newInputStream(Path.of("/path/to/document.pdf")))
from line 136
140136 ```
141137 
142138 ```ruby Ruby
143 file = client.beta.files.upload(
139 file = client.files.upload(
144140 file: Anthropic::FilePart.new(
145141 Pathname("/path/to/document.pdf"),
146142 content_type: "application/pdf"
from line 174
178174 curl -X POST https://api.anthropic.com/v1/messages \
179175 -H "x-api-key: $ANTHROPIC_API_KEY" \
180176 -H "anthropic-version: 2023-06-01" \
181 -H "anthropic-beta: files-api-2025-04-14" \
182177 -H "content-type: application/json" \
183178 -d @- <<EOF
184179 {
from line 202
207202 ```
208203 
209204 ```bash CLI
210 ant beta:messages create --beta files-api-2025-04-14 <<YAML
205 ant messages create <<YAML
211206 model: claude-opus-5
212207 max_tokens: 1024
213208 messages:
from line 218
223218 ```
224219 
225220 ```python Python
226 response = client.beta.messages.create(
221 response = client.messages.create(
227222 model="claude-opus-5",
228223 max_tokens=1024,
229224 messages=[
from line 236
241236 ],
242237 }
243238 ],
244 betas=["files-api-2025-04-14"],
245239 )
246240 print(response)
247241 ```
248242 
249243 ```typescript TypeScript
250 const response = await client.beta.messages.create({
244 const response = await client.messages.create({
251245 model: "claude-opus-5",
252246 max_tokens: 1024,
253247 messages: [
from line 262
268262 ],
269263 },
270264 ],
271 betas: ["files-api-2025-04-14"],
272265 });
273266 
274267 console.log(response);
from line 268
275268 ```
276269 
277270 ```csharp C#
278 var response = await client.Beta.Messages.Create(
271 var response = await client.Messages.Create(
279272 new MessageCreateParams
280273 {
281 Model = Messages::Model.ClaudeOpus5,
274 Model = Model.ClaudeOpus5,
282275 MaxTokens = 1024,
283 Betas = [AnthropicBeta.FilesApi2025_04_14],
284276 Messages =
285277 [
286 new BetaMessageParam
278 new MessageParam
287279 {
288280 Role = Role.User,
289 Content = new List<BetaContentBlockParam>
281 Content = new List<ContentBlockParam>
290282 {
291 new BetaTextBlockParam { Text = "Please summarize this document for me." },
292 new BetaRequestDocumentBlock
283 new TextBlockParam { Text = "Please summarize this document for me." },
284 new DocumentBlockParam
293285 {
294 Source = new BetaFileDocumentSource { FileID = fileId }
286 Source = new FileDocumentSource { FileID = fileId }
295287 }
296288 }
297289 }
from line 294
302294 ```
303295 
304296 ```go Go
305 msg, err := client.Beta.Messages.New(context.Background(),
306 anthropic.BetaMessageNewParams{
297 msg, err := client.Messages.New(context.Background(),
298 anthropic.MessageNewParams{
307299 Model: anthropic.ModelClaudeOpus5,
308300 MaxTokens: 1024,
309 Betas: []anthropic.AnthropicBeta{anthropic.AnthropicBetaFilesAPI2025_04_14},
310 Messages: []anthropic.BetaMessageParam{
311 anthropic.NewBetaUserMessage(
312 anthropic.NewBetaTextBlock("Please summarize this document for me."),
313 anthropic.NewBetaDocumentBlock(anthropic.BetaFileDocumentSourceParam{
301 Messages: []anthropic.MessageParam{
302 anthropic.NewUserMessage(
303 anthropic.NewTextBlock("Please summarize this document for me."),
304 anthropic.NewDocumentBlock(anthropic.FileDocumentSourceParam{
314305 FileID: fileID,
315306 }),
316307 ),
from line 317
326317 ```java Java
327318 MessageCreateParams params = MessageCreateParams.builder()
328319 .model(Model.CLAUDE_OPUS_5)
329 .addBeta("files-api-2025-04-14")
330320 .maxTokens(1024)
331 .addUserMessageOfBetaContentBlockParams(List.of(
332 BetaContentBlockParam.ofText(BetaTextBlockParam.builder()
321 .addUserMessageOfBlockParams(List.of(
322 ContentBlockParam.ofText(TextBlockParam.builder()
333323 .text("Please summarize this document for me.")
334324 .build()),
335 BetaContentBlockParam.ofDocument(BetaRequestDocumentBlock.builder()
336 .source(BetaFileDocumentSource.builder()
337 .fileId(fileId)
338 .build())
325 ContentBlockParam.ofDocument(DocumentBlockParam.builder()
326 .fileSource(fileId)
339327 .build())
340328 ))
341329 .build();
342330 
343 BetaMessage message = client.beta().messages().create(params);
331 Message message = client.messages().create(params);
344332 System.out.println(message);
345333 ```
346334 
from line 358
370358 ```
371359 
372360 ```ruby Ruby
373 response = client.beta.messages.create(
361 response = client.messages.create(
374362 model: "claude-opus-5",
375363 max_tokens: 1024,
376 betas: ["files-api-2025-04-14"],
377364 messages: [
378365 {
379366 role: "user",
from line 686
699686 
700687#### List files
701688 
702Retrieve a list of your uploaded files. The endpoint is paginated: each request returns up to `limit` files (20 by default, and at most 1,000), and the response's `next_page` cursor fetches the next page when passed back as the `page` parameter. Files are ordered newest first. See the [List Files API reference](https://platform.claude.com/docs/en/api/beta/files/list). The SDKs return the first page and provide auto-pagination helpers. The CLI example bounds the total with `--max-items`:
689Retrieve a list of your uploaded files. The endpoint is paginated: each request returns up to `limit` files (20 by default, and at most 1,000), and the response's `next_page` cursor fetches the next page when passed back as the `page` parameter. Files are ordered newest first. See the [List Files API reference](https://platform.claude.com/docs/en/api/files/list). The SDKs return the first page and provide auto-pagination helpers. The CLI example bounds the total with `--max-items`:
703690 
704691<CodeGroup>
705692 ```bash cURL
706693 curl https://api.anthropic.com/v1/files \
707694 -H "x-api-key: $ANTHROPIC_API_KEY" \
708 -H "anthropic-version: 2023-06-01" \
709 -H "anthropic-beta: files-api-2025-04-14"
695 -H "anthropic-version: 2023-06-01"
710696 ```
711697 
712698 ```bash CLI
713 ant beta:files list \
699 ant files list \
714700 --max-items 10
715701 ```
716702 
717703 ```python Python
718704 client = anthropic.Anthropic()
719 files = client.beta.files.list()
705 files = client.files.list()
720706 print(files)
721707 ```
722708 
723709 ```typescript TypeScript
724710 const client = new Anthropic();
725 const files = await client.beta.files.list();
711 const files = await client.files.list();
726712 console.log(files);
727713 ```
728714 
from line 715
729715 ```csharp C#
730716 AnthropicClient client = new();
731717 
732 var files = await client.Beta.Files.List();
718 var files = await client.Files.List();
733719 Console.WriteLine(files);
734720 ```
735721 
from line 722
736722 ```go Go
737723 client := anthropic.NewClient()
738724 
739 files, err := client.Beta.Files.List(context.TODO(), anthropic.BetaFileListParams{})
725 files, err := client.Files.List(context.TODO(), anthropic.FileListParams{})
740726 if err != nil {
741727 log.Fatal(err)
742728 }
from line 730
744730 ```
745731 
746732 ```java Java
747 import com.anthropic.models.beta.files.FileListPage;
733 import com.anthropic.models.files.FileListPage;
748734 // ...
749735 void main() {
750736 AnthropicClient client = AnthropicOkHttpClient.fromEnv();
751737 
752 FileListPage files = client.beta().files().list();
738 FileListPage files = client.files().list();
753739 System.out.println(files);
754740 }
755741 ```
from line 750
764750 ```ruby Ruby
765751 client = Anthropic::Client.new
766752 
767 files = client.beta.files.list
753 files = client.files.list
768754 puts files
769755 ```
770756</CodeGroup>
from line 757
771757 
772758To check a known set of files in one request instead of paging, pass up to 100 file IDs as `ids[]` query parameters. An `ids[]` request always returns a single page (`next_page` is `null`), and any ID that does not resolve to a file in your workspace is silently omitted from `data`; compare the returned IDs against the requested IDs to detect misses. `ids[]` cannot be combined with `page` or `limit`.
773759 
774The `page` parameter, the `next_page` cursor, and the `ids[]` filter apply to requests sent without the `anthropic-beta: files-api-2025-04-14` header. The preceding examples send it (the SDKs and CLI add it for `beta.files` calls), so they receive the earlier list format described in the note under [How to use the Files API](https://platform.claude.com/docs/en/build-with-claude/files#how-to-use-the-files-api).
760The `page` parameter, the `next_page` cursor, and the `ids[]` filter apply to requests sent without the `anthropic-beta: files-api-2025-04-14` header. Requests that send the header receive the earlier list format described in the note under [How to use the Files API](https://platform.claude.com/docs/en/build-with-claude/files#how-to-use-the-files-api).
775761 
776762#### Get file metadata
777763 
from line 767
781767 ```bash cURL
782768 curl "https://api.anthropic.com/v1/files/$FILE_ID" \
783769 -H "x-api-key: $ANTHROPIC_API_KEY" \
784 -H "anthropic-version: 2023-06-01" \
785 -H "anthropic-beta: files-api-2025-04-14"
770 -H "anthropic-version: 2023-06-01"
786771 ```
787772 
788773 ```bash CLI
789 ant beta:files retrieve-metadata \
774 ant files retrieve-metadata \
790775 --file-id "$FILE_ID"
791776 ```
792777 
793778 ```python Python
794 file = client.beta.files.retrieve_metadata(file_id)
779 file = client.files.retrieve_metadata(file_id)
795780 print(file)
796781 ```
797782 
798783 ```typescript TypeScript
799 const file = await client.beta.files.retrieveMetadata(uploaded.id);
784 const file = await client.files.retrieveMetadata(uploaded.id);
800785 console.log(file);
801786 ```
802787 
803788 ```csharp C#
804 var file = await client.Beta.Files.RetrieveMetadata(fileId);
789 var file = await client.Files.RetrieveMetadata(fileId);
805790 Console.WriteLine(file);
806791 ```
807792 
808793 ```go Go
809 metadata, err := client.Beta.Files.GetMetadata(
810 context.TODO(),
811 fileID,
812 anthropic.BetaFileGetMetadataParams{},
813 )
794 metadata, err := client.Files.GetMetadata(context.TODO(), fileID)
814795 if err != nil {
815796 log.Fatal(err)
816797 }
from line 800
819800 ```
820801 
821802 ```java Java
822 FileMetadata metadata = client.beta().files().retrieveMetadata(fileId);
803 FileMetadata metadata = client.files().retrieveMetadata(fileId);
823804 
824805 System.out.println(metadata);
825806 ```
from line 811
830811 ```
831812 
832813 ```ruby Ruby
833 file = client.beta.files.retrieve_metadata(file_id)
814 file = client.files.retrieve_metadata(file_id)
834815 puts file
835816 ```
836817</CodeGroup>
from line 824
843824 ```bash cURL
844825 curl -X DELETE "https://api.anthropic.com/v1/files/$FILE_ID" \
845826 -H "x-api-key: $ANTHROPIC_API_KEY" \
846 -H "anthropic-version: 2023-06-01" \
847 -H "anthropic-beta: files-api-2025-04-14"
827 -H "anthropic-version: 2023-06-01"
848828 ```
849829 
850830 ```bash CLI
851 ant beta:files delete \
831 ant files delete \
852832 --file-id "$FILE_ID"
853833 ```
854834 
855835 ```python Python
856 client.beta.files.delete(file_id)
836 client.files.delete(file_id)
857837 ```
858838 
859839 ```typescript TypeScript
860 await client.beta.files.delete(uploaded.id);
840 await client.files.delete(uploaded.id);
861841 ```
862842 
863843 ```csharp C#
864 await client.Beta.Files.Delete(fileId);
844 await client.Files.Delete(fileId);
865845 ```
866846 
867847 ```go Go
868 _, err = client.Beta.Files.Delete(
869 context.TODO(),
870 fileID,
871 anthropic.BetaFileDeleteParams{},
872 )
848 _, err = client.Files.Delete(context.TODO(), fileID)
873849 if err != nil {
874850 log.Fatal(err)
875851 }
from line 852
876852 ```
877853 
878854 ```java Java
879 client.beta().files().delete(fileId);
855 client.files().delete(fileId);
880856 ```
881857 
882858 ```php PHP
from line 860
884860 ```
885861 
886862 ```ruby Ruby
887 client.beta.files.delete(file_id)
863 client.files.delete(file_id)
888864 ```
889865</CodeGroup>
890866 
from line 873
897873 curl -X GET "https://api.anthropic.com/v1/files/$FILE_ID/content" \
898874 -H "x-api-key: $ANTHROPIC_API_KEY" \
899875 -H "anthropic-version: 2023-06-01" \
900 -H "anthropic-beta: files-api-2025-04-14" \
901876 --output downloaded_file.txt
902877 ```
903878 
904879 ```bash CLI
905 ant beta:files download \
880 ant files download \
906881 --file-id "$FILE_ID" \
907882 --output downloaded_file.txt
908883 ```
909884 
910885 ```python Python
911 file_content = client.beta.files.download(file_id)
886 file_content = client.files.download(file_id)
912887 
913888 file_content.write_to_file("downloaded_file.txt")
914889 ```
915890 
916891 ```typescript TypeScript
917 const content = await client.beta.files.download(uploaded.id);
892 const content = await client.files.download(uploaded.id);
918893 
919894 const bytes = Buffer.from(await content.arrayBuffer());
920895 await fsp.writeFile("downloaded_file.txt", bytes);
from line 896
921896 ```
922897 
923898 ```csharp C#
924 using var fileContent = await client.Beta.Files.Download(fileId);
899 using var fileContent = await client.Files.Download(fileId);
925900 await using var source = await fileContent.ReadAsStream();
926901 await using var destination = File.Create("downloaded_file.txt");
927902 await source.CopyToAsync(destination);
from line 904
929904 
930905 ```go Go
931906 func downloadFile(client anthropic.Client, fileID string) error {
932 resp, err := client.Beta.Files.Download(
933 context.TODO(),
934 fileID,
935 anthropic.BetaFileDownloadParams{},
936 )
907 resp, err := client.Files.Download(context.TODO(), fileID)
937908 if err != nil {
938909 return err
939910 }
from line 923
952923 ```
953924 
954925 ```java Java
955 try (HttpResponse response = client.beta().files().download(fileId)) {
926 try (HttpResponse response = client.files().download(fileId)) {
956927 try (InputStream body = response.body()) {
957928 Files.copy(body, Path.of("downloaded_file.txt"),
958929 StandardCopyOption.REPLACE_EXISTING);
from line 938
967938 ```
968939 
969940 ```ruby Ruby
970 file_content = client.beta.files.download(file_id)
941 file_content = client.files.download(file_id)
971942 
972943 File.binwrite("downloaded_file.txt", file_content.read)
973944 ```

build-with-claude/pdf-support Changed · +28 / -46 lines

from line 704
704704 
705705#### Option 3: Files API
706706 
707For PDFs you'll use repeatedly, or when you want to avoid encoding overhead, use the [Files API](https://platform.claude.com/docs/en/build-with-claude/files). These examples send the `anthropic-beta: files-api-2025-04-14` header, which the API accepts but doesn't require:
707For PDFs you'll use repeatedly, or when you want to avoid encoding overhead, use the [Files API](https://platform.claude.com/docs/en/build-with-claude/files):
708708 
709709<CodeGroup>
710710 ```bash cURL
from line 712
712712 FILE_ID=$(curl -sS -X POST https://api.anthropic.com/v1/files \
713713 -H "x-api-key: $ANTHROPIC_API_KEY" \
714714 -H "anthropic-version: 2023-06-01" \
715 -H "anthropic-beta: files-api-2025-04-14" \
716715 -F "[email protected]" | jq -r '.id')
717716 
718717 # Then use the returned file_id in your message
from line 719
720719 -H "content-type: application/json" \
721720 -H "x-api-key: $ANTHROPIC_API_KEY" \
722721 -H "anthropic-version: 2023-06-01" \
723 -H "anthropic-beta: files-api-2025-04-14" \
724722 -d @- <<EOF
725723 {
726724 "model": "claude-opus-5",
from line 743
745743 
746744 ```bash CLI
747745 # First, upload your PDF to the Files API
748 FILE_ID=$(ant beta:files upload \
746 FILE_ID=$(ant files upload \
749747 --file ./document.pdf \
750748 --transform id \
751749 --raw-output)
752750 
753751 # Then use the returned file_id in your message
754 ant beta:messages create \
755 --beta files-api-2025-04-14 \
752 ant messages create \
756753 --transform content \
757754 --format yaml <<YAML
758755 model: claude-opus-5
from line 771
774771 
775772 # Upload the PDF file
776773 with open("/path/to/document.pdf", "rb") as f:
777 file_upload = client.beta.files.upload(file=("document.pdf", f, "application/pdf"))
774 file_upload = client.files.upload(file=("document.pdf", f, "application/pdf"))
778775 
779776 # Use the uploaded file in a message
780 message = client.beta.messages.create(
777 message = client.messages.create(
781778 model="claude-opus-5",
782779 max_tokens=1024,
783 betas=["files-api-2025-04-14"],
784780 messages=[
785781 {
786782 "role": "user",
from line 801
805801 const anthropic = new Anthropic();
806802 
807803 // Upload the PDF file
808 const fileUpload = await anthropic.beta.files.upload({
804 const fileUpload = await anthropic.files.upload({
809805 file: await toFile(fs.createReadStream("/path/to/document.pdf"), undefined, {
810806 type: "application/pdf"
811807 })
from line 808
812808 });
813809 
814810 // Use the uploaded file in a message
815 const response = await anthropic.beta.messages.create({
811 const response = await anthropic.messages.create({
816812 model: "claude-opus-5",
817813 max_tokens: 1024,
818 betas: ["files-api-2025-04-14"],
819814 messages: [
820815 {
821816 role: "user",
from line 835
840835 ```
841836 
842837 ```csharp C#
843 using Messages = Anthropic.Models.Messages;
844 
845838 var client = new AnthropicClient();
846839 
847840 // Upload the PDF file
848 var fileUpload = await client.Beta.Files.Upload(new FileUploadParams
841 var fileUpload = await client.Files.Upload(new FileUploadParams
849842 {
850843 File = new BinaryContent
851844 {
from line 849
856849 });
857850 
858851 // Use the uploaded file in a message
859 var message = await client.Beta.Messages.Create(new MessageCreateParams
852 var message = await client.Messages.Create(new MessageCreateParams
860853 {
861 Model = Messages::Model.ClaudeOpus5,
854 Model = Model.ClaudeOpus5,
862855 MaxTokens = 1024,
863 Betas = [AnthropicBeta.FilesApi2025_04_14],
864856 Messages =
865857 [
866858 new()
867859 {
868860 Role = Role.User,
869 Content = new List<BetaContentBlockParam>
861 Content = new List<ContentBlockParam>
870862 {
871 new BetaRequestDocumentBlock
863 new DocumentBlockParam
872864 {
873 Source = new BetaFileDocumentSource { FileID = fileUpload.ID },
865 Source = new FileDocumentSource { FileID = fileUpload.ID },
874866 },
875 new BetaTextBlockParam("What are the key findings in this document?"),
867 new TextBlockParam("What are the key findings in this document?"),
876868 },
877869 },
878870 ],
from line 883
891883 }
892884 defer pdfFile.Close()
893885 
894 fileUpload, err := client.Beta.Files.Upload(context.TODO(), anthropic.BetaFileUploadParams{
886 fileUpload, err := client.Files.Upload(context.TODO(), anthropic.FileUploadParams{
895887 File: anthropic.File(pdfFile, "document.pdf", "application/pdf"),
896888 })
897889 if err != nil {
from line 891
899891 }
900892 
901893 // Use the uploaded file in a message
902 message, err := client.Beta.Messages.New(context.TODO(), anthropic.BetaMessageNewParams{
894 message, err := client.Messages.New(context.TODO(), anthropic.MessageNewParams{
903895 Model: anthropic.ModelClaudeOpus5,
904896 MaxTokens: 1024,
905 Betas: []anthropic.AnthropicBeta{anthropic.AnthropicBetaFilesAPI2025_04_14},
906 Messages: []anthropic.BetaMessageParam{
907 anthropic.NewBetaUserMessage(
908 anthropic.NewBetaDocumentBlock(anthropic.BetaFileDocumentSourceParam{
897 Messages: []anthropic.MessageParam{
898 anthropic.NewUserMessage(
899 anthropic.NewDocumentBlock(anthropic.FileDocumentSourceParam{
909900 FileID: fileUpload.ID,
910901 }),
911 anthropic.NewBetaTextBlock("What are the key findings in this document?"),
902 anthropic.NewTextBlock("What are the key findings in this document?"),
912903 ),
913904 },
914905 })
from line 915
924915 
925916 // Upload the PDF file
926917 FileMetadata file = client
927 .beta()
928918 .files()
929919 .upload(FileUploadParams.builder().file(Path.of("/path/to/document.pdf")).build());
930920 
from line 921
931921 // Use the uploaded file in a message
932922 MessageCreateParams params = MessageCreateParams.builder()
933923 .model(Model.CLAUDE_OPUS_5)
934 .addBeta(AnthropicBeta.FILES_API_2025_04_14)
935924 .maxTokens(1024)
936 .addUserMessageOfBetaContentBlockParams(
925 .addUserMessageOfBlockParams(
937926 List.of(
938 BetaContentBlockParam.ofDocument(
939 BetaRequestDocumentBlock.builder()
940 .source(
941 BetaFileDocumentSource.builder()
942 .fileId(file.id())
943 .build()
944 )
945 .build()
927 ContentBlockParam.ofDocument(
928 DocumentBlockParam.builder().fileSource(file.id()).build()
946929 ),
947 BetaContentBlockParam.ofText(
948 BetaTextBlockParam.builder()
930 ContentBlockParam.ofText(
931 TextBlockParam.builder()
949932 .text("What are the key findings in this document?")
950933 .build()
951934 )
from line 936
953936 )
954937 .build();
955938 
956 BetaMessage message = client.beta().messages().create(params);
939 Message message = client.messages().create(params);
957940 System.out.println(message.content());
958941 ```
959942 
from line 983
1000983 
1001984 # Upload the PDF file
1002985 file_upload = File.open("/path/to/document.pdf", "rb") do |f|
1003 anthropic.beta.files.upload(
986 anthropic.files.upload(
1004987 file: Anthropic::FilePart.new(f, filename: "document.pdf", content_type: "application/pdf")
1005988 )
1006989 end
1007990 
1008991 # Use the uploaded file in a message
1009 message = anthropic.beta.messages.create(
992 message = anthropic.messages.create(
1010993 model: "claude-opus-5",
1011994 max_tokens: 1024,
1012 betas: ["files-api-2025-04-14"],
1013995 messages: [
1014996 {
1015997 role: "user",

build-with-claude/skills-guide Changed · +597 / -738 lines

The two sides of this change are more than 400 edits apart, too far apart to line up, so this is the differ's own diff of it and the words inside a line are not marked.

from line 9
99<Note>
1010 For complete API reference including request/response schemas and all parameters, see:
1111 
12 * [Skill Management API Reference](https://platform.claude.com/docs/en/api/beta/skills/list) - CRUD operations for Skills
13 * [Skill Versions API Reference](https://platform.claude.com/docs/en/api/beta/skills/versions/list) - Version management
12 * [Skill Management API Reference](https://platform.claude.com/docs/en/api/skills/list) - CRUD operations for Skills
13 * [Skill Versions API Reference](https://platform.claude.com/docs/en/api/skills/versions/list) - Version management
1414</Note>
1515 
1616<Note>
from line 43
4343 
4444You can use Skills from two sources:
4545 
46| Aspect | Anthropic Skills | Custom Skills |
47| ------------------ | ------------------------------------------ | ------------------------------------------------------------------------------------------------------ |
48| **Type value** | `anthropic` | `custom` |
49| **Skill IDs** | Short names: `pptx`, `xlsx`, `docx`, `pdf` | Generated: `skill_01AbCdEfGhIjKlMnOpQrStUv` |
50| **Version format** | Date-based: `20251013` or `latest` | Version ID: `skver_01AbCdEfGhIjKlMnOpQrStUv` or `latest` |
51| **Management** | Pre-built and maintained by Anthropic | Upload and manage through the [Skills API](https://platform.claude.com/docs/en/api/beta/skills/create) |
52| **Availability** | Available to all users | Private to your workspace |
53 
54Both skill sources are returned by the [List Skills endpoint](https://platform.claude.com/docs/en/api/beta/skills/list) (use the `source` parameter to filter). The integration shape and execution environment are identical. The only difference is where the Skills come from and how they're managed.
46| Aspect | Anthropic Skills | Custom Skills |
47| ------------------ | ------------------------------------------ | ------------------------------------------------------------------------------------------------- |
48| **Type value** | `anthropic` | `custom` |
49| **Skill IDs** | Short names: `pptx`, `xlsx`, `docx`, `pdf` | Generated: `skill_01AbCdEfGhIjKlMnOpQrStUv` |
50| **Version format** | Date-based: `20251013` or `latest` | Version ID: `skver_01AbCdEfGhIjKlMnOpQrStUv` or `latest` |
51| **Management** | Pre-built and maintained by Anthropic | Upload and manage through the [Skills API](https://platform.claude.com/docs/en/api/skills/create) |
52| **Availability** | Available to all users | Private to your workspace |
53 
54Both skill sources are returned by the [List Skills endpoint](https://platform.claude.com/docs/en/api/skills/list) (use the `source` parameter to filter). The integration shape and execution environment are identical. The only difference is where the Skills come from and how they're managed.
5555 
5656### Prerequisites
5757 
from line 60
60601. **Claude API key** from the [Claude Console](https://platform.claude.com/settings/keys)
61612. **[Code execution tool](https://platform.claude.com/docs/en/agents-and-tools/tool-use/code-execution-tool)** enabled in your requests
6262 
63Skills are generally available on the Claude API and don't require an `anthropic-beta` header, either for the Skills API or for `container.skills` in Messages requests. The examples in this guide still send the `skills-2025-10-02` beta header (plus `code-execution-2025-08-25` in Messages requests) and use the SDKs' `beta` namespace. Both headers remain valid opt-ins, so the examples work as written, and you can omit them in your own requests.
63Skills are generally available on the Claude API and don't require an `anthropic-beta` header, either for the Skills API or for `container.skills` in Messages requests. Requests that still send the `skills-2025-10-02` beta header keep working, and Skills API requests that send it keep the earlier beta response format. The PHP tabs on this page still call the SDK's `beta` namespace and send that header, so their printed output shows the earlier response fields.
6464 
6565Skills require the code execution tool, so use a model from its [model compatibility list](https://platform.claude.com/docs/en/agents-and-tools/tool-use/code-execution-tool#model-compatibility).
6666 
from line 79
7979 curl https://api.anthropic.com/v1/messages \
8080 -H "x-api-key: $ANTHROPIC_API_KEY" \
8181 -H "anthropic-version: 2023-06-01" \
82 -H "anthropic-beta: code-execution-2025-08-25,skills-2025-10-02" \
8382 -H "content-type: application/json" \
8483 -d '{
8584 "model": "claude-opus-5",
from line 104
105104 ```
106105 
107106 ```bash CLI
108 ant beta:messages create \
109 --beta code-execution-2025-08-25,skills-2025-10-02 <<'YAML'
107 ant messages create <<'YAML'
110108 model: claude-opus-5
111109 max_tokens: 4096
112110 container:
from line 124
126124 ```python Python
127125 client = anthropic.Anthropic()
128126 
129 response = client.beta.messages.create(
127 response = client.messages.create(
130128 model="claude-opus-5",
131129 max_tokens=4096,
132 betas=["code-execution-2025-08-25", "skills-2025-10-02"],
133130 container={
134131 "skills": [{"type": "anthropic", "skill_id": "pptx", "version": "latest"}]
135132 },
from line 140
143140 ```typescript TypeScript
144141 const client = new Anthropic();
145142 
146 const response = await client.beta.messages.create({
143 const response = await client.messages.create({
147144 model: "claude-opus-5",
148145 max_tokens: 4096,
149 betas: ["code-execution-2025-08-25", "skills-2025-10-02"],
150146 container: {
151147 skills: [
152148 {
from line 174
178174 {
179175 Model = "claude-opus-5",
180176 MaxTokens = 4096,
181 Betas = ["code-execution-2025-08-25", "skills-2025-10-02"],
182 Container = new BetaContainerParams
177 Container = new ContainerParams
183178 {
184179 Skills =
185180 [
186 new BetaSkillParams
181 new SkillParams
187182 {
188 Type = BetaSkillParamsType.Anthropic,
183 Type = SkillParamsType.Anthropic,
189184 SkillID = "pptx",
190185 Version = "latest",
191186 },
192187 ],
193188 },
194189 Messages = [new() { Role = Role.User, Content = "Create a presentation about renewable energy" }],
195 Tools = [new BetaCodeExecutionTool20250825()],
190 Tools = [new CodeExecutionTool20250825()],
196191 };
197192 
198 var message = await client.Beta.Messages.Create(parameters);
193 var message = await client.Messages.Create(parameters);
199194 Console.WriteLine(message);
200195 ```
201196 
202197 ```go Go
203198 client := anthropic.NewClient()
204199 
205 response, err := client.Beta.Messages.New(context.TODO(), anthropic.BetaMessageNewParams{
200 response, err := client.Messages.New(context.TODO(), anthropic.MessageNewParams{
206201 Model: "claude-opus-5",
207202 MaxTokens: 4096,
208 Betas: []anthropic.AnthropicBeta{
209 "code-execution-2025-08-25",
210 anthropic.AnthropicBetaSkills2025_10_02,
211 },
212 Container: anthropic.BetaMessageNewParamsContainerUnion{
213 OfContainers: &anthropic.BetaContainerParams{
214 Skills: []anthropic.BetaSkillParams{
203 Container: anthropic.MessageCreateParamsContainerUnion{
204 OfContainers: &anthropic.ContainerParams{
205 Skills: []anthropic.SkillParams{
215206 {
216 Type: anthropic.BetaSkillParamsTypeAnthropic,
207 Type: anthropic.SkillParamsTypeAnthropic,
217208 SkillID: "pptx",
218209 Version: anthropic.String("latest"),
219210 },
220211 },
221212 },
222213 },
223 Messages: []anthropic.BetaMessageParam{
224 anthropic.NewBetaUserMessage(anthropic.NewBetaTextBlock("Create a presentation about renewable energy")),
214 Messages: []anthropic.MessageParam{
215 anthropic.NewUserMessage(anthropic.NewTextBlock("Create a presentation about renewable energy")),
225216 },
226 Tools: []anthropic.BetaToolUnionParam{
227 {OfCodeExecutionTool20250825: &anthropic.BetaCodeExecutionTool20250825Param{}},
217 Tools: []anthropic.ToolUnionParam{
218 {OfCodeExecutionTool20250825: &anthropic.CodeExecutionTool20250825Param{}},
228219 },
229220 })
230221 if err != nil {
from line 225
234225 ```
235226 
236227 ```java Java
237 import com.anthropic.models.beta.messages.BetaContainerParams;
238 import com.anthropic.models.beta.messages.BetaSkillParams;
239 import com.anthropic.models.beta.messages.BetaCodeExecutionTool20250825;
228 import com.anthropic.models.messages.ContainerParams;
229 import com.anthropic.models.messages.SkillParams;
230 import com.anthropic.models.messages.CodeExecutionTool20250825;
240231 // ...
241232 void main() {
242233 AnthropicClient client = AnthropicOkHttpClient.fromEnv();
from line 235
244235 MessageCreateParams params = MessageCreateParams.builder()
245236 .model(Model.CLAUDE_OPUS_5)
246237 .maxTokens(4096L)
247 .addBeta("code-execution-2025-08-25")
248 .addBeta("skills-2025-10-02")
249 .container(BetaContainerParams.builder()
250 .addSkill(BetaSkillParams.builder()
251 .type(BetaSkillParams.Type.ANTHROPIC)
238 .container(ContainerParams.builder()
239 .addSkill(SkillParams.builder()
240 .type(SkillParams.Type.ANTHROPIC)
252241 .skillId("pptx")
253242 .version("latest")
254243 .build())
255244 .build())
256245 .addUserMessage("Create a presentation about renewable energy")
257 .addTool(BetaCodeExecutionTool20250825.builder().build())
246 .addTool(CodeExecutionTool20250825.builder().build())
258247 .build();
259248 
260 BetaMessage response = client.beta().messages().create(params);
249 Message response = client.messages().create(params);
261250 System.out.println(response);
262251 }
263252 ```
from line 281
292281 ```ruby Ruby
293282 client = Anthropic::Client.new
294283 
295 message = client.beta.messages.create(
284 message = client.messages.create(
296285 model: "claude-opus-5",
297286 max_tokens: 4096,
298 betas: ["code-execution-2025-08-25", "skills-2025-10-02"],
299287 container: {
300288 skills: [
301289 {
from line 325
337325 RESPONSE=$(curl https://api.anthropic.com/v1/messages \
338326 -H "x-api-key: $ANTHROPIC_API_KEY" \
339327 -H "anthropic-version: 2023-06-01" \
340 -H "anthropic-beta: code-execution-2025-08-25,skills-2025-10-02" \
341328 -H "content-type: application/json" \
342329 -d '{
343330 "model": "claude-opus-5",
from line 350
363350 # Step 3: Get filename from metadata
364351 FILENAME=$(curl "https://api.anthropic.com/v1/files/$FILE_ID" \
365352 -H "x-api-key: $ANTHROPIC_API_KEY" \
366 -H "anthropic-version: 2023-06-01" \
367 -H "anthropic-beta: files-api-2025-04-14" | jq -r '.filename')
353 -H "anthropic-version: 2023-06-01" | jq -r '.filename')
368354 
369355 # Step 4: Download the file using Files API
370356 curl "https://api.anthropic.com/v1/files/$FILE_ID/content" \
371357 -H "x-api-key: $ANTHROPIC_API_KEY" \
372358 -H "anthropic-version: 2023-06-01" \
373 -H "anthropic-beta: files-api-2025-04-14" \
374359 --output "$FILENAME"
375360 
376361 echo "Downloaded: $FILENAME"
from line 364
379364 ```bash CLI
380365 # Step 1: Use the xlsx Skill to create a file
381366 # Step 2: Extract file_id from the response with --transform (GJSON path)
382 FILE_ID=$(ant beta:messages create \
383 --beta code-execution-2025-08-25,skills-2025-10-02 \
367 FILE_ID=$(ant messages create \
384368 --transform 'content.#.content.content.#.file_id|@flatten|0' \
385369 --raw-output <<'YAML'
386370 model: claude-opus-5
from line 384
400384 )
401385 
402386 # Step 3: Get the filename from file metadata
403 FILENAME=$(ant beta:files retrieve-metadata \
387 FILENAME=$(ant files retrieve-metadata \
404388 --file-id "$FILE_ID" \
405389 --transform filename \
406390 --raw-output)
407391 
408392 # Step 4: Download the file using Files API
409 ant beta:files download \
393 ant files download \
410394 --file-id "$FILE_ID" \
411395 --output "$FILENAME" > /dev/null
412396 
from line 401
417401 client = anthropic.Anthropic()
418402 
419403 # Step 1: Use a Skill to create a file
420 response = client.beta.messages.create(
404 response = client.messages.create(
421405 model="claude-opus-5",
422406 max_tokens=4096,
423 betas=["code-execution-2025-08-25", "skills-2025-10-02"],
424407 container={
425408 "skills": [{"type": "anthropic", "skill_id": "xlsx", "version": "latest"}]
426409 },
from line 432
449432 
450433 # Step 3: Download the file using Files API
451434 for file_id in extract_file_ids(response):
452 file_metadata = client.beta.files.retrieve_metadata(file_id=file_id)
453 file_content = client.beta.files.download(file_id=file_id)
435 file_metadata = client.files.retrieve_metadata(file_id=file_id)
436 file_content = client.files.download(file_id=file_id)
454437 
455438 # Step 4: Save to disk
456439 file_content.write_to_file(file_metadata.filename)
from line 446
463446 const client = new Anthropic();
464447 
465448 // Step 1: Use a Skill to create a file
466 const response = await client.beta.messages.create({
449 const response = await client.messages.create({
467450 model: "claude-opus-5",
468451 max_tokens: 4096,
469 betas: ["code-execution-2025-08-25", "skills-2025-10-02"],
470452 container: {
471453 skills: [{ type: "anthropic", skill_id: "xlsx", version: "latest" }]
472454 },
from line 476
494476 
495477 // Step 3: Download each file and save to disk
496478 for (const fileId of fileIds) {
497 const fileMetadata = await client.beta.files.retrieveMetadata(fileId);
498 const fileResponse = await client.beta.files.download(fileId);
479 const fileMetadata = await client.files.retrieveMetadata(fileId);
480 const fileResponse = await client.files.download(fileId);
499481 
500482 await writeFile(fileMetadata.filename, Buffer.from(await fileResponse.arrayBuffer()));
501483 console.log(`Downloaded: ${fileMetadata.filename}`);
from line 492
510492 {
511493 Model = "claude-opus-5",
512494 MaxTokens = 4096,
513 Betas = ["code-execution-2025-08-25", "skills-2025-10-02"],
514 Container = new BetaContainerParams
495 Container = new ContainerParams
515496 {
516497 Skills =
517498 [
518 new BetaSkillParams
499 new SkillParams
519500 {
520 Type = BetaSkillParamsType.Anthropic,
501 Type = SkillParamsType.Anthropic,
521502 SkillID = "xlsx",
522503 Version = "latest",
523504 },
524505 ],
525506 },
526507 Messages = [new() { Role = Role.User, Content = "Create an Excel file with a simple budget spreadsheet" }],
527 Tools = [new BetaCodeExecutionTool20250825()],
508 Tools = [new CodeExecutionTool20250825()],
528509 };
529510 
530 var response = await client.Beta.Messages.Create(parameters);
511 var response = await client.Messages.Create(parameters);
531512 
532513 // Step 2: Extract file IDs from the response
533514 List<string> fileIds = [];
534515 foreach (var block in response.Content)
535516 {
536517 if (block.TryPickBashCodeExecutionToolResult(out var toolResult)
537 && toolResult.Content.TryPickBetaBashCodeExecutionResultBlock(out var result))
518 && toolResult.Content.TryPickBashCodeExecutionResultBlock(out var result))
538519 {
539520 foreach (var output in result.Content)
540521 {
from line 527
546527 // Step 3: Download each file and save to disk
547528 foreach (var fileId in fileIds)
548529 {
549 var fileMetadata = await client.Beta.Files.RetrieveMetadata(fileId);
550 using var download = await client.Beta.Files.Download(fileId);
530 var fileMetadata = await client.Files.RetrieveMetadata(fileId);
531 using var download = await client.Files.Download(fileId);
551532 using var downloadStream = await download.ReadAsStream();
552533 using var outputFile = File.Create(fileMetadata.Filename);
553534 await downloadStream.CopyToAsync(outputFile);
from line 541
560541 client := anthropic.NewClient()
561542 
562543 // Step 1: Use a Skill to create a file
563 response, err := client.Beta.Messages.New(context.TODO(), anthropic.BetaMessageNewParams{
544 response, err := client.Messages.New(context.TODO(), anthropic.MessageNewParams{
564545 Model: "claude-opus-5",
565546 MaxTokens: 4096,
566 Betas: []anthropic.AnthropicBeta{"code-execution-2025-08-25", anthropic.AnthropicBetaSkills2025_10_02},
567 Container: anthropic.BetaMessageNewParamsContainerUnion{
568 OfContainers: &anthropic.BetaContainerParams{
569 Skills: []anthropic.BetaSkillParams{
547 Container: anthropic.MessageCreateParamsContainerUnion{
548 OfContainers: &anthropic.ContainerParams{
549 Skills: []anthropic.SkillParams{
570550 {
571 Type: anthropic.BetaSkillParamsTypeAnthropic,
551 Type: anthropic.SkillParamsTypeAnthropic,
572552 SkillID: "xlsx",
573553 Version: anthropic.String("latest"),
574554 },
575555 },
576556 },
577557 },
578 Messages: []anthropic.BetaMessageParam{
579 anthropic.NewBetaUserMessage(anthropic.NewBetaTextBlock("Create an Excel file with a simple budget spreadsheet")),
558 Messages: []anthropic.MessageParam{
559 anthropic.NewUserMessage(anthropic.NewTextBlock("Create an Excel file with a simple budget spreadsheet")),
580560 },
581 Tools: []anthropic.BetaToolUnionParam{
582 {OfCodeExecutionTool20250825: &anthropic.BetaCodeExecutionTool20250825Param{}},
561 Tools: []anthropic.ToolUnionParam{
562 {OfCodeExecutionTool20250825: &anthropic.CodeExecutionTool20250825Param{}},
583563 },
584564 })
585565 if err != nil {
from line 571
591571 
592572 // Step 3: Download the file using Files API
593573 for _, fileID := range fileIDs {
594 fileMetadata, err := client.Beta.Files.GetMetadata(context.TODO(), fileID, anthropic.BetaFileGetMetadataParams{})
574 fileMetadata, err := client.Files.GetMetadata(context.TODO(), fileID)
595575 if err != nil {
596576 log.Fatal(err)
597577 }
598578 
599 fileContent, err := client.Beta.Files.Download(context.TODO(), fileID, anthropic.BetaFileDownloadParams{})
579 fileContent, err := client.Files.Download(context.TODO(), fileID)
600580 if err != nil {
601581 log.Fatal(err)
602582 }
from line 595
615595 }
616596 }
617597 
618 func extractFileIDs(response *anthropic.BetaMessage) []string {
598 func extractFileIDs(response *anthropic.Message) []string {
619599 var fileIDs []string
620600 for _, item := range response.Content {
621601 switch v := item.AsAny().(type) {
622 case anthropic.BetaBashCodeExecutionToolResultBlock:
602 case anthropic.BashCodeExecutionToolResultBlock:
623603 if v.Content.Type == "bash_code_execution_result" {
624604 for _, output := range v.Content.Content {
625605 fileIDs = append(fileIDs, output.FileID)
from line 612
632612 ```
633613 
634614 ```java Java
635 import com.anthropic.models.beta.messages.BetaContainerParams;
636 import com.anthropic.models.beta.messages.BetaSkillParams;
637 import com.anthropic.models.beta.messages.BetaCodeExecutionTool20250825;
638 import com.anthropic.models.beta.messages.BetaContentBlock;
639 import com.anthropic.models.beta.files.FileMetadata;
615 import com.anthropic.models.messages.ContainerParams;
616 import com.anthropic.models.messages.SkillParams;
617 import com.anthropic.models.messages.CodeExecutionTool20250825;
618 import com.anthropic.models.messages.ContentBlock;
619 import com.anthropic.models.files.FileMetadata;
640620 import com.anthropic.core.http.HttpResponse;
641621 // ...
642622 void main() throws Exception {
from line 626
646626 MessageCreateParams params = MessageCreateParams.builder()
647627 .model(Model.CLAUDE_OPUS_5)
648628 .maxTokens(4096L)
649 .addBeta("code-execution-2025-08-25")
650 .addBeta("skills-2025-10-02")
651 .container(BetaContainerParams.builder()
652 .addSkill(BetaSkillParams.builder()
653 .type(BetaSkillParams.Type.ANTHROPIC)
629 .container(ContainerParams.builder()
630 .addSkill(SkillParams.builder()
631 .type(SkillParams.Type.ANTHROPIC)
654632 .skillId("xlsx")
655633 .version("latest")
656634 .build())
657635 .build())
658636 .addUserMessage("Create an Excel file with a simple budget spreadsheet")
659 .addTool(BetaCodeExecutionTool20250825.builder().build())
637 .addTool(CodeExecutionTool20250825.builder().build())
660638 .build();
661639 
662 BetaMessage response = client.beta().messages().create(params);
640 Message response = client.messages().create(params);
663641 
664642 // Step 2: Extract file IDs from the response
665643 List<String> fileIds = new ArrayList<>();
666 for (BetaContentBlock block : response.content()) {
644 for (ContentBlock block : response.content()) {
667645 if (block.isBashCodeExecutionToolResult()) {
668646 var content = block.asBashCodeExecutionToolResult().content();
669 if (content.isBetaBashCodeExecutionResultBlock()) {
670 for (var outputBlock : content.asBetaBashCodeExecutionResultBlock().content()) {
647 if (content.isBashCodeExecutionResultBlock()) {
648 for (var outputBlock : content.asBashCodeExecutionResultBlock().content()) {
671649 fileIds.add(outputBlock.fileId());
672650 }
673651 }
from line 654
676654 
677655 // Step 3: Download the file using Files API
678656 for (String fileId : fileIds) {
679 FileMetadata fileMetadata = client.beta().files().retrieveMetadata(fileId);
680 HttpResponse fileContent = client.beta().files().download(fileId);
657 FileMetadata fileMetadata = client.files().retrieveMetadata(fileId);
658 HttpResponse fileContent = client.files().download(fileId);
681659 
682660 // Step 4: Save to disk
683661 try (InputStream is = fileContent.body();
from line 719
741719 client = Anthropic::Client.new
742720 
743721 # Step 1: Use a Skill to create a file
744 response = client.beta.messages.create(
722 response = client.messages.create(
745723 model: "claude-opus-5",
746724 max_tokens: 4096,
747 betas: ["code-execution-2025-08-25", "skills-2025-10-02"],
748725 container: {
749726 skills: [{ type: "anthropic", skill_id: "xlsx", version: "latest" }]
750727 },
from line 752
775752 
776753 # Step 3: Download the file using Files API
777754 extract_file_ids(response).each do |file_id|
778 file_metadata = client.beta.files.retrieve_metadata(file_id)
779 
780 file_content = client.beta.files.download(file_id)
755 file_metadata = client.files.retrieve_metadata(file_id)
756 
757 file_content = client.files.download(file_id)
781758 
782759 # Step 4: Save to disk
783760 File.binwrite(file_metadata.filename, file_content.read)
from line 770
793770 # Get file metadata
794771 curl "https://api.anthropic.com/v1/files/$FILE_ID" \
795772 -H "x-api-key: $ANTHROPIC_API_KEY" \
796 -H "anthropic-version: 2023-06-01" \
797 -H "anthropic-beta: files-api-2025-04-14"
773 -H "anthropic-version: 2023-06-01"
798774 
799775 # List all files
800776 curl "https://api.anthropic.com/v1/files" \
801777 -H "x-api-key: $ANTHROPIC_API_KEY" \
802 -H "anthropic-version: 2023-06-01" \
803 -H "anthropic-beta: files-api-2025-04-14"
778 -H "anthropic-version: 2023-06-01"
804779 
805780 # Delete a file
806781 curl -X DELETE "https://api.anthropic.com/v1/files/$FILE_ID" \
807782 -H "x-api-key: $ANTHROPIC_API_KEY" \
808 -H "anthropic-version: 2023-06-01" \
809 -H "anthropic-beta: files-api-2025-04-14"
783 -H "anthropic-version: 2023-06-01"
810784 ```
811785 
812786 ```bash CLI
813787 # Get file metadata
814 ant beta:files retrieve-metadata \
788 ant files retrieve-metadata \
815789 --file-id "$FILE_ID" \
816790 --transform '{filename,size_bytes}' \
817791 --format yaml
818792 
819793 # List all files
820 ant beta:files list \
794 ant files list \
821795 --transform '{filename,created_at}' \
822796 --format yaml
823797 
824798 # Delete a file
825 ant beta:files delete --file-id "$FILE_ID" >/dev/null
799 ant files delete --file-id "$FILE_ID" >/dev/null
826800 ```
827801 
828802 ```python Python
829803 client = anthropic.Anthropic()
830804 file_id = "file_011CNha8iCJcU1wXNR6q4V8w"
831805 # Get file metadata
832 file_info = client.beta.files.retrieve_metadata(file_id=file_id)
806 file_info = client.files.retrieve_metadata(file_id=file_id)
833807 print(f"Filename: {file_info.filename}, Size: {file_info.size_bytes} bytes")
834808 
835809 # List all files
836 for file in client.beta.files.list():
810 for file in client.files.list():
837811 print(f"{file.filename} - {file.created_at}")
838812 
839813 # Delete a file
840 client.beta.files.delete(file_id=file_id)
814 client.files.delete(file_id=file_id)
841815 ```
842816 
843817 ```typescript TypeScript
from line 819
845819 const fileId = "file_011CNha8iCJcU1wXNR6q4V8w";
846820 
847821 // Get file metadata
848 const fileInfo = await client.beta.files.retrieveMetadata(fileId);
822 const fileInfo = await client.files.retrieveMetadata(fileId);
849823 console.log(`Filename: ${fileInfo.filename}, Size: ${fileInfo.size_bytes} bytes`);
850824 
851825 // List all files
852 for await (const file of client.beta.files.list()) {
826 for await (const file of client.files.list()) {
853827 console.log(`${file.filename} - ${file.created_at}`);
854828 }
855829 
856830 // Delete a file
857 await client.beta.files.delete(fileId);
831 await client.files.delete(fileId);
858832 ```
859833 
860834 ```csharp C#
from line 837
863837 var fileId = "file_011CNha8iCJcU1wXNR6q4V8w";
864838 
865839 // Get file metadata
866 var fileInfo = await client.Beta.Files.RetrieveMetadata(fileId);
840 var fileInfo = await client.Files.RetrieveMetadata(fileId);
867841 Console.WriteLine($"Filename: {fileInfo.Filename}, Size: {fileInfo.SizeBytes} bytes");
868842 
869843 // List files
870 await foreach (var file in (await client.Beta.Files.List()).Paginate())
844 await foreach (var file in (await client.Files.List()).Paginate())
871845 {
872846 Console.WriteLine($"{file.Filename} - {file.CreatedAt}");
873847 }
874848 
875849 // Delete the file
876 await client.Beta.Files.Delete(fileId);
850 await client.Files.Delete(fileId);
877851 ```
878852 
879853 ```go Go
from line 855
881855 fileID := "file_011CNha8iCJcU1wXNR6q4V8w"
882856 
883857 // Get file metadata
884 fileInfo, err := client.Beta.Files.GetMetadata(context.TODO(), fileID, anthropic.BetaFileGetMetadataParams{})
858 fileInfo, err := client.Files.GetMetadata(context.TODO(), fileID)
885859 if err != nil {
886860 log.Fatal(err)
887861 }
888862 fmt.Printf("Filename: %s, Size: %d bytes\n", fileInfo.Filename, fileInfo.SizeBytes)
889863 
890864 // List all files
891 files := client.Beta.Files.ListAutoPaging(context.TODO(), anthropic.BetaFileListParams{})
865 files := client.Files.ListAutoPaging(context.TODO(), anthropic.FileListParams{})
892866 for files.Next() {
893867 file := files.Current()
894868 fmt.Printf("%s - %s\n", file.Filename, file.CreatedAt)
from line 872
898872 }
899873 
900874 // Delete a file
901 _, err = client.Beta.Files.Delete(context.TODO(), fileID, anthropic.BetaFileDeleteParams{})
875 _, err = client.Files.Delete(context.TODO(), fileID)
902876 if err != nil {
903877 log.Fatal(err)
904878 }
905879 ```
906880 
907881 ```java Java
908 import com.anthropic.models.beta.files.FileMetadata;
909 import com.anthropic.models.beta.files.FileListPage;
882 import com.anthropic.models.files.FileMetadata;
883 import com.anthropic.models.files.FileListPage;
910884 // ...
911885 void main() {
912886 AnthropicClient client = AnthropicOkHttpClient.fromEnv();
913887 String fileId = "file_011CNha8iCJcU1wXNR6q4V8w";
914888 
915889 // Get file metadata
916 FileMetadata fileInfo = client.beta().files().retrieveMetadata(fileId);
890 FileMetadata fileInfo = client.files().retrieveMetadata(fileId);
917891 System.out.println("Filename: " + fileInfo.filename() + ", Size: " + fileInfo.sizeBytes() + " bytes");
918892 
919893 // List files (first page)
920 FileListPage files = client.beta().files().list();
894 FileListPage files = client.files().list();
921895 for (var file : files.data()) {
922896 System.out.println(file.filename() + " - " + file.createdAt());
923897 }
924898 
925899 // Delete a file
926 client.beta().files().delete(fileId);
900 client.files().delete(fileId);
927901 }
928902 ```
929903 
from line 924
950924 file_id = "file_011CNha8iCJcU1wXNR6q4V8w"
951925 
952926 # Get file metadata
953 file_info = client.beta.files.retrieve_metadata(file_id)
927 file_info = client.files.retrieve_metadata(file_id)
954928 puts "Filename: #{file_info.filename}, Size: #{file_info.size_bytes} bytes"
955929 
956930 # List all files
957 client.beta.files.list.auto_paging_each do |file|
931 client.files.list.auto_paging_each do |file|
958932 puts "#{file.filename} - #{file.created_at}"
959933 end
960934 
961935 # Delete a file
962 client.beta.files.delete(file_id)
936 client.files.delete(file_id)
963937 ```
964938</CodeGroup>
965939 
from line 955
981955 
982956 ```bash CLI
983957 # First request creates container
984 CONTAINER_ID=$(ant beta:messages create \
985 --beta code-execution-2025-08-25,skills-2025-10-02 \
958 CONTAINER_ID=$(ant messages create \
986959 --transform container.id \
987960 --raw-output <<'YAML'
988961 model: claude-opus-5
from line 972
999972 )
1000973 
1001974 # Continue conversation with same container
1002 ant beta:messages create \
1003 --beta code-execution-2025-08-25,skills-2025-10-02 <<YAML
975 ant messages create <<YAML
1004976 model: claude-opus-5
1005977 max_tokens: 4096
1006978 container:
from line 995
1023995 client = anthropic.Anthropic()
1024996 
1025997 # First request creates container
1026 response1 = client.beta.messages.create(
998 response1 = client.messages.create(
1027999 model="claude-opus-5",
10281000 max_tokens=4096,
1029 betas=["code-execution-2025-08-25", "skills-2025-10-02"],
10301001 container={
10311002 "skills": [{"type": "anthropic", "skill_id": "xlsx", "version": "latest"}]
10321003 },
from line 1020
10491020 {"role": "user", "content": "What was the total revenue?"},
10501021 ]
10511022 
1052 response2 = client.beta.messages.create(
1023 response2 = client.messages.create(
10531024 model="claude-opus-5",
10541025 max_tokens=4096,
1055 betas=["code-execution-2025-08-25", "skills-2025-10-02"],
10561026 container={
10571027 "id": response1.container.id, # Reuse container
10581028 "skills": [{"type": "anthropic", "skill_id": "xlsx", "version": "latest"}],
from line 1036
10661036 const client = new Anthropic();
10671037 
10681038 // First request creates container
1069 const response1 = await client.beta.messages.create({
1039 const response1 = await client.messages.create({
10701040 model: "claude-opus-5",
10711041 max_tokens: 4096,
1072 betas: ["code-execution-2025-08-25", "skills-2025-10-02"],
10731042 container: {
10741043 skills: [{ type: "anthropic", skill_id: "xlsx", version: "latest" }]
10751044 },
from line 1047
10781047 });
10791048 
10801049 // Continue conversation with same container
1081 const messages: Anthropic.Beta.Messages.BetaMessageParam[] = [
1050 const messages: Anthropic.MessageParam[] = [
10821051 { role: "user", content: "Create a sample sales dataset and analyze it" },
10831052 {
10841053 role: "assistant",
from line 1060
10911060 { role: "user", content: "What was the total revenue?" }
10921061 ];
10931062 
1094 const response2 = await client.beta.messages.create({
1063 const response2 = await client.messages.create({
10951064 model: "claude-opus-5",
10961065 max_tokens: 4096,
1097 betas: ["code-execution-2025-08-25", "skills-2025-10-02"],
10981066 container: {
10991067 id: response1.container!.id, // Reuse container
11001068 skills: [{ type: "anthropic", skill_id: "xlsx", version: "latest" }]
from line 1080
11121080 {
11131081 Model = "claude-opus-5",
11141082 MaxTokens = 4096,
1115 Betas = ["code-execution-2025-08-25", "skills-2025-10-02"],
1116 Container = new BetaContainerParams
1083 Container = new ContainerParams
11171084 {
11181085 Skills =
11191086 [
1120 new BetaSkillParams
1087 new SkillParams
11211088 {
1122 Type = BetaSkillParamsType.Anthropic,
1089 Type = SkillParamsType.Anthropic,
11231090 SkillID = "xlsx",
11241091 Version = "latest",
11251092 },
11261093 ],
11271094 },
11281095 Messages = [new() { Role = Role.User, Content = "Create a sample sales dataset and analyze it" }],
1129 Tools = [new BetaCodeExecutionTool20250825()],
1096 Tools = [new CodeExecutionTool20250825()],
11301097 };
11311098 
1132 var response1 = await client.Beta.Messages.Create(parameters1);
1099 var response1 = await client.Messages.Create(parameters1);
11331100 
11341101 // Continue the conversation in the same container
11351102 // Carry the assistant's text forward; container.id carries the execution state
from line 1109
11421109 {
11431110 Model = "claude-opus-5",
11441111 MaxTokens = 4096,
1145 Betas = ["code-execution-2025-08-25", "skills-2025-10-02"],
1146 Container = new BetaContainerParams
1112 Container = new ContainerParams
11471113 {
11481114 ID = response1.Container!.ID,
11491115 Skills =
11501116 [
1151 new BetaSkillParams
1117 new SkillParams
11521118 {
1153 Type = BetaSkillParamsType.Anthropic,
1119 Type = SkillParamsType.Anthropic,
11541120 SkillID = "xlsx",
11551121 Version = "latest",
11561122 },
from line 1128
11621128 new() { Role = Role.Assistant, Content = assistantText },
11631129 new() { Role = Role.User, Content = "What was the total revenue?" },
11641130 ],
1165 Tools = [new BetaCodeExecutionTool20250825()],
1131 Tools = [new CodeExecutionTool20250825()],
11661132 };
11671133 
1168 var response2 = await client.Beta.Messages.Create(parameters2);
1134 var response2 = await client.Messages.Create(parameters2);
11691135 Console.WriteLine(response2);
11701136 ```
11711137 
11721138 ```go Go
11731139 client := anthropic.NewClient()
11741140 
1175 response1, err := client.Beta.Messages.New(context.TODO(), anthropic.BetaMessageNewParams{
1141 response1, err := client.Messages.New(context.TODO(), anthropic.MessageNewParams{
11761142 Model: "claude-opus-5",
11771143 MaxTokens: 4096,
1178 Betas: []anthropic.AnthropicBeta{"code-execution-2025-08-25", anthropic.AnthropicBetaSkills2025_10_02},
1179 Container: anthropic.BetaMessageNewParamsContainerUnion{
1180 OfContainers: &anthropic.BetaContainerParams{
1181 Skills: []anthropic.BetaSkillParams{
1144 Container: anthropic.MessageCreateParamsContainerUnion{
1145 OfContainers: &anthropic.ContainerParams{
1146 Skills: []anthropic.SkillParams{
11821147 {
1183 Type: anthropic.BetaSkillParamsTypeAnthropic,
1148 Type: anthropic.SkillParamsTypeAnthropic,
11841149 SkillID: "xlsx",
11851150 Version: anthropic.String("latest"),
11861151 },
11871152 },
11881153 },
11891154 },
1190 Messages: []anthropic.BetaMessageParam{
1191 anthropic.NewBetaUserMessage(anthropic.NewBetaTextBlock("Create a sample sales dataset and analyze it")),
1155 Messages: []anthropic.MessageParam{
1156 anthropic.NewUserMessage(anthropic.NewTextBlock("Create a sample sales dataset and analyze it")),
11921157 },
1193 Tools: []anthropic.BetaToolUnionParam{
1194 {OfCodeExecutionTool20250825: &anthropic.BetaCodeExecutionTool20250825Param{}},
1158 Tools: []anthropic.ToolUnionParam{
1159 {OfCodeExecutionTool20250825: &anthropic.CodeExecutionTool20250825Param{}},
11951160 },
11961161 })
11971162 if err != nil {
from line 1172
12071172 }
12081173 assistantText := strings.Join(textParts, "\n")
12091174 
1210 response2, err := client.Beta.Messages.New(context.TODO(), anthropic.BetaMessageNewParams{
1175 response2, err := client.Messages.New(context.TODO(), anthropic.MessageNewParams{
12111176 Model: "claude-opus-5",
12121177 MaxTokens: 4096,
1213 Betas: []anthropic.AnthropicBeta{"code-execution-2025-08-25", anthropic.AnthropicBetaSkills2025_10_02},
1214 Container: anthropic.BetaMessageNewParamsContainerUnion{
1215 OfContainers: &anthropic.BetaContainerParams{
1178 Container: anthropic.MessageCreateParamsContainerUnion{
1179 OfContainers: &anthropic.ContainerParams{
12161180 ID: anthropic.String(response1.Container.ID), // Reuse container
1217 Skills: []anthropic.BetaSkillParams{
1181 Skills: []anthropic.SkillParams{
12181182 {
1219 Type: anthropic.BetaSkillParamsTypeAnthropic,
1183 Type: anthropic.SkillParamsTypeAnthropic,
12201184 SkillID: "xlsx",
12211185 Version: anthropic.String("latest"),
12221186 },
12231187 },
12241188 },
12251189 },
1226 Messages: []anthropic.BetaMessageParam{
1227 anthropic.NewBetaUserMessage(anthropic.NewBetaTextBlock("Create a sample sales dataset and analyze it")),
1190 Messages: []anthropic.MessageParam{
1191 anthropic.NewUserMessage(anthropic.NewTextBlock("Create a sample sales dataset and analyze it")),
12281192 {
1229 Role: anthropic.BetaMessageParamRoleAssistant,
1230 Content: []anthropic.BetaContentBlockParamUnion{anthropic.NewBetaTextBlock(assistantText)},
1193 Role: anthropic.MessageParamRoleAssistant,
1194 Content: []anthropic.ContentBlockParamUnion{anthropic.NewTextBlock(assistantText)},
12311195 },
1232 anthropic.NewBetaUserMessage(anthropic.NewBetaTextBlock("What was the total revenue?")),
1196 anthropic.NewUserMessage(anthropic.NewTextBlock("What was the total revenue?")),
12331197 },
1234 Tools: []anthropic.BetaToolUnionParam{
1235 {OfCodeExecutionTool20250825: &anthropic.BetaCodeExecutionTool20250825Param{}},
1198 Tools: []anthropic.ToolUnionParam{
1199 {OfCodeExecutionTool20250825: &anthropic.CodeExecutionTool20250825Param{}},
12361200 },
12371201 })
12381202 if err != nil {
from line 1207
12431207 ```
12441208 
12451209 ```java Java
1246 import com.anthropic.models.beta.messages.BetaContainerParams;
1247 import com.anthropic.models.beta.messages.BetaSkillParams;
1248 import com.anthropic.models.beta.messages.BetaCodeExecutionTool20250825;
1249 import com.anthropic.models.beta.messages.BetaContentBlock;
1210 import com.anthropic.models.messages.ContainerParams;
1211 import com.anthropic.models.messages.SkillParams;
1212 import com.anthropic.models.messages.CodeExecutionTool20250825;
1213 import com.anthropic.models.messages.ContentBlock;
12501214 // ...
12511215 void main() {
12521216 AnthropicClient client = AnthropicOkHttpClient.fromEnv();
from line 1218
12541218 MessageCreateParams params1 = MessageCreateParams.builder()
12551219 .model(Model.CLAUDE_OPUS_5)
12561220 .maxTokens(4096L)
1257 .addBeta("code-execution-2025-08-25")
1258 .addBeta("skills-2025-10-02")
1259 .container(BetaContainerParams.builder()
1260 .addSkill(BetaSkillParams.builder()
1261 .type(BetaSkillParams.Type.ANTHROPIC)
1221 .container(ContainerParams.builder()
1222 .addSkill(SkillParams.builder()
1223 .type(SkillParams.Type.ANTHROPIC)
12621224 .skillId("xlsx")
12631225 .version("latest")
12641226 .build())
12651227 .build())
12661228 .addUserMessage("Create a sample sales dataset and analyze it")
1267 .addTool(BetaCodeExecutionTool20250825.builder().build())
1229 .addTool(CodeExecutionTool20250825.builder().build())
12681230 .build();
12691231 
1270 BetaMessage response1 = client.beta().messages().create(params1);
1232 Message response1 = client.messages().create(params1);
12711233 
12721234 MessageCreateParams params2 = MessageCreateParams.builder()
12731235 .model(Model.CLAUDE_OPUS_5)
12741236 .maxTokens(4096L)
1275 .addBeta("code-execution-2025-08-25")
1276 .addBeta("skills-2025-10-02")
1277 .container(BetaContainerParams.builder()
1237 .container(ContainerParams.builder()
12781238 .id(response1.container().get().id())
1279 .addSkill(BetaSkillParams.builder()
1280 .type(BetaSkillParams.Type.ANTHROPIC)
1239 .addSkill(SkillParams.builder()
1240 .type(SkillParams.Type.ANTHROPIC)
12811241 .skillId("xlsx")
12821242 .version("latest")
12831243 .build())
from line 1245
12851245 .addUserMessage("Create a sample sales dataset and analyze it")
12861246 // Carry the assistant's text forward; container.id carries the execution state
12871247 .addAssistantMessage(response1.content().stream()
1288 .filter(BetaContentBlock::isText)
1248 .filter(ContentBlock::isText)
12891249 .map(block -> block.asText().text())
12901250 .collect(Collectors.joining("\n")))
12911251 .addUserMessage("What was the total revenue?")
1292 .addTool(BetaCodeExecutionTool20250825.builder().build())
1252 .addTool(CodeExecutionTool20250825.builder().build())
12931253 .build();
12941254 
1295 BetaMessage response2 = client.beta().messages().create(params2);
1255 Message response2 = client.messages().create(params2);
12961256 System.out.println(response2);
12971257 }
12981258 ```
from line 1309
13491309 ```ruby Ruby
13501310 client = Anthropic::Client.new
13511311 
1352 response1 = client.beta.messages.create(
1312 response1 = client.messages.create(
13531313 model: "claude-opus-5",
13541314 max_tokens: 4096,
1355 betas: ["code-execution-2025-08-25", "skills-2025-10-02"],
13561315 container: {
13571316 skills: [{ type: "anthropic", skill_id: "xlsx", version: "latest" }]
13581317 },
from line 1333
13741333 { role: "user", content: "What was the total revenue?" }
13751334 ]
13761335 
1377 response2 = client.beta.messages.create(
1336 response2 = client.messages.create(
13781337 model: "claude-opus-5",
13791338 max_tokens: 4096,
1380 betas: ["code-execution-2025-08-25", "skills-2025-10-02"],
13811339 container: {
13821340 id: response1.container.id,
13831341 skills: [
from line 1362
14041362 RESPONSE=$(curl https://api.anthropic.com/v1/messages \
14051363 -H "x-api-key: $ANTHROPIC_API_KEY" \
14061364 -H "anthropic-version: 2023-06-01" \
1407 -H "anthropic-beta: code-execution-2025-08-25,skills-2025-10-02" \
14081365 -H "content-type: application/json" \
14091366 -d '{
14101367 "model": "claude-opus-5",
from line 1394
14371394 RESPONSE=$(curl https://api.anthropic.com/v1/messages \
14381395 -H "x-api-key: $ANTHROPIC_API_KEY" \
14391396 -H "anthropic-version: 2023-06-01" \
1440 -H "anthropic-beta: code-execution-2025-08-25,skills-2025-10-02" \
14411397 -H "content-type: application/json" \
14421398 -d "{
14431399 \"model\": \"claude-opus-5\",
from line 1418
14621418 RESP=$(mktemp)
14631419 
14641420 # Initial request: capture the full JSON response to a temp file
1465 ant beta:messages create \
1466 --beta code-execution-2025-08-25,skills-2025-10-02 \
1467 > "$RESP" <<'YAML'
1421 ant messages create > "$RESP" <<'YAML'
14681422 model: claude-opus-5
14691423 max_tokens: 4096
14701424 container:
from line 1439
14851439 # assistant turn. Repeat until stop_reason is no longer "pause_turn".
14861440 CONTAINER_ID=$(jq -r '.container.id' "$RESP")
14871441 
1488 ant beta:messages create \
1489 --beta code-execution-2025-08-25,skills-2025-10-02 \
1490 > "$RESP" <<YAML
1442 ant messages create > "$RESP" <<YAML
14911443 model: claude-opus-5
14921444 max_tokens: 4096
14931445 container:
from line 1461
15091461 messages = [{"role": "user", "content": "Generate and process a large sample dataset"}]
15101462 max_retries = 10
15111463 
1512 response = client.beta.messages.create(
1464 response = client.messages.create(
15131465 model="claude-opus-5",
15141466 max_tokens=4096,
1515 betas=["code-execution-2025-08-25", "skills-2025-10-02"],
15161467 container={
15171468 "skills": [
15181469 {
from line 1483
15321483 break
15331484 
15341485 messages.append({"role": "assistant", "content": response.content})
1535 response = client.beta.messages.create(
1486 response = client.messages.create(
15361487 model="claude-opus-5",
15371488 max_tokens=4096,
1538 betas=["code-execution-2025-08-25", "skills-2025-10-02"],
15391489 container={
15401490 "id": response.container.id,
15411491 "skills": [
from line 1503
15531503 
15541504 ```typescript TypeScript
15551505 const client = new Anthropic();
1556 const messages: Anthropic.Beta.Messages.BetaMessageParam[] = [
1506 const messages: Anthropic.MessageParam[] = [
15571507 { role: "user", content: "Generate and process a large sample dataset" }
15581508 ];
15591509 const maxRetries = 10;
15601510 
1561 let response = await client.beta.messages.create({
1511 let response = await client.messages.create({
15621512 model: "claude-opus-5",
15631513 max_tokens: 4096,
1564 betas: ["code-execution-2025-08-25", "skills-2025-10-02"],
15651514 container: {
15661515 skills: [{ type: "custom", skill_id: "skill_01AbCdEfGhIjKlMnOpQrStUv", version: "latest" }]
15671516 },
from line 1526
15771526 
15781527 messages.push({
15791528 role: "assistant",
1580 content: response.content as Anthropic.Beta.Messages.BetaContentBlockParam[]
1529 content: response.content as Anthropic.ContentBlockParam[]
15811530 });
1582 response = await client.beta.messages.create({
1531 response = await client.messages.create({
15831532 model: "claude-opus-5",
15841533 max_tokens: 4096,
1585 betas: ["code-execution-2025-08-25", "skills-2025-10-02"],
15861534 container: {
15871535 id: response.container!.id,
15881536 skills: [
from line 1548
16001548 // ...
16011549 AnthropicClient client = new();
16021550 
1603 List<BetaMessageParam> messages =
1551 List<MessageParam> messages =
16041552 [
16051553 new() { Role = Role.User, Content = "Generate and process a large sample dataset" },
16061554 ];
16071555 
16081556 var maxRetries = 10;
16091557 string? containerId = null;
1610 BetaMessage? response = null;
1558 Message? response = null;
16111559 
16121560 for (var i = 0; i < maxRetries; i++)
16131561 {
from line 1563
16151563 {
16161564 Model = "claude-opus-5",
16171565 MaxTokens = 4096,
1618 Betas = ["code-execution-2025-08-25", "skills-2025-10-02"],
16191566 Container = containerId is null
1620 ? new BetaContainerParams
1567 ? new ContainerParams
16211568 {
16221569 Skills =
16231570 [
1624 new BetaSkillParams
1571 new SkillParams
16251572 {
1626 Type = BetaSkillParamsType.Custom,
1573 Type = SkillParamsType.Custom,
16271574 SkillID = "skill_01AbCdEfGhIjKlMnOpQrStUv",
16281575 Version = "latest",
16291576 },
16301577 ],
16311578 }
1632 : new BetaContainerParams
1579 : new ContainerParams
16331580 {
16341581 ID = containerId,
16351582 Skills =
16361583 [
1637 new BetaSkillParams
1584 new SkillParams
16381585 {
1639 Type = BetaSkillParamsType.Custom,
1586 Type = SkillParamsType.Custom,
16401587 SkillID = "skill_01AbCdEfGhIjKlMnOpQrStUv",
16411588 Version = "latest",
16421589 },
16431590 ],
16441591 },
16451592 Messages = messages,
1646 Tools = [new BetaCodeExecutionTool20250825()],
1593 Tools = [new CodeExecutionTool20250825()],
16471594 };
16481595 
1649 response = await client.Beta.Messages.Create(parameters);
1596 response = await client.Messages.Create(parameters);
16501597 containerId = response.Container!.ID;
16511598 
1652 if (response.StopReason != BetaStopReason.PauseTurn)
1599 if (response.StopReason != StopReason.PauseTurn)
16531600 {
16541601 break;
16551602 }
from line 1605
16581605 var assistantContent = JsonSerializer.SerializeToElement(
16591606 response.Content.Select(block => block.Json).ToArray()
16601607 );
1661 messages.Add(new() { Role = Role.Assistant, Content = new BetaMessageParamContent(assistantContent) });
1608 messages.Add(new() { Role = Role.Assistant, Content = new MessageParamContent(assistantContent) });
16621609 }
16631610 ```
16641611 
16651612 ```go Go
16661613 client := anthropic.NewClient()
16671614 
1668 messages := []anthropic.BetaMessageParam{
1669 anthropic.NewBetaUserMessage(anthropic.NewBetaTextBlock("Generate and process a large sample dataset")),
1615 messages := []anthropic.MessageParam{
1616 anthropic.NewUserMessage(anthropic.NewTextBlock("Generate and process a large sample dataset")),
16701617 }
16711618 maxRetries := 10
16721619 
1673 response, err := client.Beta.Messages.New(context.TODO(), anthropic.BetaMessageNewParams{
1620 response, err := client.Messages.New(context.TODO(), anthropic.MessageNewParams{
16741621 Model: "claude-opus-5",
16751622 MaxTokens: 4096,
1676 Betas: []anthropic.AnthropicBeta{"code-execution-2025-08-25", anthropic.AnthropicBetaSkills2025_10_02},
1677 Container: anthropic.BetaMessageNewParamsContainerUnion{
1678 OfContainers: &anthropic.BetaContainerParams{
1679 Skills: []anthropic.BetaSkillParams{
1623 Container: anthropic.MessageCreateParamsContainerUnion{
1624 OfContainers: &anthropic.ContainerParams{
1625 Skills: []anthropic.SkillParams{
16801626 {
1681 Type: anthropic.BetaSkillParamsTypeCustom,
1627 Type: anthropic.SkillParamsTypeCustom,
16821628 SkillID: "skill_01AbCdEfGhIjKlMnOpQrStUv",
16831629 Version: anthropic.String("latest"),
16841630 },
from line 1632
16861632 },
16871633 },
16881634 Messages: messages,
1689 Tools: []anthropic.BetaToolUnionParam{
1690 {OfCodeExecutionTool20250825: &anthropic.BetaCodeExecutionTool20250825Param{}},
1635 Tools: []anthropic.ToolUnionParam{
1636 {OfCodeExecutionTool20250825: &anthropic.CodeExecutionTool20250825Param{}},
16911637 },
16921638 })
16931639 if err != nil {
from line 1641
16951641 }
16961642 
16971643 for i := 0; i < maxRetries; i++ {
1698 if response.StopReason != anthropic.BetaStopReasonPauseTurn {
1644 if response.StopReason != anthropic.StopReasonPauseTurn {
16991645 break
17001646 }
17011647 
17021648 messages = append(messages, response.ToParam())
17031649 
1704 response, err = client.Beta.Messages.New(context.TODO(), anthropic.BetaMessageNewParams{
1650 response, err = client.Messages.New(context.TODO(), anthropic.MessageNewParams{
17051651 Model: "claude-opus-5",
17061652 MaxTokens: 4096,
1707 Betas: []anthropic.AnthropicBeta{"code-execution-2025-08-25", anthropic.AnthropicBetaSkills2025_10_02},
1708 Container: anthropic.BetaMessageNewParamsContainerUnion{
1709 OfContainers: &anthropic.BetaContainerParams{
1653 Container: anthropic.MessageCreateParamsContainerUnion{
1654 OfContainers: &anthropic.ContainerParams{
17101655 ID: anthropic.String(response.Container.ID), // Reuse container
1711 Skills: []anthropic.BetaSkillParams{
1656 Skills: []anthropic.SkillParams{
17121657 {
1713 Type: anthropic.BetaSkillParamsTypeCustom,
1658 Type: anthropic.SkillParamsTypeCustom,
17141659 SkillID: "skill_01AbCdEfGhIjKlMnOpQrStUv",
17151660 Version: anthropic.String("latest"),
17161661 },
from line 1663
17181663 },
17191664 },
17201665 Messages: messages,
1721 Tools: []anthropic.BetaToolUnionParam{
1722 {OfCodeExecutionTool20250825: &anthropic.BetaCodeExecutionTool20250825Param{}},
1666 Tools: []anthropic.ToolUnionParam{
1667 {OfCodeExecutionTool20250825: &anthropic.CodeExecutionTool20250825Param{}},
17231668 },
17241669 })
17251670 if err != nil {
from line 1676
17311676 ```
17321677 
17331678 ```java Java
1734 import com.anthropic.models.beta.messages.BetaContainerParams;
1735 import com.anthropic.models.beta.messages.BetaSkillParams;
1736 import com.anthropic.models.beta.messages.BetaCodeExecutionTool20250825;
1737 import com.anthropic.models.beta.messages.BetaStopReason;
1679 import com.anthropic.models.messages.ContainerParams;
1680 import com.anthropic.models.messages.SkillParams;
1681 import com.anthropic.models.messages.CodeExecutionTool20250825;
1682 import com.anthropic.models.messages.StopReason;
17381683 // ...
17391684 void main() {
17401685 AnthropicClient client = AnthropicOkHttpClient.fromEnv();
17411686 
1742 List<BetaMessageParam> messages = new ArrayList<>();
1687 List<MessageParam> messages = new ArrayList<>();
17431688 messages.add(
1744 BetaMessageParam.builder()
1745 .role(BetaMessageParam.Role.USER)
1689 MessageParam.builder()
1690 .role(MessageParam.Role.USER)
17461691 .content("Generate and process a large sample dataset")
17471692 .build()
17481693 );
17491694 int maxRetries = 10;
17501695 
1751 BetaMessage response = client.beta().messages().create(
1696 Message response = client.messages().create(
17521697 MessageCreateParams.builder()
17531698 .model(Model.CLAUDE_OPUS_5)
17541699 .maxTokens(4096L)
1755 .addBeta("code-execution-2025-08-25")
1756 .addBeta("skills-2025-10-02")
1757 .container(BetaContainerParams.builder()
1758 .addSkill(BetaSkillParams.builder()
1759 .type(BetaSkillParams.Type.CUSTOM)
1700 .container(ContainerParams.builder()
1701 .addSkill(SkillParams.builder()
1702 .type(SkillParams.Type.CUSTOM)
17601703 .skillId("skill_01AbCdEfGhIjKlMnOpQrStUv")
17611704 .version("latest")
17621705 .build())
17631706 .build())
17641707 .messages(messages)
1765 .addTool(BetaCodeExecutionTool20250825.builder().build())
1708 .addTool(CodeExecutionTool20250825.builder().build())
17661709 .build());
17671710 
17681711 for (int i = 0; i < maxRetries; i++) {
17691712 if (!response.stopReason().isPresent()
1770 || !response.stopReason().get().equals(BetaStopReason.PAUSE_TURN)) {
1713 || !response.stopReason().get().equals(StopReason.PAUSE_TURN)) {
17711714 break;
17721715 }
17731716 
17741717 messages.add(response.toParam());
17751718 
1776 response = client.beta().messages().create(
1719 response = client.messages().create(
17771720 MessageCreateParams.builder()
17781721 .model(Model.CLAUDE_OPUS_5)
17791722 .maxTokens(4096L)
1780 .addBeta("code-execution-2025-08-25")
1781 .addBeta("skills-2025-10-02")
1782 .container(BetaContainerParams.builder()
1723 .container(ContainerParams.builder()
17831724 .id(response.container().get().id())
1784 .addSkill(BetaSkillParams.builder()
1785 .type(BetaSkillParams.Type.CUSTOM)
1725 .addSkill(SkillParams.builder()
1726 .type(SkillParams.Type.CUSTOM)
17861727 .skillId("skill_01AbCdEfGhIjKlMnOpQrStUv")
17871728 .version("latest")
17881729 .build())
17891730 .build())
17901731 .messages(messages)
1791 .addTool(BetaCodeExecutionTool20250825.builder().build())
1732 .addTool(CodeExecutionTool20250825.builder().build())
17921733 .build());
17931734 }
17941735 }
from line 1795
18541795 ]
18551796 max_retries = 10
18561797 
1857 response = client.beta.messages.create(
1798 response = client.messages.create(
18581799 model: "claude-opus-5",
18591800 max_tokens: 4096,
1860 betas: ["code-execution-2025-08-25", "skills-2025-10-02"],
18611801 container: {
18621802 skills: [
18631803 {
from line 1816
18761816 
18771817 messages << { role: "assistant", content: response.content }
18781818 
1879 response = client.beta.messages.create(
1819 response = client.messages.create(
18801820 model: "claude-opus-5",
18811821 max_tokens: 4096,
1882 betas: ["code-execution-2025-08-25", "skills-2025-10-02"],
18831822 container: {
18841823 id: response.container.id,
18851824 skills: [
from line 1849
19101849 curl https://api.anthropic.com/v1/messages \
19111850 -H "x-api-key: $ANTHROPIC_API_KEY" \
19121851 -H "anthropic-version: 2023-06-01" \
1913 -H "anthropic-beta: code-execution-2025-08-25,skills-2025-10-02" \
19141852 -H "content-type: application/json" \
19151853 -d '{
19161854 "model": "claude-opus-5",
from line 1884
19461884 ```
19471885 
19481886 ```bash CLI
1949 ant beta:messages create \
1950 --beta code-execution-2025-08-25,skills-2025-10-02 <<'YAML'
1887 ant messages create <<'YAML'
19511888 model: claude-opus-5
19521889 max_tokens: 4096
19531890 container:
from line 1910
19731910 ```python Python
19741911 client = anthropic.Anthropic()
19751912 
1976 response = client.beta.messages.create(
1913 response = client.messages.create(
19771914 model="claude-opus-5",
19781915 max_tokens=4096,
1979 betas=["code-execution-2025-08-25", "skills-2025-10-02"],
19801916 container={
19811917 "skills": [
19821918 {"type": "anthropic", "skill_id": "xlsx", "version": "latest"},
from line 1934
19981934 ```typescript TypeScript
19991935 const client = new Anthropic();
20001936 
2001 const response = await client.beta.messages.create({
1937 const response = await client.messages.create({
20021938 model: "claude-opus-5",
20031939 max_tokens: 4096,
2004 betas: ["code-execution-2025-08-25", "skills-2025-10-02"],
20051940 container: {
20061941 skills: [
20071942 {
from line 1978
20431978 {
20441979 Model = "claude-opus-5",
20451980 MaxTokens = 4096,
2046 Betas = ["code-execution-2025-08-25", "skills-2025-10-02"],
2047 Container = new BetaContainerParams
1981 Container = new ContainerParams
20481982 {
20491983 Skills =
20501984 [
2051 new BetaSkillParams
1985 new SkillParams
20521986 {
2053 Type = BetaSkillParamsType.Anthropic,
1987 Type = SkillParamsType.Anthropic,
20541988 SkillID = "xlsx",
20551989 Version = "latest",
20561990 },
2057 new BetaSkillParams
1991 new SkillParams
20581992 {
2059 Type = BetaSkillParamsType.Anthropic,
1993 Type = SkillParamsType.Anthropic,
20601994 SkillID = "pptx",
20611995 Version = "latest",
20621996 },
2063 new BetaSkillParams
1997 new SkillParams
20641998 {
2065 Type = BetaSkillParamsType.Custom,
1999 Type = SkillParamsType.Custom,
20662000 SkillID = "skill_01AbCdEfGhIjKlMnOpQrStUv",
20672001 Version = "latest",
20682002 },
20692003 ],
20702004 },
20712005 Messages = [new() { Role = Role.User, Content = "Analyze sales data and create a presentation" }],
2072 Tools = [new BetaCodeExecutionTool20250825()],
2006 Tools = [new CodeExecutionTool20250825()],
20732007 };
20742008 
2075 var message = await client.Beta.Messages.Create(parameters);
2009 var message = await client.Messages.Create(parameters);
20762010 Console.WriteLine(message);
20772011 ```
20782012 
20792013 ```go Go
20802014 client := anthropic.NewClient()
20812015 
2082 response, err := client.Beta.Messages.New(context.TODO(), anthropic.BetaMessageNewParams{
2016 response, err := client.Messages.New(context.TODO(), anthropic.MessageNewParams{
20832017 Model: "claude-opus-5",
20842018 MaxTokens: 4096,
2085 Betas: []anthropic.AnthropicBeta{
2086 "code-execution-2025-08-25",
2087 anthropic.AnthropicBetaSkills2025_10_02,
2088 },
2089 Container: anthropic.BetaMessageNewParamsContainerUnion{
2090 OfContainers: &anthropic.BetaContainerParams{
2091 Skills: []anthropic.BetaSkillParams{
2019 Container: anthropic.MessageCreateParamsContainerUnion{
2020 OfContainers: &anthropic.ContainerParams{
2021 Skills: []anthropic.SkillParams{
20922022 {
2093 Type: anthropic.BetaSkillParamsTypeAnthropic,
2023 Type: anthropic.SkillParamsTypeAnthropic,
20942024 SkillID: "xlsx",
20952025 Version: anthropic.String("latest"),
20962026 },
20972027 {
2098 Type: anthropic.BetaSkillParamsTypeAnthropic,
2028 Type: anthropic.SkillParamsTypeAnthropic,
20992029 SkillID: "pptx",
21002030 Version: anthropic.String("latest"),
21012031 },
21022032 {
2103 Type: anthropic.BetaSkillParamsTypeCustom,
2033 Type: anthropic.SkillParamsTypeCustom,
21042034 SkillID: "skill_01AbCdEfGhIjKlMnOpQrStUv",
21052035 Version: anthropic.String("latest"),
21062036 },
21072037 },
21082038 },
21092039 },
2110 Messages: []anthropic.BetaMessageParam{
2111 anthropic.NewBetaUserMessage(anthropic.NewBetaTextBlock("Analyze sales data and create a presentation")),
2040 Messages: []anthropic.MessageParam{
2041 anthropic.NewUserMessage(anthropic.NewTextBlock("Analyze sales data and create a presentation")),
21122042 },
2113 Tools: []anthropic.BetaToolUnionParam{
2114 {OfCodeExecutionTool20250825: &anthropic.BetaCodeExecutionTool20250825Param{}},
2043 Tools: []anthropic.ToolUnionParam{
2044 {OfCodeExecutionTool20250825: &anthropic.CodeExecutionTool20250825Param{}},
21152045 },
21162046 })
21172047 if err != nil {
from line 2051
21212051 ```
21222052 
21232053 ```java Java
2124 import com.anthropic.models.beta.messages.BetaContainerParams;
2125 import com.anthropic.models.beta.messages.BetaSkillParams;
2126 import com.anthropic.models.beta.messages.BetaCodeExecutionTool20250825;
2054 import com.anthropic.models.messages.ContainerParams;
2055 import com.anthropic.models.messages.SkillParams;
2056 import com.anthropic.models.messages.CodeExecutionTool20250825;
21272057 // ...
21282058 void main() {
21292059 AnthropicClient client = AnthropicOkHttpClient.fromEnv();
from line 2061
21312061 MessageCreateParams params = MessageCreateParams.builder()
21322062 .model(Model.CLAUDE_OPUS_5)
21332063 .maxTokens(4096L)
2134 .addBeta("code-execution-2025-08-25")
2135 .addBeta("skills-2025-10-02")
2136 .container(BetaContainerParams.builder()
2064 .container(ContainerParams.builder()
21372065 .skills(List.of(
2138 BetaSkillParams.builder()
2139 .type(BetaSkillParams.Type.ANTHROPIC)
2066 SkillParams.builder()
2067 .type(SkillParams.Type.ANTHROPIC)
21402068 .skillId("xlsx")
21412069 .version("latest")
21422070 .build(),
2143 BetaSkillParams.builder()
2144 .type(BetaSkillParams.Type.ANTHROPIC)
2071 SkillParams.builder()
2072 .type(SkillParams.Type.ANTHROPIC)
21452073 .skillId("pptx")
21462074 .version("latest")
21472075 .build(),
2148 BetaSkillParams.builder()
2149 .type(BetaSkillParams.Type.CUSTOM)
2076 SkillParams.builder()
2077 .type(SkillParams.Type.CUSTOM)
21502078 .skillId("skill_01AbCdEfGhIjKlMnOpQrStUv")
21512079 .version("latest")
21522080 .build()
21532081 ))
21542082 .build())
21552083 .addUserMessage("Analyze sales data and create a presentation")
2156 .addTool(BetaCodeExecutionTool20250825.builder().build())
2084 .addTool(CodeExecutionTool20250825.builder().build())
21572085 .build();
21582086 
2159 BetaMessage response = client.beta().messages().create(params);
2087 Message response = client.messages().create(params);
21602088 System.out.println(response);
21612089 }
21622090 ```
from line 2129
22012129 ```ruby Ruby
22022130 client = Anthropic::Client.new
22032131 
2204 message = client.beta.messages.create(
2132 message = client.messages.create(
22052133 model: "claude-opus-5",
22062134 max_tokens: 4096,
2207 betas: ["code-execution-2025-08-25", "skills-2025-10-02"],
22082135 container: {
22092136 skills: [
22102137 {
from line 2185
22582185 curl -X POST "https://api.anthropic.com/v1/skills" \
22592186 -H "x-api-key: $ANTHROPIC_API_KEY" \
22602187 -H "anthropic-version: 2023-06-01" \
2261 -H "anthropic-beta: skills-2025-10-02" \
22622188 -F "files[]=@financial_skill/SKILL.md;filename=financial_skill/SKILL.md" \
22632189 -F "files[]=@financial_skill/analyze.py;filename=financial_skill/analyze.py"
22642190 ```
22652191 
2266 ```bash CLI
2267 ant beta:skills create \
2268 --file example_skill.zip \
2269 --beta skills-2025-10-02
2270 
2271 # Per-file upload requires path-qualified filenames, which the CLI
2272 # can't currently set. Upload a zip archive instead.
2273 ```
2192 <MultiFileExample language="cli" label="CLI">
2193 ```bash CLI
2194 zip -r financial_skill.zip financial_skill/
2195 ant skills create --file financial_skill.zip
2196 ```
2197 
2198 <File filename="financial_skill/SKILL.md">
2199 ```markdown
2200 ---
2201 name: financial-skill
2202 description: Docs example skill.
2203 ---
2204 ```
2205 </File>
2206 
2207 <File filename="financial_skill/analyze.py">
2208 ```python
2209 print("financial analysis helper")
2210 ```
2211 </File>
2212 </MultiFileExample>
22742213 
22752214 ```python Python
22762215 from anthropic.lib import files_from_dir
from line 2217
22782217 client = anthropic.Anthropic()
22792218 
22802219 # Option 1: Using a zip file
2281 skill = client.beta.skills.create(
2220 skill = client.skills.create(
22822221 files=[open("example_skill.zip", "rb")],
22832222 )
22842223 
22852224 # Option 2: Using file tuples (filename, file_content, mime_type)
2286 skill = client.beta.skills.create(
2225 skill = client.skills.create(
22872226 files=[
22882227 (
22892228 "financial_skill/SKILL.md",
from line 2238
22992238 )
23002239 
23012240 # Option 3: Using the files_from_dir helper (Python only)
2302 skill = client.beta.skills.create(
2241 skill = client.skills.create(
23032242 files=files_from_dir("financial_skill"),
23042243 )
23052244 
23062245 print(f"Created skill: {skill.id}")
2307 print(f"Latest version: {skill.latest_version}")
2246 print(f"Latest version: {skill.latest_version_id}")
23082247 ```
23092248 
23102249 ```typescript TypeScript
from line 2254
23152254 const client = new Anthropic();
23162255 
23172256 // Option 1: Using a zip file
2318 const skillFromZip = await client.beta.skills.create({
2257 const skillFromZip = await client.skills.create({
23192258 files: [await toFile(fs.createReadStream("example_skill.zip"), "example_skill.zip")]
23202259 });
23212260 
23222261 // Option 2: Using individual file objects
2323 const skill = await client.beta.skills.create({
2262 const skill = await client.skills.create({
23242263 files: [
23252264 await toFile(fs.createReadStream("financial_skill/SKILL.md"), "financial_skill/SKILL.md", {
23262265 type: "text/markdown"
from line 2273
23342273 });
23352274 
23362275 console.log(`Created skill: ${skill.id}`);
2337 console.log(`Latest version: ${skill.latest_version}`);
2276 console.log(`Latest version: ${skill.latest_version_id}`);
23382277 ```
23392278 
23402279 ```csharp C#
from line 2288
23492288 Files = [File.OpenRead("example_skill.zip")],
23502289 };
23512290 
2352 var skill = await client.Beta.Skills.Create(parameters);
2291 var skill = await client.Skills.Create(parameters);
23532292 
23542293 // Option 2: Using individual files (path-qualified filenames preserve the Skill's directory layout)
23552294 var parameters2 = new SkillCreateParams
from line 2308
23692308 ],
23702309 };
23712310 
2372 var skill2 = await client.Beta.Skills.Create(parameters2);
2311 var skill2 = await client.Skills.Create(parameters2);
23732312 
23742313 Console.WriteLine($"Created skill: {skill.ID}");
2375 Console.WriteLine($"Latest version: {skill.LatestVersion}");
2314 Console.WriteLine($"Latest version: {skill.LatestVersionID}");
23762315 Console.WriteLine($"Created skill 2: {skill2.ID}");
23772316 ```
23782317 
from line 2325
23862325 }
23872326 defer zipFile.Close()
23882327 
2389 skill, err := client.Beta.Skills.New(context.TODO(), anthropic.BetaSkillNewParams{
2328 skill, err := client.Skills.New(context.TODO(), anthropic.SkillNewParams{
23902329 Files: []io.Reader{zipFile},
23912330 })
23922331 if err != nil {
from line 2345
24062345 }
24072346 defer analyzePy.Close()
24082347 
2409 skill2, err := client.Beta.Skills.New(context.TODO(), anthropic.BetaSkillNewParams{
2348 skill2, err := client.Skills.New(context.TODO(), anthropic.SkillNewParams{
24102349 Files: []io.Reader{
24112350 anthropic.File(skillMd, "financial_skill/SKILL.md", "text/markdown"),
24122351 anthropic.File(analyzePy, "financial_skill/analyze.py", "text/x-python"),
from line 2356
24172356 }
24182357 
24192358 fmt.Printf("Created skill: %s\n", skill.ID)
2420 fmt.Printf("Latest version: %s\n", skill.LatestVersion)
2359 fmt.Printf("Latest version: %s\n", skill.LatestVersionID)
24212360 fmt.Printf("Created skill 2: %s\n", skill2.ID)
24222361 ```
24232362 
24242363 ```java Java
24252364 import com.anthropic.core.MultipartField;
2426 import com.anthropic.models.beta.skills.SkillCreateParams;
2427 import com.anthropic.models.beta.skills.SkillCreateResponse;
2365 import com.anthropic.models.skills.SkillCreateParams;
2366 import com.anthropic.models.skills.Skill;
24282367 // ...
24292368 void main() throws Exception {
24302369 // ...
from line 2378
24392378 .build())
24402379 .build();
24412380 
2442 SkillCreateResponse skill = client.beta().skills().create(params);
2381 Skill skill = client.skills().create(params);
24432382 
24442383 // Option 2: Using individual files (path-qualified filenames preserve the Skill's directory layout)
24452384 SkillCreateParams params2 = SkillCreateParams.builder()
from line 2394
24552394 .build())
24562395 .build();
24572396 
2458 SkillCreateResponse skill2 = client.beta().skills().create(params2);
2397 Skill skill2 = client.skills().create(params2);
24592398 
24602399 System.out.println("Created skill: " + skill.id());
2461 System.out.println("Latest version: " + skill.latestVersion().orElseThrow());
2400 System.out.println("Latest version: " + skill.latestVersionId());
24622401 System.out.println("Created skill 2: " + skill2.id());
24632402 }
24642403 ```
from line 2431
24922431 client = Anthropic::Client.new
24932432 
24942433 # Option 1: Using a zip file
2495 skill = client.beta.skills.create(
2434 skill = client.skills.create(
24962435 files: [
24972436 File.open("example_skill.zip", "rb")
24982437 ]
24992438 )
25002439 
25012440 # Option 2: Using individual files
2502 skill = client.beta.skills.create(
2441 skill = client.skills.create(
25032442 files: [
25042443 Anthropic::FilePart.new(
25052444 Pathname("financial_skill/SKILL.md"),
from line 2454
25152454 )
25162455 
25172456 puts "Created skill: #{skill.id}"
2518 puts "Latest version: #{skill.latest_version}"
2457 puts "Latest version: #{skill.latest_version_id}"
25192458 ```
25202459</CodeGroup>
25212460 
from line 2471
25322471 * `name`: Maximum 64 characters, lowercase letters/numbers/hyphens only, no XML tags, no reserved words ("anthropic", "claude")
25332472 * `description`: Maximum 1024 characters, non-empty, no XML tags
25342473 
2535For complete request/response schemas, see the [Create Skill API reference](https://platform.claude.com/docs/en/api/beta/skills/create).
2474For complete request/response schemas, see the [Create Skill API reference](https://platform.claude.com/docs/en/api/skills/create).
25362475 
25372476### Listing Skills
25382477 
from line 2482
25432482 # List all Skills
25442483 curl "https://api.anthropic.com/v1/skills" \
25452484 -H "x-api-key: $ANTHROPIC_API_KEY" \
2546 -H "anthropic-version: 2023-06-01" \
2547 -H "anthropic-beta: skills-2025-10-02"
2485 -H "anthropic-version: 2023-06-01"
25482486 
25492487 # List only custom Skills
25502488 curl "https://api.anthropic.com/v1/skills?source=custom" \
25512489 -H "x-api-key: $ANTHROPIC_API_KEY" \
2552 -H "anthropic-version: 2023-06-01" \
2553 -H "anthropic-beta: skills-2025-10-02"
2490 -H "anthropic-version: 2023-06-01"
25542491 ```
25552492 
25562493 ```bash CLI
25572494 # List all Skills
2558 ant beta:skills list
2495 ant skills list
25592496 
25602497 # List only custom Skills
2561 ant beta:skills list --source custom
2498 ant skills list --source custom
25622499 ```
25632500 
25642501 ```python Python
25652502 client = anthropic.Anthropic()
25662503 
25672504 # List all Skills
2568 for skill in client.beta.skills.list():
2569 print(f"{skill.id}: {skill.display_title} (source: {skill.source})")
2505 for skill in client.skills.list():
2506 print(f"{skill.id}: {skill.display_name} (source: {skill.source.type})")
25702507 
25712508 # List only custom Skills
2572 custom_skills = client.beta.skills.list(source="custom")
2509 custom_skills = client.skills.list(source="custom")
25732510 ```
25742511 
25752512 ```typescript TypeScript
25762513 const client = new Anthropic();
25772514 
25782515 // List all Skills
2579 for await (const skill of client.beta.skills.list()) {
2580 console.log(`${skill.id}: ${skill.display_title} (source: ${skill.source})`);
2516 for await (const skill of client.skills.list()) {
2517 console.log(`${skill.id}: ${skill.display_name} (source: ${skill.source.type})`);
25812518 }
25822519 
25832520 // List only custom Skills
2584 const customSkills = await client.beta.skills.list({
2521 const customSkills = await client.skills.list({
25852522 source: "custom"
25862523 });
25872524 ```
from line 2527
25902527 AnthropicClient client = new();
25912528 
25922529 // List all Skills
2593 await foreach (var skill in (await client.Beta.Skills.List()).Paginate())
2530 await foreach (var skill in (await client.Skills.List()).Paginate())
25942531 {
2595 Console.WriteLine($"{skill.ID}: {skill.DisplayTitle} (source: {skill.Source})");
2532 Console.WriteLine($"{skill.ID}: {skill.DisplayName} (source: {skill.Source.Type})");
25962533 }
25972534 
25982535 // List only custom Skills
2599 var customSkills = await client.Beta.Skills.List(new SkillListParams { Source = "custom" });
2536 var customSkills = await client.Skills.List(new SkillListParams { Source = "custom" });
26002537 ```
26012538 
26022539 ```go Go
26032540 client := anthropic.NewClient()
26042541 
26052542 // List all Skills
2606 skills := client.Beta.Skills.ListAutoPaging(context.TODO(), anthropic.BetaSkillListParams{})
2543 skills := client.Skills.ListAutoPaging(context.TODO(), anthropic.SkillListParams{})
26072544 
26082545 for skills.Next() {
26092546 skill := skills.Current()
2610 fmt.Printf("%s: %s (source: %s)\n", skill.ID, skill.DisplayTitle, skill.Source)
2547 fmt.Printf("%s: %s (source: %s)\n", skill.ID, skill.DisplayName, skill.Source.Type)
26112548 }
26122549 if skills.Err() != nil {
26132550 log.Fatal(skills.Err())
26142551 }
26152552 
26162553 // List only custom Skills
2617 customSkills := client.Beta.Skills.ListAutoPaging(context.TODO(), anthropic.BetaSkillListParams{
2554 customSkills := client.Skills.ListAutoPaging(context.TODO(), anthropic.SkillListParams{
26182555 Source: anthropic.String("custom"),
26192556 })
26202557 
26212558 for customSkills.Next() {
26222559 skill := customSkills.Current()
2623 fmt.Printf("%s: %s (source: %s)\n", skill.ID, skill.DisplayTitle, skill.Source)
2560 fmt.Printf("%s: %s (source: %s)\n", skill.ID, skill.DisplayName, skill.Source.Type)
26242561 }
26252562 if customSkills.Err() != nil {
26262563 log.Fatal(customSkills.Err())
from line 2565
26282565 ```
26292566 
26302567 ```java Java
2631 import com.anthropic.models.beta.skills.SkillListParams;
2632 import com.anthropic.models.beta.skills.SkillListPage;
2633 import com.anthropic.models.beta.skills.SkillListResponse;
2568 import com.anthropic.models.skills.SkillListParams;
2569 import com.anthropic.models.skills.SkillListPage;
2570 import com.anthropic.models.skills.Skill;
26342571 // ...
26352572 void main() {
26362573 AnthropicClient client = AnthropicOkHttpClient.fromEnv();
26372574 
26382575 // List Skills (first page)
2639 SkillListPage skills = client.beta().skills().list();
2640 
2641 for (SkillListResponse skill : skills.data()) {
2642 System.out.println(skill.id() + ": " + skill.displayTitle().orElseThrow() + " (source: " + skill.source() + ")");
2576 SkillListPage skills = client.skills().list();
2577 
2578 for (Skill skill : skills.data()) {
2579 System.out.println(skill.id() + ": " + skill.displayName() + " (source: " + skill.source().type() + ")");
26432580 }
26442581 
26452582 // List only custom Skills
from line 2584
26472584 .source("custom")
26482585 .build();
26492586 
2650 SkillListPage customSkills = client.beta().skills().list(customParams);
2587 SkillListPage customSkills = client.skills().list(customParams);
26512588 }
26522589 ```
26532590 
from line 2608
26712608 client = Anthropic::Client.new
26722609 
26732610 # List all Skills
2674 client.beta.skills.list.auto_paging_each do |skill|
2675 puts "#{skill.id}: #{skill.display_title} (source: #{skill.source})"
2611 client.skills.list.auto_paging_each do |skill|
2612 puts "#{skill.id}: #{skill.display_name} (source: #{skill.source.type})"
26762613 end
26772614 
26782615 # List only custom Skills
2679 custom_skills = client.beta.skills.list(
2616 custom_skills = client.skills.list(
26802617 source: "custom"
26812618 )
26822619 ```
26832620</CodeGroup>
26842621 
2685See the [List Skills API reference](https://platform.claude.com/docs/en/api/beta/skills/list) for pagination and filtering options.
2622See the [List Skills API reference](https://platform.claude.com/docs/en/api/skills/list) for pagination and filtering options.
26862623 
26872624### Retrieving a Skill
26882625 
from line 2629
26922629 ```bash cURL
26932630 curl "https://api.anthropic.com/v1/skills/skill_01AbCdEfGhIjKlMnOpQrStUv" \
26942631 -H "x-api-key: $ANTHROPIC_API_KEY" \
2695 -H "anthropic-version: 2023-06-01" \
2696 -H "anthropic-beta: skills-2025-10-02"
2632 -H "anthropic-version: 2023-06-01"
26972633 ```
26982634 
26992635 ```bash CLI
2700 ant beta:skills retrieve \
2636 ant skills retrieve \
27012637 --skill-id skill_01AbCdEfGhIjKlMnOpQrStUv
27022638 ```
27032639 
27042640 ```python Python
27052641 client = anthropic.Anthropic()
27062642 
2707 skill = client.beta.skills.retrieve(skill_id="skill_01AbCdEfGhIjKlMnOpQrStUv")
2708 
2709 print(f"Skill: {skill.display_title}")
2710 print(f"Latest version: {skill.latest_version}")
2643 skill = client.skills.retrieve(skill_id="skill_01AbCdEfGhIjKlMnOpQrStUv")
2644 
2645 print(f"Skill: {skill.display_name}")
2646 print(f"Latest version: {skill.latest_version_id}")
27112647 print(f"Created: {skill.created_at}")
27122648 ```
27132649 
27142650 ```typescript TypeScript
27152651 const client = new Anthropic();
27162652 
2717 const skill = await client.beta.skills.retrieve("skill_01AbCdEfGhIjKlMnOpQrStUv");
2718 
2719 console.log(`Skill: ${skill.display_title}`);
2720 console.log(`Latest version: ${skill.latest_version}`);
2653 const skill = await client.skills.retrieve("skill_01AbCdEfGhIjKlMnOpQrStUv");
2654 
2655 console.log(`Skill: ${skill.display_name}`);
2656 console.log(`Latest version: ${skill.latest_version_id}`);
27212657 console.log(`Created: ${skill.created_at}`);
27222658 ```
27232659 
27242660 ```csharp C#
27252661 AnthropicClient client = new();
27262662 
2727 var skill = await client.Beta.Skills.Retrieve("skill_01AbCdEfGhIjKlMnOpQrStUv");
2728 
2729 Console.WriteLine($"Skill: {skill.DisplayTitle}");
2730 Console.WriteLine($"Latest version: {skill.LatestVersion}");
2663 var skill = await client.Skills.Retrieve("skill_01AbCdEfGhIjKlMnOpQrStUv");
2664 
2665 Console.WriteLine($"Skill: {skill.DisplayName}");
2666 Console.WriteLine($"Latest version: {skill.LatestVersionID}");
27312667 Console.WriteLine($"Created: {skill.CreatedAt}");
27322668 ```
27332669 
27342670 ```go Go
27352671 client := anthropic.NewClient()
27362672 
2737 skill, err := client.Beta.Skills.Get(
2673 skill, err := client.Skills.Get(
27382674 context.TODO(),
27392675 "skill_01AbCdEfGhIjKlMnOpQrStUv",
2740 anthropic.BetaSkillGetParams{},
27412676 )
27422677 if err != nil {
27432678 log.Fatal(err)
27442679 }
27452680 
2746 fmt.Printf("Skill: %s\n", skill.DisplayTitle)
2747 fmt.Printf("Latest version: %s\n", skill.LatestVersion)
2681 fmt.Printf("Skill: %s\n", skill.DisplayName)
2682 fmt.Printf("Latest version: %s\n", skill.LatestVersionID)
27482683 fmt.Printf("Created: %s\n", skill.CreatedAt)
27492684 ```
27502685 
27512686 ```java Java
2752 import com.anthropic.models.beta.skills.SkillRetrieveResponse;
2687 import com.anthropic.models.skills.Skill;
27532688 // ...
27542689 void main() {
27552690 AnthropicClient client = AnthropicOkHttpClient.fromEnv();
27562691 
2757 SkillRetrieveResponse skill = client.beta().skills().retrieve("skill_01AbCdEfGhIjKlMnOpQrStUv");
2758 
2759 System.out.println("Skill: " + skill.displayTitle().orElseThrow());
2760 System.out.println("Latest version: " + skill.latestVersion().orElseThrow());
2692 Skill skill = client.skills().retrieve("skill_01AbCdEfGhIjKlMnOpQrStUv");
2693 
2694 System.out.println("Skill: " + skill.displayName());
2695 System.out.println("Latest version: " + skill.latestVersionId());
27612696 System.out.println("Created: " + skill.createdAt());
27622697 }
27632698 ```
from line 2712
27772712 ```ruby Ruby
27782713 client = Anthropic::Client.new
27792714 
2780 skill = client.beta.skills.retrieve("skill_01AbCdEfGhIjKlMnOpQrStUv")
2781 
2782 puts "Skill: #{skill.display_title}"
2783 puts "Latest version: #{skill.latest_version}"
2715 skill = client.skills.retrieve("skill_01AbCdEfGhIjKlMnOpQrStUv")
2716 
2717 puts "Skill: #{skill.display_name}"
2718 puts "Latest version: #{skill.latest_version_id}"
27842719 puts "Created: #{skill.created_at}"
27852720 ```
27862721</CodeGroup>
27872722 
27882723### Deleting a Skill
27892724 
2790Deleting a Skill also removes all of its versions. The cascade is GA-only behavior, so unlike the other examples in this guide, these call the GA surface directly rather than the `beta` namespace.
2725Deleting a Skill also removes all of its versions.
27912726 
27922727<CodeGroup defaultLanguage="CLI">
27932728 ```bash cURL
from line 2777
28422777 ```php PHP
28432778 $client = new Client();
28442779 
2845 $client->skills->delete(
2846 skillID: 'skill_01AbCdEfGhIjKlMnOpQrStUv',
2847 );
2780 // The PHP SDK still uses the beta Skills namespace, where a Skill's versions
2781 // must be deleted before the Skill itself.
2782 $skillId = 'skill_01AbCdEfGhIjKlMnOpQrStUv';
2783 foreach ($client->beta->skills->versions->list($skillId)->pagingEachItem() as $version) {
2784 $client->beta->skills->versions->delete($version->version, skillID: $skillId);
2785 }
2786 $client->beta->skills->delete($skillId);
28482787 ```
28492788 
28502789 ```ruby Ruby
from line 2817
28782817 NEW_VERSION=$(curl -X POST "https://api.anthropic.com/v1/skills/skill_01AbCdEfGhIjKlMnOpQrStUv/versions" \
28792818 -H "x-api-key: $ANTHROPIC_API_KEY" \
28802819 -H "anthropic-version: 2023-06-01" \
2881 -H "anthropic-beta: skills-2025-10-02" \
28822820 -F "files[]=@financial_skill/SKILL.md;filename=financial_skill/SKILL.md" \
28832821 -F "files[]=@financial_skill/analyze.py;filename=financial_skill/analyze.py")
28842822 
2885 VERSION_NUMBER=$(echo "$NEW_VERSION" | jq -r '.version')
2823 VERSION_ID=$(echo "$NEW_VERSION" | jq -r '.id')
28862824 
28872825 # Use specific version
28882826 curl https://api.anthropic.com/v1/messages \
28892827 -H "x-api-key: $ANTHROPIC_API_KEY" \
28902828 -H "anthropic-version: 2023-06-01" \
2891 -H "anthropic-beta: code-execution-2025-08-25,skills-2025-10-02" \
28922829 -H "content-type: application/json" \
28932830 -d "{
28942831 \"model\": \"claude-opus-5\",
from line 2834
28972834 \"skills\": [{
28982835 \"type\": \"custom\",
28992836 \"skill_id\": \"skill_01AbCdEfGhIjKlMnOpQrStUv\",
2900 \"version\": \"$VERSION_NUMBER\"
2837 \"version\": \"$VERSION_ID\"
29012838 }]
29022839 },
29032840 \"messages\": [{\"role\": \"user\", \"content\": \"Use updated Skill\"}],
from line 2845
29082845 curl https://api.anthropic.com/v1/messages \
29092846 -H "x-api-key: $ANTHROPIC_API_KEY" \
29102847 -H "anthropic-version: 2023-06-01" \
2911 -H "anthropic-beta: code-execution-2025-08-25,skills-2025-10-02" \
29122848 -H "content-type: application/json" \
29132849 -d '{
29142850 "model": "claude-opus-5",
from line 2863
29272863 
29282864 ```bash CLI
29292865 # Create a new version
2930 VERSION_NUMBER=$(ant beta:skills:versions create \
2866 VERSION_ID=$(ant skills:versions create \
29312867 --skill-id skill_01AbCdEfGhIjKlMnOpQrStUv \
29322868 --file financial_skill.zip \
2933 --transform version \
2869 --transform id \
29342870 --raw-output)
29352871 
29362872 # Use specific version
2937 ant beta:messages create \
2938 --beta code-execution-2025-08-25,skills-2025-10-02 <<YAML
2873 ant messages create <<YAML
29392874 model: claude-opus-5
29402875 max_tokens: 4096
29412876 container:
29422877 skills:
29432878 - type: custom
29442879 skill_id: skill_01AbCdEfGhIjKlMnOpQrStUv
2945 version: "$VERSION_NUMBER"
2880 version: "$VERSION_ID"
29462881 messages:
29472882 - role: user
29482883 content: Use updated Skill
from line 2887
29522887 YAML
29532888 
29542889 # Use latest version
2955 ant beta:messages create \
2956 --beta code-execution-2025-08-25,skills-2025-10-02 <<YAML
2890 ant messages create <<YAML
29572891 model: claude-opus-5
29582892 max_tokens: 4096
29592893 container:
from line 2911
29772911 
29782912 # Create a new version
29792913 
2980 new_version = client.beta.skills.versions.create(
2914 new_version = client.skills.versions.create(
29812915 skill_id="skill_01AbCdEfGhIjKlMnOpQrStUv",
29822916 files=files_from_dir("financial_skill"),
29832917 )
29842918 
29852919 # Use specific version
2986 response = client.beta.messages.create(
2920 response = client.messages.create(
29872921 model="claude-opus-5",
29882922 max_tokens=4096,
2989 betas=["code-execution-2025-08-25", "skills-2025-10-02"],
29902923 container={
29912924 "skills": [
29922925 {
29932926 "type": "custom",
29942927 "skill_id": "skill_01AbCdEfGhIjKlMnOpQrStUv",
2995 "version": new_version.version,
2928 "version": new_version.id,
29962929 }
29972930 ]
29982931 },
from line 2934
30012934 )
30022935 
30032936 # Use latest version
3004 response = client.beta.messages.create(
2937 response = client.messages.create(
30052938 model="claude-opus-5",
30062939 max_tokens=4096,
3007 betas=["code-execution-2025-08-25", "skills-2025-10-02"],
30082940 container={
30092941 "skills": [
30102942 {
from line 2957
30252957 const client = new Anthropic();
30262958 
30272959 // Create a new version from a zip of the complete financial_skill/ bundle
3028 const newVersion = await client.beta.skills.versions.create("skill_01AbCdEfGhIjKlMnOpQrStUv", {
2960 const newVersion = await client.skills.versions.create("skill_01AbCdEfGhIjKlMnOpQrStUv", {
30292961 files: [fs.createReadStream("financial_skill.zip")]
30302962 });
30312963 
30322964 // Use specific version
3033 const specificVersionResponse = await client.beta.messages.create({
2965 const specificVersionResponse = await client.messages.create({
30342966 model: "claude-opus-5",
30352967 max_tokens: 4096,
3036 betas: ["code-execution-2025-08-25", "skills-2025-10-02"],
30372968 container: {
30382969 skills: [
30392970 {
30402971 type: "custom",
30412972 skill_id: "skill_01AbCdEfGhIjKlMnOpQrStUv",
3042 version: newVersion.version
2973 version: newVersion.id
30432974 }
30442975 ]
30452976 },
from line 2979
30482979 });
30492980 
30502981 // Use latest version
3051 const latestVersionResponse = await client.beta.messages.create({
2982 const latestVersionResponse = await client.messages.create({
30522983 model: "claude-opus-5",
30532984 max_tokens: 4096,
3054 betas: ["code-execution-2025-08-25", "skills-2025-10-02"],
30552985 container: {
30562986 skills: [
30572987 {
from line 2998
30682998 
30692999 ```csharp C#
30703000 using Anthropic.Core;
3071 using Anthropic.Models.Beta.Skills.Versions;
3001 using Anthropic.Models.Skills.Versions;
30723002 // ...
30733003 AnthropicClient client = new();
30743004 
from line 3020
30903020 ],
30913021 };
30923022 
3093 var newVersion = await client.Beta.Skills.Versions.Create("skill_01AbCdEfGhIjKlMnOpQrStUv", versionParams);
3023 var newVersion = await client.Skills.Versions.Create("skill_01AbCdEfGhIjKlMnOpQrStUv", versionParams);
30943024 
30953025 // Use specific version
30963026 var specificVersionParams = new MessageCreateParams
30973027 {
30983028 Model = "claude-opus-5",
30993029 MaxTokens = 4096,
3100 Betas = ["code-execution-2025-08-25", "skills-2025-10-02"],
3101 Container = new BetaContainerParams
3030 Container = new ContainerParams
31023031 {
31033032 Skills =
31043033 [
3105 new BetaSkillParams
3034 new SkillParams
31063035 {
3107 Type = BetaSkillParamsType.Custom,
3036 Type = SkillParamsType.Custom,
31083037 SkillID = "skill_01AbCdEfGhIjKlMnOpQrStUv",
3109 Version = newVersion.Version,
3038 Version = newVersion.ID,
31103039 },
31113040 ],
31123041 },
31133042 Messages = [new() { Role = Role.User, Content = "Use updated Skill" }],
3114 Tools = [new BetaCodeExecutionTool20250825()],
3043 Tools = [new CodeExecutionTool20250825()],
31153044 };
31163045 
3117 var response = await client.Beta.Messages.Create(specificVersionParams);
3046 var response = await client.Messages.Create(specificVersionParams);
31183047 Console.WriteLine(response);
31193048 
31203049 // Use latest version
from line 3051
31223051 {
31233052 Model = "claude-opus-5",
31243053 MaxTokens = 4096,
3125 Betas = ["code-execution-2025-08-25", "skills-2025-10-02"],
3126 Container = new BetaContainerParams
3054 Container = new ContainerParams
31273055 {
31283056 Skills =
31293057 [
3130 new BetaSkillParams
3058 new SkillParams
31313059 {
3132 Type = BetaSkillParamsType.Custom,
3060 Type = SkillParamsType.Custom,
31333061 SkillID = "skill_01AbCdEfGhIjKlMnOpQrStUv",
31343062 Version = "latest",
31353063 },
31363064 ],
31373065 },
31383066 Messages = [new() { Role = Role.User, Content = "Use latest Skill version" }],
3139 Tools = [new BetaCodeExecutionTool20250825()],
3067 Tools = [new CodeExecutionTool20250825()],
31403068 };
31413069 
3142 var latestResponse = await client.Beta.Messages.Create(latestVersionParams);
3070 var latestResponse = await client.Messages.Create(latestVersionParams);
31433071 Console.WriteLine(latestResponse);
31443072 ```
31453073 
from line 3086
31583086 }
31593087 defer analyzePy.Close()
31603088 
3161 newVersion, err := client.Beta.Skills.Versions.New(
3089 newVersion, err := client.Skills.Versions.New(
31623090 context.TODO(),
31633091 "skill_01AbCdEfGhIjKlMnOpQrStUv",
3164 anthropic.BetaSkillVersionNewParams{
3092 anthropic.SkillVersionNewParams{
31653093 Files: []io.Reader{
31663094 anthropic.File(skillMd, "financial_skill/SKILL.md", "text/markdown"),
31673095 anthropic.File(analyzePy, "financial_skill/analyze.py", "text/x-python"),
from line 3101
31733101 }
31743102 
31753103 // Use specific version
3176 response, err := client.Beta.Messages.New(context.TODO(), anthropic.BetaMessageNewParams{
3104 response, err := client.Messages.New(context.TODO(), anthropic.MessageNewParams{
31773105 Model: "claude-opus-5",
31783106 MaxTokens: 4096,
3179 Betas: []anthropic.AnthropicBeta{"code-execution-2025-08-25", anthropic.AnthropicBetaSkills2025_10_02},
3180 Container: anthropic.BetaMessageNewParamsContainerUnion{
3181 OfContainers: &anthropic.BetaContainerParams{
3182 Skills: []anthropic.BetaSkillParams{
3107 Container: anthropic.MessageCreateParamsContainerUnion{
3108 OfContainers: &anthropic.ContainerParams{
3109 Skills: []anthropic.SkillParams{
31833110 {
3184 Type: anthropic.BetaSkillParamsTypeCustom,
3111 Type: anthropic.SkillParamsTypeCustom,
31853112 SkillID: "skill_01AbCdEfGhIjKlMnOpQrStUv",
3186 Version: anthropic.String(newVersion.Version),
3113 Version: anthropic.String(newVersion.ID),
31873114 },
31883115 },
31893116 },
31903117 },
3191 Messages: []anthropic.BetaMessageParam{
3192 anthropic.NewBetaUserMessage(anthropic.NewBetaTextBlock("Use updated Skill")),
3118 Messages: []anthropic.MessageParam{
3119 anthropic.NewUserMessage(anthropic.NewTextBlock("Use updated Skill")),
31933120 },
3194 Tools: []anthropic.BetaToolUnionParam{
3195 {OfCodeExecutionTool20250825: &anthropic.BetaCodeExecutionTool20250825Param{}},
3121 Tools: []anthropic.ToolUnionParam{
3122 {OfCodeExecutionTool20250825: &anthropic.CodeExecutionTool20250825Param{}},
31963123 },
31973124 })
31983125 if err != nil {
from line 3128
32013128 fmt.Println(response)
32023129 
32033130 // Use latest version
3204 latestResponse, err := client.Beta.Messages.New(context.TODO(), anthropic.BetaMessageNewParams{
3131 latestResponse, err := client.Messages.New(context.TODO(), anthropic.MessageNewParams{
32053132 Model: "claude-opus-5",
32063133 MaxTokens: 4096,
3207 Betas: []anthropic.AnthropicBeta{"code-execution-2025-08-25", anthropic.AnthropicBetaSkills2025_10_02},
3208 Container: anthropic.BetaMessageNewParamsContainerUnion{
3209 OfContainers: &anthropic.BetaContainerParams{
3210 Skills: []anthropic.BetaSkillParams{
3134 Container: anthropic.MessageCreateParamsContainerUnion{
3135 OfContainers: &anthropic.ContainerParams{
3136 Skills: []anthropic.SkillParams{
32113137 {
3212 Type: anthropic.BetaSkillParamsTypeCustom,
3138 Type: anthropic.SkillParamsTypeCustom,
32133139 SkillID: "skill_01AbCdEfGhIjKlMnOpQrStUv",
32143140 Version: anthropic.String("latest"),
32153141 },
32163142 },
32173143 },
32183144 },
3219 Messages: []anthropic.BetaMessageParam{
3220 anthropic.NewBetaUserMessage(anthropic.NewBetaTextBlock("Use latest Skill version")),
3145 Messages: []anthropic.MessageParam{
3146 anthropic.NewUserMessage(anthropic.NewTextBlock("Use latest Skill version")),
32213147 },
3222 Tools: []anthropic.BetaToolUnionParam{
3223 {OfCodeExecutionTool20250825: &anthropic.BetaCodeExecutionTool20250825Param{}},
3148 Tools: []anthropic.ToolUnionParam{
3149 {OfCodeExecutionTool20250825: &anthropic.CodeExecutionTool20250825Param{}},
32243150 },
32253151 })
32263152 if err != nil {
from line 3156
32303156 ```
32313157 
32323158 ```java Java
3233 import com.anthropic.models.beta.messages.MessageCreateParams;
3234 import com.anthropic.models.beta.messages.BetaMessage;
3159 import com.anthropic.models.messages.MessageCreateParams;
3160 import com.anthropic.models.messages.Message;
32353161 import com.anthropic.models.messages.Model;
32363162 import com.anthropic.core.MultipartField;
3237 import com.anthropic.models.beta.messages.BetaContainerParams;
3238 import com.anthropic.models.beta.messages.BetaSkillParams;
3239 import com.anthropic.models.beta.messages.BetaCodeExecutionTool20250825;
3240 import com.anthropic.models.beta.skills.versions.VersionCreateParams;
3241 import com.anthropic.models.beta.skills.versions.VersionCreateResponse;
3163 import com.anthropic.models.messages.ContainerParams;
3164 import com.anthropic.models.messages.SkillParams;
3165 import com.anthropic.models.messages.CodeExecutionTool20250825;
3166 import com.anthropic.models.skills.versions.VersionCreateParams;
3167 import com.anthropic.models.skills.versions.SkillVersion;
32423168 import java.io.InputStream;
32433169 import java.nio.file.Files;
32443170 import java.nio.file.Path;
from line 3180
32543180 .build())
32553181 .build();
32563182 
3257 VersionCreateResponse newVersion = client.beta().skills().versions()
3183 SkillVersion newVersion = client.skills().versions()
32583184 .create("skill_01AbCdEfGhIjKlMnOpQrStUv", versionParams);
32593185 
32603186 // Use specific version
32613187 MessageCreateParams specificVersionParams = MessageCreateParams.builder()
32623188 .model(Model.CLAUDE_OPUS_5)
32633189 .maxTokens(4096L)
3264 .addBeta("code-execution-2025-08-25")
3265 .addBeta("skills-2025-10-02")
3266 .container(BetaContainerParams.builder()
3267 .addSkill(BetaSkillParams.builder()
3268 .type(BetaSkillParams.Type.CUSTOM)
3190 .container(ContainerParams.builder()
3191 .addSkill(SkillParams.builder()
3192 .type(SkillParams.Type.CUSTOM)
32693193 .skillId("skill_01AbCdEfGhIjKlMnOpQrStUv")
3270 .version(newVersion.version())
3194 .version(newVersion.id())
32713195 .build())
32723196 .build())
32733197 .addUserMessage("Use updated Skill")
3274 .addTool(BetaCodeExecutionTool20250825.builder().build())
3198 .addTool(CodeExecutionTool20250825.builder().build())
32753199 .build();
32763200 
3277 BetaMessage response = client.beta().messages().create(specificVersionParams);
3201 Message response = client.messages().create(specificVersionParams);
32783202 System.out.println(response);
32793203 
32803204 // Use latest version
32813205 MessageCreateParams latestVersionParams = MessageCreateParams.builder()
32823206 .model(Model.CLAUDE_OPUS_5)
32833207 .maxTokens(4096L)
3284 .addBeta("code-execution-2025-08-25")
3285 .addBeta("skills-2025-10-02")
3286 .container(BetaContainerParams.builder()
3287 .addSkill(BetaSkillParams.builder()
3288 .type(BetaSkillParams.Type.CUSTOM)
3208 .container(ContainerParams.builder()
3209 .addSkill(SkillParams.builder()
3210 .type(SkillParams.Type.CUSTOM)
32893211 .skillId("skill_01AbCdEfGhIjKlMnOpQrStUv")
32903212 .version("latest")
32913213 .build())
32923214 .build())
32933215 .addUserMessage("Use latest Skill version")
3294 .addTool(BetaCodeExecutionTool20250825.builder().build())
3216 .addTool(CodeExecutionTool20250825.builder().build())
32953217 .build();
32963218 
3297 BetaMessage latestResponse = client.beta().messages().create(latestVersionParams);
3219 Message latestResponse = client.messages().create(latestVersionParams);
32983220 System.out.println(latestResponse);
32993221 ```
33003222 
from line 3274
33523274 client = Anthropic::Client.new
33533275 
33543276 # Create a new version
3355 new_version = client.beta.skills.versions.create(
3277 new_version = client.skills.versions.create(
33563278 "skill_01AbCdEfGhIjKlMnOpQrStUv",
33573279 files: [
33583280 Anthropic::FilePart.new(
from line 3291
33693291 )
33703292 
33713293 # Use specific version
3372 response = client.beta.messages.create(
3294 response = client.messages.create(
33733295 model: "claude-opus-5",
33743296 max_tokens: 4096,
3375 betas: ["code-execution-2025-08-25", "skills-2025-10-02"],
33763297 container: {
33773298 skills: [{
33783299 type: "custom",
33793300 skill_id: "skill_01AbCdEfGhIjKlMnOpQrStUv",
3380 version: new_version.version
3301 version: new_version.id
33813302 }]
33823303 },
33833304 messages: [{ role: "user", content: "Use updated Skill" }],
from line 3307
33863307 puts response
33873308 
33883309 # Use latest version
3389 latest_response = client.beta.messages.create(
3310 latest_response = client.messages.create(
33903311 model: "claude-opus-5",
33913312 max_tokens: 4096,
3392 betas: ["code-execution-2025-08-25", "skills-2025-10-02"],
33933313 container: {
33943314 skills: [{
33953315 type: "custom",
from line 3324
34043324 ```
34053325</CodeGroup>
34063326 
3407See the [Create Skill Version API reference](https://platform.claude.com/docs/en/api/beta/skills/versions/create) for complete details.
3327See the [Create Skill Version API reference](https://platform.claude.com/docs/en/api/skills/versions/create) for complete details.
34083328 
34093329***
34103330 
from line 3355
34353355 DCF_SKILL=$(curl -X POST "https://api.anthropic.com/v1/skills" \
34363356 -H "x-api-key: $ANTHROPIC_API_KEY" \
34373357 -H "anthropic-version: 2023-06-01" \
3438 -H "anthropic-beta: skills-2025-10-02" \
34393358 -F "files[]=@dcf_skill/SKILL.md;filename=dcf_skill/SKILL.md")
34403359 
34413360 DCF_SKILL_ID=$(echo "$DCF_SKILL" | jq -r '.id')
from line 3363
34443363 curl https://api.anthropic.com/v1/messages \
34453364 -H "x-api-key: $ANTHROPIC_API_KEY" \
34463365 -H "anthropic-version: 2023-06-01" \
3447 -H "anthropic-beta: code-execution-2025-08-25,skills-2025-10-02" \
34483366 -H "content-type: application/json" \
34493367 -d "{
34503368 \"model\": \"claude-opus-5\",
from line 3394
34763394 
34773395 ```bash CLI
34783396 # Create custom DCF analysis Skill
3479 DCF_SKILL_ID=$(ant beta:skills create \
3397 DCF_SKILL_ID=$(ant skills create \
34803398 --file dcf_skill.zip \
34813399 --transform id \
34823400 --raw-output)
34833401 
34843402 # Use with Excel to create financial model
3485 ant beta:messages create \
3486 --beta code-execution-2025-08-25,skills-2025-10-02 <<YAML
3403 ant messages create <<YAML
34873404 model: claude-opus-5
34883405 max_tokens: 4096
34893406 container:
from line 3427
35103427 
35113428 # Create custom DCF analysis Skill
35123429 
3513 dcf_skill = client.beta.skills.create(
3430 dcf_skill = client.skills.create(
35143431 files=files_from_dir("/path/to/dcf_skill"),
35153432 )
35163433 
35173434 # Use with Excel to create financial model
3518 response = client.beta.messages.create(
3435 response = client.messages.create(
35193436 model="claude-opus-5",
35203437 max_tokens=4096,
3521 betas=["code-execution-2025-08-25", "skills-2025-10-02"],
35223438 container={
35233439 "skills": [
35243440 {"type": "anthropic", "skill_id": "xlsx", "version": "latest"},
from line 3459
35433459 const client = new Anthropic();
35443460 
35453461 // Create custom DCF analysis Skill
3546 const dcfSkill = await client.beta.skills.create({
3462 const dcfSkill = await client.skills.create({
35473463 files: [await toFile(fs.createReadStream("dcf_skill.zip"), "dcf_skill.zip")]
35483464 });
35493465 
35503466 // Use with Excel to create financial model
3551 const response = await client.beta.messages.create({
3467 const response = await client.messages.create({
35523468 model: "claude-opus-5",
35533469 max_tokens: 4096,
3554 betas: ["code-execution-2025-08-25", "skills-2025-10-02"],
35553470 container: {
35563471 skills: [
35573472 { type: "anthropic", skill_id: "xlsx", version: "latest" },
from line 3490
35753490 AnthropicClient client = new();
35763491 
35773492 // Create custom DCF analysis Skill
3578 var dcfSkill = await client.Beta.Skills.Create(new SkillCreateParams
3493 var dcfSkill = await client.Skills.Create(new SkillCreateParams
35793494 {
35803495 Files =
35813496 [
from line 3507
35923507 {
35933508 Model = "claude-opus-5",
35943509 MaxTokens = 4096,
3595 Betas = ["code-execution-2025-08-25", "skills-2025-10-02"],
3596 Container = new BetaContainerParams
3510 Container = new ContainerParams
35973511 {
35983512 Skills =
35993513 [
3600 new BetaSkillParams
3514 new SkillParams
36013515 {
3602 Type = BetaSkillParamsType.Anthropic,
3516 Type = SkillParamsType.Anthropic,
36033517 SkillID = "xlsx",
36043518 Version = "latest",
36053519 },
3606 new BetaSkillParams
3520 new SkillParams
36073521 {
3608 Type = BetaSkillParamsType.Custom,
3522 Type = SkillParamsType.Custom,
36093523 SkillID = dcfSkill.ID,
36103524 Version = "latest",
36113525 },
36123526 ],
36133527 },
36143528 Messages = [new() { Role = Role.User, Content = "Build a DCF valuation model for a SaaS company" }],
3615 Tools = [new BetaCodeExecutionTool20250825()],
3529 Tools = [new CodeExecutionTool20250825()],
36163530 };
36173531 
3618 var message = await client.Beta.Messages.Create(parameters);
3532 var message = await client.Messages.Create(parameters);
36193533 Console.WriteLine(message);
36203534 ```
36213535 
from line 3540
36263540 dcfSkillID := "skill_01AbCdEfGhIjKlMnOpQrStUv"
36273541 
36283542 // Use with Excel to create financial model
3629 response, err := client.Beta.Messages.New(context.TODO(), anthropic.BetaMessageNewParams{
3543 response, err := client.Messages.New(context.TODO(), anthropic.MessageNewParams{
36303544 Model: "claude-opus-5",
36313545 MaxTokens: 4096,
3632 Betas: []anthropic.AnthropicBeta{
3633 "code-execution-2025-08-25",
3634 anthropic.AnthropicBetaSkills2025_10_02,
3635 },
3636 Container: anthropic.BetaMessageNewParamsContainerUnion{
3637 OfContainers: &anthropic.BetaContainerParams{
3638 Skills: []anthropic.BetaSkillParams{
3546 Container: anthropic.MessageCreateParamsContainerUnion{
3547 OfContainers: &anthropic.ContainerParams{
3548 Skills: []anthropic.SkillParams{
36393549 {
3640 Type: anthropic.BetaSkillParamsTypeAnthropic,
3550 Type: anthropic.SkillParamsTypeAnthropic,
36413551 SkillID: "xlsx",
36423552 Version: anthropic.String("latest"),
36433553 },
36443554 {
3645 Type: anthropic.BetaSkillParamsTypeCustom,
3555 Type: anthropic.SkillParamsTypeCustom,
36463556 SkillID: dcfSkillID,
36473557 Version: anthropic.String("latest"),
36483558 },
36493559 },
36503560 },
36513561 },
3652 Messages: []anthropic.BetaMessageParam{
3653 anthropic.NewBetaUserMessage(anthropic.NewBetaTextBlock("Build a DCF valuation model for a SaaS company")),
3562 Messages: []anthropic.MessageParam{
3563 anthropic.NewUserMessage(anthropic.NewTextBlock("Build a DCF valuation model for a SaaS company")),
36543564 },
3655 Tools: []anthropic.BetaToolUnionParam{
3656 {OfCodeExecutionTool20250825: &anthropic.BetaCodeExecutionTool20250825Param{}},
3565 Tools: []anthropic.ToolUnionParam{
3566 {OfCodeExecutionTool20250825: &anthropic.CodeExecutionTool20250825Param{}},
36573567 },
36583568 })
36593569 if err != nil {
from line 3573
36633573 ```
36643574 
36653575 ```java Java
3666 import com.anthropic.models.beta.messages.BetaContainerParams;
3667 import com.anthropic.models.beta.messages.BetaSkillParams;
3668 import com.anthropic.models.beta.messages.BetaCodeExecutionTool20250825;
3576 import com.anthropic.models.messages.ContainerParams;
3577 import com.anthropic.models.messages.SkillParams;
3578 import com.anthropic.models.messages.CodeExecutionTool20250825;
36693579 // ...
36703580 void main() {
36713581 AnthropicClient client = AnthropicOkHttpClient.fromEnv();
from line 3587
36773587 MessageCreateParams params = MessageCreateParams.builder()
36783588 .model(Model.CLAUDE_OPUS_5)
36793589 .maxTokens(4096L)
3680 .addBeta("code-execution-2025-08-25")
3681 .addBeta("skills-2025-10-02")
3682 .container(BetaContainerParams.builder()
3590 .container(ContainerParams.builder()
36833591 .skills(List.of(
3684 BetaSkillParams.builder()
3685 .type(BetaSkillParams.Type.ANTHROPIC)
3592 SkillParams.builder()
3593 .type(SkillParams.Type.ANTHROPIC)
36863594 .skillId("xlsx")
36873595 .version("latest")
36883596 .build(),
3689 BetaSkillParams.builder()
3690 .type(BetaSkillParams.Type.CUSTOM)
3597 SkillParams.builder()
3598 .type(SkillParams.Type.CUSTOM)
36913599 .skillId(dcfSkillId)
36923600 .version("latest")
36933601 .build()
36943602 ))
36953603 .build())
36963604 .addUserMessage("Build a DCF valuation model for a SaaS company")
3697 .addTool(BetaCodeExecutionTool20250825.builder().build())
3605 .addTool(CodeExecutionTool20250825.builder().build())
36983606 .build();
36993607 
3700 BetaMessage response = client.beta().messages().create(params);
3608 Message response = client.messages().create(params);
37013609 System.out.println(response);
37023610 }
37033611 ```
from line 3641
37333641 client = Anthropic::Client.new
37343642 
37353643 # Create custom DCF analysis Skill
3736 dcf_skill = client.beta.skills.create(
3644 dcf_skill = client.skills.create(
37373645 files: [
37383646 Anthropic::FilePart.new(
37393647 Pathname("dcf_skill/SKILL.md"),
from line 3652
37443652 )
37453653 
37463654 # Use with Excel to create financial model
3747 response = client.beta.messages.create(
3655 response = client.messages.create(
37483656 model: "claude-opus-5",
37493657 max_tokens: 4096,
3750 betas: ["code-execution-2025-08-25", "skills-2025-10-02"],
37513658 container: {
37523659 skills: [
37533660 { type: "anthropic", skill_id: "xlsx", version: "latest" },
from line 3717
38103717 
38113718The SDK tabs in this section show the `container` value to include in a Messages request. The cURL and CLI tabs show the full request.
38123719 
3813**For production:** pin a specific version, so Skill updates never change your deployed behavior. If you omit `version` or set it to `"latest"`, requests use the newest version of the Skill, so a version uploaded by anyone in the [workspace](https://platform.claude.com/docs/en/build-with-claude/skills-guide#workspace-scoped-access) immediately changes what your production agents run. The version ID comes from the create-version response in [Versioning](https://platform.claude.com/docs/en/build-with-claude/skills-guide#versioning) or from the [List Skill Versions API](https://platform.claude.com/docs/en/api/beta/skills/versions/list). The ID is always a string: quote epoch-timestamp IDs in JSON or YAML.
3720**For production:** pin a specific version, so Skill updates never change your deployed behavior. If you omit `version` or set it to `"latest"`, requests use the newest version of the Skill, so a version uploaded by anyone in the [workspace](https://platform.claude.com/docs/en/build-with-claude/skills-guide#workspace-scoped-access) immediately changes what your production agents run. The version ID comes from the create-version response in [Versioning](https://platform.claude.com/docs/en/build-with-claude/skills-guide#versioning) or from the [List Skill Versions API](https://platform.claude.com/docs/en/api/skills/versions/list). The ID is always a string, so quote it in JSON or YAML (versions created under the `skills-2025-10-02` beta header have numeric-looking epoch-timestamp IDs).
38143721 
38153722<CodeGroup>
38163723 ```bash cURL
from line 3725
38183725 curl https://api.anthropic.com/v1/messages \
38193726 -H "x-api-key: $ANTHROPIC_API_KEY" \
38203727 -H "anthropic-version: 2023-06-01" \
3821 -H "anthropic-beta: code-execution-2025-08-25,skills-2025-10-02" \
38223728 -H "content-type: application/json" \
38233729 -d '{
38243730 "model": "claude-opus-5",
from line 3733
38273733 "skills": [{
38283734 "type": "custom",
38293735 "skill_id": "skill_01AbCdEfGhIjKlMnOpQrStUv",
3830 "version": "1759178010641129"
3736 "version": "skver_01AbCdEfGhIjKlMnOpQrStUv"
38313737 }]
38323738 },
38333739 "messages": [{"role": "user", "content": "Analyze the sales data"}],
from line 3743
38373743 
38383744 ```bash CLI
38393745 # Pin to specific versions for stability
3840 ant beta:messages create \
3841 --beta code-execution-2025-08-25,skills-2025-10-02 <<YAML
3746 ant messages create <<YAML
38423747 model: claude-opus-5
38433748 max_tokens: 4096
38443749 container:
38453750 skills:
38463751 - type: custom
38473752 skill_id: skill_01AbCdEfGhIjKlMnOpQrStUv
3848 version: "1759178010641129" # quoted: the API requires a string
3753 version: "skver_01AbCdEfGhIjKlMnOpQrStUv"
38493754 messages:
38503755 - role: user
38513756 content: Analyze the sales data
from line 3767
38623767 {
38633768 "type": "custom",
38643769 "skill_id": "skill_01AbCdEfGhIjKlMnOpQrStUv",
3865 "version": "1759178010641129",
3770 "version": "skver_01AbCdEfGhIjKlMnOpQrStUv",
38663771 }
38673772 ]
38683773 }
from line 3775
38703775 
38713776 ```typescript TypeScript
38723777 // Pin to specific versions for stability
3873 const container: Anthropic.Beta.Messages.BetaContainerParams = {
3778 const container: Anthropic.ContainerParams = {
38743779 skills: [
38753780 {
38763781 type: "custom",
38773782 skill_id: "skill_01AbCdEfGhIjKlMnOpQrStUv",
3878 version: "1759178010641129"
3783 version: "skver_01AbCdEfGhIjKlMnOpQrStUv"
38793784 }
38803785 ]
38813786 };
38823787 ```
38833788 
38843789 ```csharp C#
3885 using Anthropic.Models.Beta.Messages;
3790 using Anthropic.Models.Messages;
38863791 
38873792 // Pin to specific versions for stability
3888 var container = new BetaContainerParams
3793 var container = new ContainerParams
38893794 {
38903795 Skills =
38913796 [
3892 new BetaSkillParams
3797 new SkillParams
38933798 {
3894 Type = BetaSkillParamsType.Custom,
3799 Type = SkillParamsType.Custom,
38953800 SkillID = "skill_01AbCdEfGhIjKlMnOpQrStUv",
3896 Version = "1759178010641129",
3801 Version = "skver_01AbCdEfGhIjKlMnOpQrStUv",
38973802 },
38983803 ],
38993804 };
from line 3806
39013806 
39023807 ```go Go
39033808 // Pin to specific versions for stability
3904 container := anthropic.BetaMessageNewParamsContainerUnion{
3905 OfContainers: &anthropic.BetaContainerParams{
3906 Skills: []anthropic.BetaSkillParams{
3809 container := anthropic.MessageCreateParamsContainerUnion{
3810 OfContainers: &anthropic.ContainerParams{
3811 Skills: []anthropic.SkillParams{
39073812 {
3908 Type: anthropic.BetaSkillParamsTypeCustom,
3813 Type: anthropic.SkillParamsTypeCustom,
39093814 SkillID: "skill_01AbCdEfGhIjKlMnOpQrStUv",
3910 Version: anthropic.String("1759178010641129"),
3815 Version: anthropic.String("skver_01AbCdEfGhIjKlMnOpQrStUv"),
39113816 },
39123817 },
39133818 },
from line 3820
39153820 ```
39163821 
39173822 ```java Java
3918 import com.anthropic.models.beta.messages.BetaContainerParams;
3919 import com.anthropic.models.beta.messages.BetaSkillParams;
3823 import com.anthropic.models.messages.ContainerParams;
3824 import com.anthropic.models.messages.SkillParams;
39203825 
39213826 void main() {
39223827 // Pin to specific versions for stability
3923 BetaContainerParams container = BetaContainerParams.builder()
3924 .addSkill(BetaSkillParams.builder()
3925 .type(BetaSkillParams.Type.CUSTOM)
3828 ContainerParams container = ContainerParams.builder()
3829 .addSkill(SkillParams.builder()
3830 .type(SkillParams.Type.CUSTOM)
39263831 .skillId("skill_01AbCdEfGhIjKlMnOpQrStUv")
3927 .version("1759178010641129")
3832 .version("skver_01AbCdEfGhIjKlMnOpQrStUv")
39283833 .build())
39293834 .build();
39303835 }
from line 3852
39473852 skills: [{
39483853 type: "custom",
39493854 skill_id: "skill_01AbCdEfGhIjKlMnOpQrStUv",
3950 version: "1759178010641129"
3855 version: "skver_01AbCdEfGhIjKlMnOpQrStUv"
39513856 }]
39523857 }
39533858 ```
from line 3866
39613866 curl https://api.anthropic.com/v1/messages \
39623867 -H "x-api-key: $ANTHROPIC_API_KEY" \
39633868 -H "anthropic-version: 2023-06-01" \
3964 -H "anthropic-beta: code-execution-2025-08-25,skills-2025-10-02" \
39653869 -H "content-type: application/json" \
39663870 -d '{
39673871 "model": "claude-opus-5",
from line 3884
39803884 
39813885 ```bash CLI
39823886 # Use latest for active development
3983 ant beta:messages create \
3984 --beta code-execution-2025-08-25,skills-2025-10-02 <<YAML
3887 ant messages create <<YAML
39853888 model: claude-opus-5
39863889 max_tokens: 4096
39873890 container:
from line 3916
40133916 
40143917 ```typescript TypeScript
40153918 // Use latest for active development
4016 const container: Anthropic.Beta.Messages.BetaContainerParams = {
3919 const container: Anthropic.ContainerParams = {
40173920 skills: [
40183921 {
40193922 type: "custom",
from line 3928
40253928 ```
40263929 
40273930 ```csharp C#
4028 using Anthropic.Models.Beta.Messages;
3931 using Anthropic.Models.Messages;
40293932 
40303933 // Use latest for active development
4031 var container = new BetaContainerParams
3934 var container = new ContainerParams
40323935 {
40333936 Skills =
40343937 [
4035 new BetaSkillParams
3938 new SkillParams
40363939 {
4037 Type = BetaSkillParamsType.Custom,
3940 Type = SkillParamsType.Custom,
40383941 SkillID = "skill_01AbCdEfGhIjKlMnOpQrStUv",
40393942 Version = "latest",
40403943 },
from line 3947
40443947 
40453948 ```go Go
40463949 // Use latest for active development
4047 container := anthropic.BetaMessageNewParamsContainerUnion{
4048 OfContainers: &anthropic.BetaContainerParams{
4049 Skills: []anthropic.BetaSkillParams{
3950 container := anthropic.MessageCreateParamsContainerUnion{
3951 OfContainers: &anthropic.ContainerParams{
3952 Skills: []anthropic.SkillParams{
40503953 {
4051 Type: anthropic.BetaSkillParamsTypeCustom,
3954 Type: anthropic.SkillParamsTypeCustom,
40523955 SkillID: "skill_01AbCdEfGhIjKlMnOpQrStUv",
40533956 Version: anthropic.String("latest"),
40543957 },
from line 3961
40583961 ```
40593962 
40603963 ```java Java
4061 import com.anthropic.models.beta.messages.BetaContainerParams;
4062 import com.anthropic.models.beta.messages.BetaSkillParams;
3964 import com.anthropic.models.messages.ContainerParams;
3965 import com.anthropic.models.messages.SkillParams;
40633966 
40643967 void main() {
40653968 // Use latest for active development
4066 BetaContainerParams container = BetaContainerParams.builder()
4067 .addSkill(BetaSkillParams.builder()
4068 .type(BetaSkillParams.Type.CUSTOM)
3969 ContainerParams container = ContainerParams.builder()
3970 .addSkill(SkillParams.builder()
3971 .type(SkillParams.Type.CUSTOM)
40693972 .skillId("skill_01AbCdEfGhIjKlMnOpQrStUv")
40703973 .version("latest")
40713974 .build())
from line 4009
41064009 curl https://api.anthropic.com/v1/messages \
41074010 -H "x-api-key: $ANTHROPIC_API_KEY" \
41084011 -H "anthropic-version: 2023-06-01" \
4109 -H "anthropic-beta: code-execution-2025-08-25,skills-2025-10-02" \
41104012 -H "content-type: application/json" \
41114013 -d '{
41124014 "model": "claude-opus-5",
from line 4026
41244026 curl https://api.anthropic.com/v1/messages \
41254027 -H "x-api-key: $ANTHROPIC_API_KEY" \
41264028 -H "anthropic-version: 2023-06-01" \
4127 -H "anthropic-beta: code-execution-2025-08-25,skills-2025-10-02" \
41284029 -H "content-type: application/json" \
41294030 -d '{
41304031 "model": "claude-opus-5",
from line 4043
41424043 
41434044 ```bash CLI
41444045 # Skills render into the system prompt in a fixed, cache-friendly order
4145 ant beta:messages create \
4146 --beta code-execution-2025-08-25,skills-2025-10-02 <<'YAML'
4046 ant messages create <<'YAML'
41474047 model: claude-opus-5
41484048 max_tokens: 4096
41494049 container:
from line 4060
41604060 YAML
41614061 
41624062 # Changing the Skills list ([xlsx] vs [xlsx, pptx]) changes the prefix: a cache miss, while an identical list is a cache hit
4163 ant beta:messages create \
4164 --beta code-execution-2025-08-25,skills-2025-10-02 <<'YAML'
4063 ant messages create <<'YAML'
41654064 model: claude-opus-5
41664065 max_tokens: 4096
41674066 container:
from line 4084
41854084 client = anthropic.Anthropic()
41864085 
41874086 # Skills render into the system prompt in a fixed, cache-friendly order
4188 response1 = client.beta.messages.create(
4087 response1 = client.messages.create(
41894088 model="claude-opus-5",
41904089 max_tokens=4096,
4191 betas=[
4192 "code-execution-2025-08-25",
4193 "skills-2025-10-02",
4194 ],
41954090 container={
41964091 "skills": [{"type": "anthropic", "skill_id": "xlsx", "version": "latest"}]
41974092 },
from line 4095
42004095 )
42014096 
42024097 # Changing the Skills list ([xlsx] vs [xlsx, pptx]) changes the prefix: a cache miss, while an identical list is a cache hit
4203 response2 = client.beta.messages.create(
4098 response2 = client.messages.create(
42044099 model="claude-opus-5",
42054100 max_tokens=4096,
4206 betas=[
4207 "code-execution-2025-08-25",
4208 "skills-2025-10-02",
4209 ],
42104101 container={
42114102 "skills": [
42124103 {"type": "anthropic", "skill_id": "xlsx", "version": "latest"},
from line 4117
42264117 const client = new Anthropic();
42274118 
42284119 // Skills render into the system prompt in a fixed, cache-friendly order
4229 const response1 = await client.beta.messages.create({
4120 const response1 = await client.messages.create({
42304121 model: "claude-opus-5",
42314122 max_tokens: 4096,
4232 betas: ["code-execution-2025-08-25", "skills-2025-10-02"],
42334123 container: {
42344124 skills: [{ type: "anthropic", skill_id: "xlsx", version: "latest" }]
42354125 },
from line 4128
42384128 });
42394129 
42404130 // Changing the Skills list ([xlsx] vs [xlsx, pptx]) changes the prefix: a cache miss, while an identical list is a cache hit
4241 const response2 = await client.beta.messages.create({
4131 const response2 = await client.messages.create({
42424132 model: "claude-opus-5",
42434133 max_tokens: 4096,
4244 betas: ["code-execution-2025-08-25", "skills-2025-10-02"],
42454134 container: {
42464135 skills: [
42474136 { type: "anthropic", skill_id: "xlsx", version: "latest" },
from line 4150
42614150 {
42624151 Model = "claude-opus-5",
42634152 MaxTokens = 4096,
4264 Betas = ["code-execution-2025-08-25", "skills-2025-10-02"],
4265 Container = new BetaContainerParams
4153 Container = new ContainerParams
42664154 {
42674155 Skills =
42684156 [
4269 new BetaSkillParams
4157 new SkillParams
42704158 {
4271 Type = BetaSkillParamsType.Anthropic,
4159 Type = SkillParamsType.Anthropic,
42724160 SkillID = "xlsx",
42734161 Version = "latest",
42744162 },
42754163 ],
42764164 },
42774165 Messages = [new() { Role = Role.User, Content = "Analyze sales data" }],
4278 Tools = [new BetaCodeExecutionTool20250825()],
4166 Tools = [new CodeExecutionTool20250825()],
42794167 };
42804168 
4281 var response1 = await client.Beta.Messages.Create(parameters1);
4169 var response1 = await client.Messages.Create(parameters1);
42824170 Console.WriteLine(response1);
42834171 
42844172 // Different Skill set ([xlsx] vs [xlsx, pptx]) = a different prefix: a cache miss (an identical set is a cache hit)
from line 4174
42864174 {
42874175 Model = "claude-opus-5",
42884176 MaxTokens = 4096,
4289 Betas = ["code-execution-2025-08-25", "skills-2025-10-02"],
4290 Container = new BetaContainerParams
4177 Container = new ContainerParams
42914178 {
42924179 Skills =
42934180 [
4294 new BetaSkillParams
4181 new SkillParams
42954182 {
4296 Type = BetaSkillParamsType.Anthropic,
4183 Type = SkillParamsType.Anthropic,
42974184 SkillID = "xlsx",
42984185 Version = "latest",
42994186 },
4300 new BetaSkillParams
4187 new SkillParams
43014188 {
4302 Type = BetaSkillParamsType.Anthropic,
4189 Type = SkillParamsType.Anthropic,
43034190 SkillID = "pptx",
43044191 Version = "latest",
43054192 },
43064193 ],
43074194 },
43084195 Messages = [new() { Role = Role.User, Content = "Create a presentation" }],
4309 Tools = [new BetaCodeExecutionTool20250825()],
4196 Tools = [new CodeExecutionTool20250825()],
43104197 };
43114198 
4312 var response2 = await client.Beta.Messages.Create(parameters2);
4199 var response2 = await client.Messages.Create(parameters2);
43134200 Console.WriteLine(response2);
43144201 ```
43154202 
from line 4204
43174204 client := anthropic.NewClient()
43184205 
43194206 // Skills render into the system prompt in a fixed, cache-friendly order
4320 response1, err := client.Beta.Messages.New(context.TODO(), anthropic.BetaMessageNewParams{
4207 response1, err := client.Messages.New(context.TODO(), anthropic.MessageNewParams{
43214208 Model: "claude-opus-5",
43224209 MaxTokens: 4096,
4323 Betas: []anthropic.AnthropicBeta{
4324 "code-execution-2025-08-25",
4325 anthropic.AnthropicBetaSkills2025_10_02,
4326 },
4327 Container: anthropic.BetaMessageNewParamsContainerUnion{
4328 OfContainers: &anthropic.BetaContainerParams{
4329 Skills: []anthropic.BetaSkillParams{
4210 Container: anthropic.MessageCreateParamsContainerUnion{
4211 OfContainers: &anthropic.ContainerParams{
4212 Skills: []anthropic.SkillParams{
43304213 {
4331 Type: anthropic.BetaSkillParamsTypeAnthropic,
4214 Type: anthropic.SkillParamsTypeAnthropic,
43324215 SkillID: "xlsx",
43334216 Version: anthropic.String("latest"),
43344217 },
43354218 },
43364219 },
43374220 },
4338 Messages: []anthropic.BetaMessageParam{
4339 anthropic.NewBetaUserMessage(anthropic.NewBetaTextBlock("Analyze sales data")),
4221 Messages: []anthropic.MessageParam{
4222 anthropic.NewUserMessage(anthropic.NewTextBlock("Analyze sales data")),
43404223 },
4341 Tools: []anthropic.BetaToolUnionParam{
4342 {OfCodeExecutionTool20250825: &anthropic.BetaCodeExecutionTool20250825Param{}},
4224 Tools: []anthropic.ToolUnionParam{
4225 {OfCodeExecutionTool20250825: &anthropic.CodeExecutionTool20250825Param{}},
43434226 },
43444227 })
43454228 if err != nil {
from line 4231
43484231 fmt.Println(response1)
43494232 
43504233 // Changing the Skills list ([xlsx] vs [xlsx, pptx]) changes the prefix: a cache miss, while an identical list is a cache hit
4351 response2, err := client.Beta.Messages.New(context.TODO(), anthropic.BetaMessageNewParams{
4234 response2, err := client.Messages.New(context.TODO(), anthropic.MessageNewParams{
43524235 Model: "claude-opus-5",
43534236 MaxTokens: 4096,
4354 Betas: []anthropic.AnthropicBeta{
4355 "code-execution-2025-08-25",
4356 anthropic.AnthropicBetaSkills2025_10_02,
4357 },
4358 Container: anthropic.BetaMessageNewParamsContainerUnion{
4359 OfContainers: &anthropic.BetaContainerParams{
4360 Skills: []anthropic.BetaSkillParams{
4237 Container: anthropic.MessageCreateParamsContainerUnion{
4238 OfContainers: &anthropic.ContainerParams{
4239 Skills: []anthropic.SkillParams{
43614240 {
4362 Type: anthropic.BetaSkillParamsTypeAnthropic,
4241 Type: anthropic.SkillParamsTypeAnthropic,
43634242 SkillID: "xlsx",
43644243 Version: anthropic.String("latest"),
43654244 },
43664245 {
4367 Type: anthropic.BetaSkillParamsTypeAnthropic,
4246 Type: anthropic.SkillParamsTypeAnthropic,
43684247 SkillID: "pptx",
43694248 Version: anthropic.String("latest"),
43704249 },
43714250 },
43724251 },
43734252 },
4374 Messages: []anthropic.BetaMessageParam{
4375 anthropic.NewBetaUserMessage(anthropic.NewBetaTextBlock("Create a presentation")),
4253 Messages: []anthropic.MessageParam{
4254 anthropic.NewUserMessage(anthropic.NewTextBlock("Create a presentation")),
43764255 },
4377 Tools: []anthropic.BetaToolUnionParam{
4378 {OfCodeExecutionTool20250825: &anthropic.BetaCodeExecutionTool20250825Param{}},
4256 Tools: []anthropic.ToolUnionParam{
4257 {OfCodeExecutionTool20250825: &anthropic.CodeExecutionTool20250825Param{}},
43794258 },
43804259 })
43814260 if err != nil {
from line 4264
43854264 ```
43864265 
43874266 ```java Java
4388 import com.anthropic.models.beta.messages.BetaContainerParams;
4389 import com.anthropic.models.beta.messages.BetaSkillParams;
4390 import com.anthropic.models.beta.messages.BetaCodeExecutionTool20250825;
4267 import com.anthropic.models.messages.ContainerParams;
4268 import com.anthropic.models.messages.SkillParams;
4269 import com.anthropic.models.messages.CodeExecutionTool20250825;
43914270 // ...
43924271 void main() {
43934272 AnthropicClient client = AnthropicOkHttpClient.fromEnv();
from line 4275
43964275 MessageCreateParams params1 = MessageCreateParams.builder()
43974276 .model(Model.CLAUDE_OPUS_5)
43984277 .maxTokens(4096L)
4399 .addBeta("code-execution-2025-08-25")
4400 .addBeta("skills-2025-10-02")
4401 .container(BetaContainerParams.builder()
4278 .container(ContainerParams.builder()
44024279 .skills(List.of(
4403 BetaSkillParams.builder()
4404 .type(BetaSkillParams.Type.ANTHROPIC)
4280 SkillParams.builder()
4281 .type(SkillParams.Type.ANTHROPIC)
44054282 .skillId("xlsx")
44064283 .version("latest")
44074284 .build()
44084285 ))
44094286 .build())
44104287 .addUserMessage("Analyze sales data")
4411 .addTool(BetaCodeExecutionTool20250825.builder().build())
4288 .addTool(CodeExecutionTool20250825.builder().build())
44124289 .build();
44134290 
4414 BetaMessage response1 = client.beta().messages().create(params1);
4291 Message response1 = client.messages().create(params1);
44154292 System.out.println(response1);
44164293 
44174294 // Changing the Skills list ([xlsx] vs [xlsx, pptx]) changes the prefix: a cache miss, while an identical list is a cache hit
44184295 MessageCreateParams params2 = MessageCreateParams.builder()
44194296 .model(Model.CLAUDE_OPUS_5)
44204297 .maxTokens(4096L)
4421 .addBeta("code-execution-2025-08-25")
4422 .addBeta("skills-2025-10-02")
4423 .container(BetaContainerParams.builder()
4298 .container(ContainerParams.builder()
44244299 .skills(List.of(
4425 BetaSkillParams.builder()
4426 .type(BetaSkillParams.Type.ANTHROPIC)
4300 SkillParams.builder()
4301 .type(SkillParams.Type.ANTHROPIC)
44274302 .skillId("xlsx")
44284303 .version("latest")
44294304 .build(),
4430 BetaSkillParams.builder()
4431 .type(BetaSkillParams.Type.ANTHROPIC)
4305 SkillParams.builder()
4306 .type(SkillParams.Type.ANTHROPIC)
44324307 .skillId("pptx")
44334308 .version("latest")
44344309 .build()
44354310 ))
44364311 .build())
44374312 .addUserMessage("Create a presentation")
4438 .addTool(BetaCodeExecutionTool20250825.builder().build())
4313 .addTool(CodeExecutionTool20250825.builder().build())
44394314 .build();
44404315 
4441 BetaMessage response2 = client.beta().messages().create(params2);
4316 Message response2 = client.messages().create(params2);
44424317 System.out.println(response2);
44434318 }
44444319 ```
from line 4371
44964371 client = Anthropic::Client.new
44974372 
44984373 # Skills render into the system prompt in a fixed, cache-friendly order
4499 response1 = client.beta.messages.create(
4374 response1 = client.messages.create(
45004375 model: "claude-opus-5",
45014376 max_tokens: 4096,
4502 betas: [
4503 "code-execution-2025-08-25",
4504 "skills-2025-10-02",
4505 ],
45064377 container: {
45074378 skills: [{ type: "anthropic", skill_id: "xlsx", version: "latest" }]
45084379 },
from line 4383
45124383 puts response1
45134384 
45144385 # Changing the Skills list ([xlsx] vs [xlsx, pptx]) changes the prefix: a cache miss, while an identical list is a cache hit
4515 response2 = client.beta.messages.create(
4386 response2 = client.messages.create(
45164387 model: "claude-opus-5",
45174388 max_tokens: 4096,
4518 betas: [
4519 "code-execution-2025-08-25",
4520 "skills-2025-10-02",
4521 ],
45224389 container: {
45234390 skills: [
45244391 { type: "anthropic", skill_id: "xlsx", version: "latest" },
from line 4414
45474414 ```
45484415 
45494416 ```bash CLI
4550 if ! RESULT=$(ant beta:messages create \
4551 --beta code-execution-2025-08-25,skills-2025-10-02 \
4417 if ! RESULT=$(ant messages create \
45524418 --transform-error error.message \
45534419 --format-error yaml 2>&1 <<'YAML'
45544420 model: claude-opus-5
from line 4449
45834449 client = anthropic.Anthropic()
45844450 
45854451 try:
4586 response = client.beta.messages.create(
4452 response = client.messages.create(
45874453 model="claude-opus-5",
45884454 max_tokens=4096,
4589 betas=["code-execution-2025-08-25", "skills-2025-10-02"],
45904455 container={
45914456 "skills": [
45924457 {
from line 4476
46114476 const client = new Anthropic();
46124477 
46134478 try {
4614 const response = await client.beta.messages.create({
4479 const response = await client.messages.create({
46154480 model: "claude-opus-5",
46164481 max_tokens: 4096,
4617 betas: ["code-execution-2025-08-25", "skills-2025-10-02"],
46184482 container: {
46194483 skills: [
46204484 { type: "custom", skill_id: "skill_01AbCdEfGhIjKlMnOpQrStUv", version: "latest" }
from line 4509
46454509 {
46464510 Model = "claude-opus-5",
46474511 MaxTokens = 4096,
4648 Betas = ["code-execution-2025-08-25", "skills-2025-10-02"],
4649 Container = new BetaContainerParams
4512 Container = new ContainerParams
46504513 {
46514514 Skills =
46524515 [
4653 new BetaSkillParams
4516 new SkillParams
46544517 {
4655 Type = BetaSkillParamsType.Custom,
4518 Type = SkillParamsType.Custom,
46564519 SkillID = "skill_01AbCdEfGhIjKlMnOpQrStUv",
46574520 Version = "latest",
46584521 },
46594522 ],
46604523 },
46614524 Messages = [new() { Role = Role.User, Content = "Process data" }],
4662 Tools = [new BetaCodeExecutionTool20250825()],
4525 Tools = [new CodeExecutionTool20250825()],
46634526 };
46644527 
4665 var response = await client.Beta.Messages.Create(parameters);
4528 var response = await client.Messages.Create(parameters);
46664529 Console.WriteLine(response);
46674530 }
46684531 catch (AnthropicBadRequestException e) when (e.Message.Contains("skill"))
from line 4537
46744537 ```go Go
46754538 client := anthropic.NewClient()
46764539 
4677 response, err := client.Beta.Messages.New(context.TODO(), anthropic.BetaMessageNewParams{
4540 response, err := client.Messages.New(context.TODO(), anthropic.MessageNewParams{
46784541 Model: "claude-opus-5",
46794542 MaxTokens: 4096,
4680 Betas: []anthropic.AnthropicBeta{"code-execution-2025-08-25", anthropic.AnthropicBetaSkills2025_10_02},
4681 Container: anthropic.BetaMessageNewParamsContainerUnion{
4682 OfContainers: &anthropic.BetaContainerParams{
4683 Skills: []anthropic.BetaSkillParams{
4543 Container: anthropic.MessageCreateParamsContainerUnion{
4544 OfContainers: &anthropic.ContainerParams{
4545 Skills: []anthropic.SkillParams{
46844546 {
4685 Type: anthropic.BetaSkillParamsTypeCustom,
4547 Type: anthropic.SkillParamsTypeCustom,
46864548 SkillID: "skill_01AbCdEfGhIjKlMnOpQrStUv",
46874549 Version: anthropic.String("latest"),
46884550 },
46894551 },
46904552 },
46914553 },
4692 Messages: []anthropic.BetaMessageParam{
4693 anthropic.NewBetaUserMessage(anthropic.NewBetaTextBlock("Process data")),
4554 Messages: []anthropic.MessageParam{
4555 anthropic.NewUserMessage(anthropic.NewTextBlock("Process data")),
46944556 },
4695 Tools: []anthropic.BetaToolUnionParam{
4696 {OfCodeExecutionTool20250825: &anthropic.BetaCodeExecutionTool20250825Param{}},
4557 Tools: []anthropic.ToolUnionParam{
4558 {OfCodeExecutionTool20250825: &anthropic.CodeExecutionTool20250825Param{}},
46974559 },
46984560 })
46994561 
from line 4574
47124574 
47134575 ```java Java
47144576 import com.anthropic.errors.BadRequestException;
4715 import com.anthropic.models.beta.messages.BetaContainerParams;
4716 import com.anthropic.models.beta.messages.BetaSkillParams;
4717 import com.anthropic.models.beta.messages.BetaCodeExecutionTool20250825;
4577 import com.anthropic.models.messages.ContainerParams;
4578 import com.anthropic.models.messages.SkillParams;
4579 import com.anthropic.models.messages.CodeExecutionTool20250825;
47184580 // ...
47194581 void main() {
47204582 AnthropicClient client = AnthropicOkHttpClient.fromEnv();
from line 4585
47234585 MessageCreateParams params = MessageCreateParams.builder()
47244586 .model(Model.CLAUDE_OPUS_5)
47254587 .maxTokens(4096L)
4726 .addBeta("code-execution-2025-08-25")
4727 .addBeta("skills-2025-10-02")
4728 .container(BetaContainerParams.builder()
4729 .addSkill(BetaSkillParams.builder()
4730 .type(BetaSkillParams.Type.CUSTOM)
4588 .container(ContainerParams.builder()
4589 .addSkill(SkillParams.builder()
4590 .type(SkillParams.Type.CUSTOM)
47314591 .skillId("skill_01AbCdEfGhIjKlMnOpQrStUv")
47324592 .version("latest")
47334593 .build())
47344594 .build())
47354595 .addUserMessage("Process data")
4736 .addTool(BetaCodeExecutionTool20250825.builder().build())
4596 .addTool(CodeExecutionTool20250825.builder().build())
47374597 .build();
47384598 
4739 BetaMessage response = client.beta().messages().create(params);
4599 Message response = client.messages().create(params);
47404600 System.out.println(response);
47414601 } catch (BadRequestException e) {
47424602 if (e.getMessage().contains("skill")) {
from line 4648
47884648 client = Anthropic::Client.new
47894649 
47904650 begin
4791 response = client.beta.messages.create(
4651 response = client.messages.create(
47924652 model: "claude-opus-5",
47934653 max_tokens: 4096,
4794 betas: ["code-execution-2025-08-25", "skills-2025-10-02"],
47954654 container: {
47964655 skills: [
47974656 {
from line 4688
48294688## Next steps
48304689 
48314690<CardGroup cols={3}>
4832 <Card title="API reference" icon="book" href="https://platform.claude.com/docs/en/api/beta/skills/create">
4691 <Card title="API reference" icon="book" href="https://platform.claude.com/docs/en/api/skills/create">
48334692 Complete API reference with all endpoints
48344693 </Card>
48354694 
48364695 

build-with-claude/vision Changed · +68 / -61 lines

from line 541
541541 FILE_ID=$(curl -sS -X POST https://api.anthropic.com/v1/files \
542542 -H "x-api-key: $ANTHROPIC_API_KEY" \
543543 -H "anthropic-version: 2023-06-01" \
544 -H "anthropic-beta: files-api-2025-04-14" \
545544 -F "[email protected]" | jq -r '.id')
546545 
547546 # Then use the returned file_id in your message
from line 547
548547 curl https://api.anthropic.com/v1/messages \
549548 -H "x-api-key: $ANTHROPIC_API_KEY" \
550549 -H "anthropic-version: 2023-06-01" \
551 -H "anthropic-beta: files-api-2025-04-14" \
552550 -H "content-type: application/json" \
553551 -d @- <<EOF
554552 {
from line 579
581579 https://platform.claude.com/docs/images/vision-example.jpg
582580 
583581 # First, upload your image to the Files API
584 FILE_ID=$(ant beta:files upload \
582 FILE_ID=$(ant files upload \
585583 --file ./vision-example.jpg \
586584 --transform id --raw-output)
587585 
588586 # Then use the returned file_id in your message
589 ant beta:messages create \
590 --beta files-api-2025-04-14 \
587 ant messages create \
591588 --transform content --format yaml <<YAML
592589 model: claude-opus-5
593590 max_tokens: 1024
from line 605
608605 
609606 # Upload the image file
610607 with open("vision-example.jpg", "rb") as f:
611 file_upload = client.beta.files.upload(file=("vision-example.jpg", f, "image/jpeg"))
608 file_upload = client.files.upload(file=("vision-example.jpg", f, "image/jpeg"))
612609 
613610 # Use the uploaded file in a message
614 message = client.beta.messages.create(
611 message = client.messages.create(
615612 model="claude-opus-5",
616613 max_tokens=1024,
617 betas=["files-api-2025-04-14"],
618614 messages=[
619615 {
620616 "role": "user",
from line 635
639635 const anthropic = new Anthropic();
640636 
641637 // Upload the image file
642 const fileUpload = await anthropic.beta.files.upload({
638 const fileUpload = await anthropic.files.upload({
643639 file: await toFile(fs.createReadStream("vision-example.jpg"), undefined, {
644640 type: "image/jpeg"
645641 })
from line 642
646642 });
647643 
648644 // Use the uploaded file in a message
649 const response = await anthropic.beta.messages.create({
645 const response = await anthropic.messages.create({
650646 model: "claude-opus-5",
651647 max_tokens: 1024,
652 betas: ["files-api-2025-04-14"],
653648 messages: [
654649 {
655650 role: "user",
from line 669
674669 ```
675670 
676671 ```csharp C#
672 using System.Collections.Generic;
677673 using Anthropic;
674 using Anthropic.Core;
675 using Anthropic.Models.Files;
676 using Anthropic.Models.Messages;
678677 
679 var client = new AnthropicClient();
678 AnthropicClient client = new();
680679 
681680 // Upload the image file
682 var fileUpload = await client.Beta.Files.Upload(
683 new FileUploadParams { File = File.OpenRead("vision-example.jpg") });
681 var fileUpload = await client.Files.Upload(new FileUploadParams
682 {
683 File = new BinaryContent
684 {
685 Stream = File.OpenRead("vision-example.jpg"),
686 FileName = "vision-example.jpg",
687 ContentType = new("image/jpeg"),
688 },
689 });
684690 
685691 // Use the uploaded file in a message
686 var response = await client.Beta.Messages.Create(
687 new MessageCreateParams
688 {
689 Model = "claude-opus-5",
690 MaxTokens = 1024,
691 Betas = new[] { "files-api-2025-04-14" },
692 Messages = new[]
692 var response = await client.Messages.Create(new MessageCreateParams
693 {
694 Model = Model.ClaudeOpus5,
695 MaxTokens = 1024,
696 Messages =
697 [
698 new()
693699 {
694 new BetaMessageParam
700 Role = Role.User,
701 Content = new MessageParamContent(new List<ContentBlockParam>
695702 {
696 Role = "user",
697 Content = new object[]
698 {
699 new
700 {
701 type = "image",
702 source = new { type = "file", file_id = fileUpload.Id }
703 },
704 new { type = "text", text = "Describe this image." }
705 }
706 }
703 new ContentBlockParam(new ImageBlockParam(
704 new ImageBlockParamSource(new FileImageSource(fileUpload.ID))
705 )),
706 new ContentBlockParam(new TextBlockParam("Describe this image.")),
707 }),
707708 }
708 });
709 ]
710 });
709711 
710712 Console.WriteLine(response);
711713 ```
from line 722
720722 }
721723 defer file.Close()
722724 
723 fileUpload, err := client.Beta.Files.Upload(context.Background(),
724 anthropic.BetaFileUploadParams{
725 File: file,
725 fileUpload, err := client.Files.Upload(context.Background(),
726 anthropic.FileUploadParams{
727 File: anthropic.File(file, "vision-example.jpg", "image/jpeg"),
726728 })
727729 if err != nil {
728730 log.Fatal(err)
from line 731
729731 }
730732 
731733 // Use the uploaded file in a message
732 message, err := client.Beta.Messages.New(context.Background(),
733 anthropic.BetaMessageNewParams{
734 message, err := client.Messages.New(context.Background(),
735 anthropic.MessageNewParams{
734736 Model: anthropic.ModelClaudeOpus5,
735737 MaxTokens: 1024,
736 Betas: []anthropic.AnthropicBeta{anthropic.AnthropicBetaFilesAPI2025_04_14},
737 Messages: []anthropic.BetaMessageParam{
738 anthropic.NewBetaUserMessage(
739 anthropic.NewBetaImageBlock(anthropic.BetaFileImageSourceParam{
738 Messages: []anthropic.MessageParam{
739 anthropic.NewUserMessage(
740 anthropic.NewImageBlock(anthropic.FileImageSourceParam{
740741 FileID: fileUpload.ID,
741742 }),
742 anthropic.NewBetaTextBlock("Describe this image."),
743 anthropic.NewTextBlock("Describe this image."),
743744 ),
744745 },
745746 })
from line 752
751752 ```
752753 
753754 ```java Java
754 import com.anthropic.models.beta.files.FileMetadata;
755 import com.anthropic.models.beta.files.FileUploadParams;
755 import com.anthropic.core.MultipartField;
756 import com.anthropic.models.files.FileMetadata;
757 import com.anthropic.models.files.FileUploadParams;
756758 // ...
757759 AnthropicClient client = AnthropicOkHttpClient.fromEnv();
758760 
759761 // Upload the image file
760 FileMetadata file = client
761 .beta()
762 .files()
763 .upload(
764 FileUploadParams.builder()
765 .file(Files.newInputStream(Path.of("vision-example.jpg")))
766 .build()
767 );
762 FileMetadata file = client.files().upload(
763 FileUploadParams.builder()
764 .file(
765 MultipartField.<InputStream>builder()
766 .value(Files.newInputStream(Path.of("vision-example.jpg")))
767 .filename("vision-example.jpg")
768 .contentType("image/jpeg")
769 .build()
770 )
771 .build()
772 );
768773 
769774 // Use the uploaded file in a message
770775 ImageBlockParam imageParam = ImageBlockParam.builder().fileSource(file.id()).build();
from line 796
791796 
792797 // Upload the image file
793798 $fileUpload = $client->beta->files->upload(
794 file: fopen('vision-example.jpg', 'r'),
799 FileParam::fromResource(fopen('vision-example.jpg', 'rb'), contentType: 'image/jpeg'),
795800 );
796801 
797802 // Use the uploaded file in a message
from line 825
820825 client = Anthropic::Client.new
821826 
822827 # Upload the image file
823 file_upload = client.beta.files.upload(
824 file: File.open("vision-example.jpg", "rb")
828 file_upload = client.files.upload(
829 file: Anthropic::FilePart.new(
830 File.open("vision-example.jpg", "rb"),
831 content_type: "image/jpeg"
832 )
825833 )
826834 
827835 # Use the uploaded file in a message
828 message = client.beta.messages.create(
836 message = client.messages.create(
829837 model: "claude-opus-5",
830838 max_tokens: 1024,
831 betas: ["files-api-2025-04-14"],
832839 messages: [
833840 {
834841 role: "user",

cli-sdks-libraries/sdks/csharp Changed · +3 / -3 lines

from line 354
354354 
355355```csharp
356356using System;
357using Anthropic.Models.Beta.Files;
357using Anthropic.Models.Files;
358358 
359359FileDownloadParams parameters = new() { FileID = "file_id" };
360360 
361var response = await client.Beta.Files.Download(parameters);
361var response = await client.Files.Download(parameters);
362362 
363363Console.WriteLine(response);
364364```
from line 368
368368```csharp
369369using System.IO;
370370 
371using var response = await client.Beta.Files.Download(parameters);
371using var response = await client.Files.Download(parameters);
372372using var contentStream = await response.ReadAsStream();
373373using var fileStream = File.Open(path, FileMode.OpenOrCreate);
374374await contentStream.CopyToAsync(fileStream); // Or any other Stream

cli-sdks-libraries/sdks/go Changed · +3 / -3 lines

from line 26
2626 
2727## Requirements
2828 
29This library requires Go 1.23+.
29This library requires Go 1.24+.
3030 
3131## Usage
3232 
from line 560
560560```go
561561// A file from the file system
562562file, err := os.Open("/path/to/file.json")
563anthropic.BetaFileUploadParams{
563anthropic.FileUploadParams{
564564 File: anthropic.File(file, "custom-name.json", "application/json"),
565565}
566566 
567567// A file from a string
568anthropic.BetaFileUploadParams{
568anthropic.FileUploadParams{
569569 File: anthropic.File(strings.NewReader("my file contents"), "custom-name.json", "application/json"),
570570}
571571```

cli-sdks-libraries/sdks/java Changed · +18 / -29 lines

from line 15
1515<Tabs>
1616 <Tab title="Gradle">
1717 ```kotlin
18 implementation("com.anthropic:anthropic-java:2.53.0")
18 implementation("com.anthropic:anthropic-java:2.57.0")
1919 ```
2020 </Tab>
2121 
from line 24
2424 <dependency>
2525 <groupId>com.anthropic</groupId>
2626 <artifactId>anthropic-java</artifactId>
27 <version>2.53.0</version>
27 <version>2.57.0</version>
2828 </dependency>
2929 ```
3030 </Tab>
from line 466
466466 
467467```java
468468import com.anthropic.core.MultipartField;
469import com.anthropic.models.beta.files.FileMetadata;
470import com.anthropic.models.beta.files.FileUploadParams;
469import com.anthropic.models.files.FileMetadata;
470import com.anthropic.models.files.FileUploadParams;
471471 
472472FileUploadParams params = FileUploadParams.builder()
473473 .file(
from line 478
478478 )
479479 .build();
480480 
481FileMetadata fileMetadata = client.beta().files().upload(params);
481FileMetadata fileMetadata = client.files().upload(params);
482482```
483483 
484484Or from an `InputStream`:
from line 485
485485 
486486```java
487487import com.anthropic.core.MultipartField;
488import com.anthropic.models.beta.files.FileMetadata;
489import com.anthropic.models.beta.files.FileUploadParams;
488import com.anthropic.models.files.FileMetadata;
489import com.anthropic.models.files.FileUploadParams;
490490 
491491FileUploadParams params = FileUploadParams.builder()
492492 .file(
from line 498
498498 )
499499 .build();
500500 
501FileMetadata fileMetadata = client.beta().files().upload(params);
501FileMetadata fileMetadata = client.files().upload(params);
502502```
503503 
504504Or from in-memory bytes:
from line 505
505505 
506506```java
507507import com.anthropic.core.MultipartField;
508import com.anthropic.models.beta.files.FileMetadata;
509import com.anthropic.models.beta.files.FileUploadParams;
508import com.anthropic.models.files.FileMetadata;
509import com.anthropic.models.files.FileUploadParams;
510510 
511511FileUploadParams params = FileUploadParams.builder()
512512 .file(
from line 518
518518 )
519519 .build();
520520 
521FileMetadata fileMetadata = client.beta().files().upload(params);
521FileMetadata fileMetadata = client.files().upload(params);
522522```
523523 
524524### Binary responses
from line 528
528528```java
529529import com.anthropic.core.http.HttpResponse;
530530 
531HttpResponse response = client.beta().files().download("file_abc123");
531HttpResponse response = client.files().download("file_abc123");
532532```
533533 
534534To save the response content to a file:
from line 536
536536```java
537537import com.anthropic.core.http.HttpResponse;
538538 
539try (HttpResponse response = client.beta().files().download(params)) {
539try (HttpResponse response = client.files().download(params)) {
540540 Files.copy(
541541 response.body(),
542542 Paths.get(path),
from line 553
553553```java
554554import com.anthropic.core.http.HttpResponse;
555555 
556try (HttpResponse response = client.beta().files().download(params)) {
556try (HttpResponse response = client.files().download(params)) {
557557 response.body().transferTo(Files.newOutputStream(Paths.get(path)));
558558} catch (Exception e) {
559559 IO.println("Something went wrong!");
from line 1137
11371137```
11381138 
11391139<Accordion title="Jackson compatibility">
1140 The SDK depends on Jackson for JSON serialization/deserialization. It is compatible with version 2.13.4 or higher, but depends on version 2.18.2 by default.
1140 The SDK depends on Jackson for JSON serialization/deserialization. It is compatible with version 2.13.4 or higher, but depends on version 2.19.4 by default.
11411141 
11421142 The SDK throws an exception if it detects an incompatible Jackson version at runtime (for example, if the default version was overridden in your Maven or Gradle config).
11431143 
from line 1200
12001200 
12011201You can access most beta API features through the `beta()` method on the client. To enable a particular beta feature, add the appropriate [beta header](https://platform.claude.com/docs/en/api/beta-headers) with `.addBeta()` when building the message params.
12021202 
1203For example, to use the [Files API](https://platform.claude.com/docs/en/build-with-claude/files):
1203For example, to enable [context editing](https://platform.claude.com/docs/en/build-with-claude/context-editing):
12041204 
12051205```java
12061206import com.anthropic.models.beta.AnthropicBeta;
1207import com.anthropic.models.beta.messages.BetaContentBlockParam;
12081207import com.anthropic.models.beta.messages.BetaMessage;
1209import com.anthropic.models.beta.messages.BetaRequestDocumentBlock;
1210import com.anthropic.models.beta.messages.BetaTextBlockParam;
12111208import com.anthropic.models.beta.messages.MessageCreateParams;
12121209// ...
12131210void main() {
from line 1214
12171214 MessageCreateParams.builder()
12181215 .model(Model.CLAUDE_OPUS_5)
12191216 .maxTokens(1024L)
1220 .addBeta(AnthropicBeta.FILES_API_2025_04_14)
1221 .addUserMessageOfBetaContentBlockParams(List.of(
1222 BetaContentBlockParam.ofText(
1223 BetaTextBlockParam.builder()
1224 .text("Please summarize this document for me.")
1225 .build()),
1226 BetaContentBlockParam.ofDocument(
1227 BetaRequestDocumentBlock.builder()
1228 .fileSource("file_abc123")
1229 .build())))
1217 .addBeta(AnthropicBeta.CONTEXT_MANAGEMENT_2025_06_27)
1218 .addUserMessage("Hello, Claude")
12301219 .build());
12311220}
12321221```

cli-sdks-libraries/sdks/python Changed · +5 / -19 lines

from line 330
330330client = Anthropic()
331331 
332332# Upload using a file path
333client.beta.files.upload(
333client.files.upload(
334334 file=Path("/path/to/file"),
335335)
336336 
337337# Upload using bytes
338client.beta.files.upload(
338client.files.upload(
339339 file=("file.txt", b"my bytes", "text/plain"),
340340)
341341```
from line 713
713713 
714714You can access most beta API features through the `beta` property of the client. To enable a particular beta feature, you need to add the appropriate [beta header](https://platform.claude.com/docs/en/api/beta-headers) to the `betas` field when creating a message.
715715 
716For example, to use the [Files API](https://platform.claude.com/docs/en/build-with-claude/files):
716For example, to enable [context editing](https://platform.claude.com/docs/en/build-with-claude/context-editing):
717717 
718718```python
719719client = Anthropic()
from line 721
721721response = client.beta.messages.create(
722722 model="claude-opus-5",
723723 max_tokens=1024,
724 messages=[
725 {
726 "role": "user",
727 "content": [
728 {"type": "text", "text": "Please summarize this document for me."},
729 {
730 "type": "document",
731 "source": {
732 "type": "file",
733 "file_id": "file_abc123",
734 },
735 },
736 ],
737 },
738 ],
739 betas=["files-api-2025-04-14"],
724 messages=[{"role": "user", "content": "Hello, Claude"}],
725 betas=["context-management-2025-06-27"],
740726)
741727```
742728 

cli-sdks-libraries/sdks/ruby Changed · +3 / -3 lines

from line 237
237237require "pathname"
238238 
239239# Use `Pathname` to send the filename and/or avoid paging a large file into memory:
240file_metadata = anthropic.beta.files.upload(file: Pathname("/path/to/file"))
240file_metadata = anthropic.files.upload(file: Pathname("/path/to/file"))
241241 
242242# Alternatively, pass file contents or a `StringIO` directly:
243file_metadata = anthropic.beta.files.upload(file: File.read("/path/to/file"))
243file_metadata = anthropic.files.upload(file: File.read("/path/to/file"))
244244 
245245# Or, to control the filename and/or content type:
246246file = Anthropic::FilePart.new(File.read("/path/to/file"), filename: "/path/to/file", content_type: "...")
247file_metadata = anthropic.beta.files.upload(file: file)
247file_metadata = anthropic.files.upload(file: file)
248248 
249249puts(file_metadata.id)
250250```

cli-sdks-libraries/sdks/typescript Changed · +9 / -23 lines

from line 270
270270 
271271// Upload MCP resources as files
272272const fileResource = await mcpClient.readResource({ uri: "file:///path/to/data.json" });
273await anthropic.beta.files.upload({ file: mcpResourceToFile(fileResource) });
273await anthropic.files.upload({ file: mcpResourceToFile(fileResource) });
274274```
275275 
276276### MCP error handling
from line 339
339339const client = new Anthropic();
340340 
341341// If you have access to Node `fs`, use `fs.createReadStream()`:
342await client.beta.files.upload({
342await client.files.upload({
343343 file: await toFile(fs.createReadStream("/path/to/file"), undefined, {
344344 type: "application/json"
345345 })
from line 346
346346});
347347 
348348// Or if you have the web `File` API you can pass a `File` instance:
349await client.beta.files.upload({
349await client.files.upload({
350350 file: new File(["my bytes"], "file.txt", { type: "text/plain" })
351351});
352352// You can also pass a `fetch` `Response`:
353await client.beta.files.upload({
353await client.files.upload({
354354 file: await fetch("https://somesite/file")
355355});
356356 
357357// Or a `Buffer` / `Uint8Array`
358await client.beta.files.upload({
358await client.files.upload({
359359 file: await toFile(Buffer.from("my bytes"), "file", { type: "text/plain" })
360360});
361await client.beta.files.upload({
361await client.files.upload({
362362 file: await toFile(new Uint8Array([0, 1, 2]), "file", { type: "text/plain" })
363363});
364364```
from line 730
730730 
731731You can access most beta API features through the beta property of the client. To enable a particular beta feature, you need to add the appropriate [beta header](https://platform.claude.com/docs/en/api/beta-headers) to the `betas` field when creating a message.
732732 
733For example, to use the [Files API](https://platform.claude.com/docs/en/build-with-claude/files):
733For example, to enable [context editing](https://platform.claude.com/docs/en/build-with-claude/context-editing):
734734 
735735```typescript
736736const client = new Anthropic();
from line 737
737737const response = await client.beta.messages.create({
738738 model: "claude-opus-5",
739739 max_tokens: 1024,
740 messages: [
741 {
742 role: "user",
743 content: [
744 { type: "text", text: "Please summarize this document for me." },
745 {
746 type: "document",
747 source: {
748 type: "file",
749 file_id: "file_abc123"
750 }
751 }
752 ]
753 }
754 ],
755 betas: ["files-api-2025-04-14"]
740 messages: [{ role: "user", content: "Hello, Claude" }],
741 betas: ["context-management-2025-06-27"]
756742});
757743```
758744 

manage-claude/user-management Changed · +9 / -20 lines

from line 7
77This page covers managing the people in your **Claude Enterprise** (claude.ai) organization programmatically, using the [Admin API](https://platform.claude.com/docs/en/api/admin): list members and look them up by email address, change a member's role, remove members, send and withdraw invites, manage your enterprise's groups and their membership, and read your organization's custom roles. For Claude Console (Claude Platform) organizations, see the [Admin API guide for Claude Console](https://platform.claude.com/docs/en/manage-claude/admin-api).
88 
99<Note>
10 **The endpoints on this page are generally available for Claude Enterprise organizations.** The [beta header](https://platform.claude.com/docs/en/api/beta-headers) `anthropic-beta: ce-user-management-2026-07-13` is no longer required on group and custom-role requests; requests that still send it are accepted and behave identically. The group and custom-role examples on this page still send the header, which continues to work.
10 **The endpoints on this page are generally available for Claude Enterprise organizations.** The [beta header](https://platform.claude.com/docs/en/api/beta-headers) `anthropic-beta: ce-user-management-2026-07-13` is no longer required on group and custom-role requests; requests that still send it are accepted and behave identically.
1111</Note>
1212 
1313## Which endpoints can your organization use?
from line 255
255255 
256256```bash cURL
257257curl "https://api.anthropic.com/v1/organizations/rbac_groups?limit=20" \
258 -H "x-api-key: $ANTHROPIC_ADMIN_KEY" \
259 -H "anthropic-beta: ce-user-management-2026-07-13"
258 -H "x-api-key: $ANTHROPIC_ADMIN_KEY"
260259```
261260 
262261```json
from line 284
285284 
286285```bash cURL
287286curl "https://api.anthropic.com/v1/organizations/rbac_groups/rbac_group_01UvWxYzAbCdEfGhIjKlMn" \
288 -H "x-api-key: $ANTHROPIC_ADMIN_KEY" \
289 -H "anthropic-beta: ce-user-management-2026-07-13"
287 -H "x-api-key: $ANTHROPIC_ADMIN_KEY"
290288```
291289 
292290### Create a group
from line 297
299297curl -X POST "https://api.anthropic.com/v1/organizations/rbac_groups" \
300298 -H "content-type: application/json" \
301299 -H "x-api-key: $ANTHROPIC_ADMIN_KEY" \
302 -H "anthropic-beta: ce-user-management-2026-07-13" \
303300 -d '{"name": "Engineering"}'
304301```
305302 
from line 322
325322curl -X POST "https://api.anthropic.com/v1/organizations/rbac_groups/rbac_group_01UvWxYzAbCdEfGhIjKlMn" \
326323 -H "content-type: application/json" \
327324 -H "x-api-key: $ANTHROPIC_ADMIN_KEY" \
328 -H "anthropic-beta: ce-user-management-2026-07-13" \
329325 -d '{"name": "Platform Engineering"}'
330326```
331327 
from line 333
337333 
338334```bash cURL
339335curl -X DELETE "https://api.anthropic.com/v1/organizations/rbac_groups/rbac_group_01UvWxYzAbCdEfGhIjKlMn" \
340 -H "x-api-key: $ANTHROPIC_ADMIN_KEY" \
341 -H "anthropic-beta: ce-user-management-2026-07-13"
336 -H "x-api-key: $ANTHROPIC_ADMIN_KEY"
342337```
343338 
344339```json
from line 351
356351 
357352```bash cURL
358353curl "https://api.anthropic.com/v1/organizations/rbac_groups/rbac_group_01UvWxYzAbCdEfGhIjKlMn/members?limit=100" \
359 -H "x-api-key: $ANTHROPIC_ADMIN_KEY" \
360 -H "anthropic-beta: ce-user-management-2026-07-13"
354 -H "x-api-key: $ANTHROPIC_ADMIN_KEY"
361355```
362356 
363357```json
from line 380
386380curl -X POST "https://api.anthropic.com/v1/organizations/rbac_groups/rbac_group_01UvWxYzAbCdEfGhIjKlMn/members" \
387381 -H "content-type: application/json" \
388382 -H "x-api-key: $ANTHROPIC_ADMIN_KEY" \
389 -H "anthropic-beta: ce-user-management-2026-07-13" \
390383 -d '{"user_id": "user_01AbCdEfGhIjKlMnOpQrSt"}'
391384```
392385 
from line 401
408401 
409402```bash cURL
410403curl -X DELETE "https://api.anthropic.com/v1/organizations/rbac_groups/rbac_group_01UvWxYzAbCdEfGhIjKlMn/members/user_01AbCdEfGhIjKlMnOpQrSt" \
411 -H "x-api-key: $ANTHROPIC_ADMIN_KEY" \
412 -H "anthropic-beta: ce-user-management-2026-07-13"
404 -H "x-api-key: $ANTHROPIC_ADMIN_KEY"
413405```
414406 
415407```json
from line 424
432424 
433425```bash cURL
434426curl "https://api.anthropic.com/v1/organizations/rbac_roles?limit=20" \
435 -H "x-api-key: $ANTHROPIC_ADMIN_KEY" \
436 -H "anthropic-beta: ce-user-management-2026-07-13"
427 -H "x-api-key: $ANTHROPIC_ADMIN_KEY"
437428```
438429 
439430```json
from line 451
460451 
461452```bash cURL
462453curl "https://api.anthropic.com/v1/organizations/rbac_roles/rbac_role_01CdEfGhIjKlMnOpQrStUv" \
463 -H "x-api-key: $ANTHROPIC_ADMIN_KEY" \
464 -H "anthropic-beta: ce-user-management-2026-07-13"
454 -H "x-api-key: $ANTHROPIC_ADMIN_KEY"
465455```
466456 
467457### List a role's permissions
from line 464
474464 
475465```bash cURL
476466curl "https://api.anthropic.com/v1/organizations/rbac_roles/rbac_role_01CdEfGhIjKlMnOpQrStUv/permissions?limit=20" \
477 -H "x-api-key: $ANTHROPIC_ADMIN_KEY" \
478 -H "anthropic-beta: ce-user-management-2026-07-13"
467 -H "x-api-key: $ANTHROPIC_ADMIN_KEY"
479468```
480469 
481470```json

managed-agents/agent-setup Changed · +51 / -26 lines

from line 52
5252 AGENT_VERSION=$(jq -r '.version' <<< "$agent")
5353 ```
5454 
55 ```bash CLI
56 agent=$(ant beta:agents create \
57 --name "Coding Assistant" \
58 --model '{id: claude-opus-5}' \
59 --system "You are a helpful coding agent." \
60 --tool '{type: agent_toolset_20260401}' \
61 --format json)
55 <MultiFileExample language="cli" label="CLI">
56 ```bash CLI
57 agent=$(ant beta:agents create --format json < coding-assistant.agent.yaml)
6258 
63 AGENT_ID=$(jq -r '.id' <<< "$agent")
64 AGENT_VERSION=$(jq -r '.version' <<< "$agent")
65 ```
59 AGENT_ID=$(jq -r '.id' <<< "$agent")
60 ```
6661 
62 <File filename="coding-assistant.agent.yaml">
63 ```yaml
64 name: Coding Assistant
65 model:
66 id: claude-opus-5
67 system: You are a helpful coding agent.
68 tools:
69 - type: agent_toolset_20260401
70 ```
71 </File>
72 </MultiFileExample>
73 
6774 ```python Python
6875 agent = client.beta.agents.create(
6976 name="Coding Assistant",
from line 228
221228 echo "Inference geo: $(jq -r '.model.inference_geo' <<< "$agent")"
222229 ```
223230 
224 ```bash CLI
225 agent=$(ant beta:agents create \
226 --name "Geo-pinned assistant" \
227 --model '{id: claude-opus-5, inference_geo: us}' \
228 --system "You are a helpful assistant." \
229 --format json)
231 <MultiFileExample language="cli" label="CLI">
232 ```bash CLI
233 agent=$(ant beta:agents create --format json < geo-pinned.agent.yaml)
230234 
231 echo "Inference geo: $(jq -r '.model.inference_geo' <<< "$agent")"
232 ```
235 echo "Inference geo: $(jq -r '.model.inference_geo' <<< "$agent")"
236 ```
233237 
238 <File filename="geo-pinned.agent.yaml">
239 ```yaml
240 name: Geo-pinned assistant
241 model:
242 id: claude-opus-5
243 inference_geo: us
244 system: You are a helpful assistant.
245 ```
246 </File>
247 </MultiFileExample>
248 
234249 ```python Python
235250 agent = client.beta.agents.create(
236251 name="Geo-pinned assistant",
from line 367
352367 echo "New version: $(jq -r '.version' <<< "$updated_agent")"
353368 ```
354369 
355 ```bash CLI
356 ant beta:agents update \
357 --agent-id "$AGENT_ID" \
358 --version "$AGENT_VERSION" \
359 --system "You are a helpful coding agent. Always write tests."
360 ```
370 <MultiFileExample language="cli" label="CLI">
371 ```bash CLI
372 ant beta:agents update --agent-id "$AGENT_ID" < coding-assistant.agent.yaml
373 ```
374 
375 <File filename="coding-assistant.agent.yaml">
376 ```yaml
377 name: Coding Assistant
378 model:
379 id: claude-opus-5
380 system: You are a helpful coding agent. Always write tests.
381 tools:
382 - type: agent_toolset_20260401
383 ```
384 </File>
385 </MultiFileExample>
361386 
362387 ```python Python
363388 updated_agent = client.beta.agents.update(

managed-agents/define-outcomes Changed · +17 / -17 lines

from line 70
7070 ```
7171 
7272 ```bash CLI
73 RUBRIC_ID=$(ant beta:files upload \
73 RUBRIC_ID=$(ant files upload \
7474 --file /tmp/rubric.md \
7575 --transform id --raw-output)
7676 ```
from line 94
9494 """
9595 Path("/tmp/rubric.md").write_text(RUBRIC)
9696 
97 rubric = client.beta.files.upload(file=Path("/tmp/rubric.md"))
97 rubric = client.files.upload(file=Path("/tmp/rubric.md"))
9898 print(f"Uploaded rubric: {rubric.id}")
9999 ```
100100 
from line 117
117117 `;
118118 await writeFile("/tmp/rubric.md", RUBRIC);
119119 
120 const rubric = await client.beta.files.upload({
120 const rubric = await client.files.upload({
121121 file: await toFile(readFile("/tmp/rubric.md"), "/tmp/rubric.md"),
122122 });
123123 console.log(`Uploaded rubric: ${rubric.id}`);
from line 127
127127 using Anthropic;
128128 using Anthropic.Models.Beta.Agents;
129129 using Anthropic.Models.Beta.Environments;
130 using Anthropic.Models.Beta.Files;
131130 using Anthropic.Models.Beta.Sessions;
132131 using Anthropic.Models.Beta.Sessions.Events;
132 using Anthropic.Models.Files;
133133 
134134 var client = new AnthropicClient();
135135 
from line 145
145145 """;
146146 await File.WriteAllTextAsync("/tmp/rubric.md", Rubric);
147147 
148 var rubric = await client.Beta.Files.Upload(new()
148 var rubric = await client.Files.Upload(new()
149149 {
150150 File = File.OpenRead("/tmp/rubric.md"),
151151 });
from line 188
188188 panic(err)
189189 }
190190 
191 uploaded, err := client.Beta.Files.Upload(ctx, anthropic.BetaFileUploadParams{
191 uploaded, err := client.Files.Upload(ctx, anthropic.FileUploadParams{
192192 File: anthropic.File(f, "rubric.md", "text/markdown"),
193193 })
194194 if err != nil {
from line 207
207207 import com.anthropic.models.beta.environments.BetaCloudConfigParams;
208208 import com.anthropic.models.beta.environments.EnvironmentCreateParams;
209209 import com.anthropic.models.beta.files.FileListParams;
210 import com.anthropic.models.beta.files.FileUploadParams;
211210 import com.anthropic.models.beta.sessions.SessionCreateParams;
212211 import com.anthropic.models.beta.sessions.events.BetaManagedAgentsTextRubricParams;
213212 import com.anthropic.models.beta.sessions.events.BetaManagedAgentsUserDefineOutcomeEventParams;
214213 import com.anthropic.models.beta.sessions.events.BetaManagedAgentsUserInterruptEventParams;
215214 import com.anthropic.models.beta.sessions.events.EventSendParams;
215 import com.anthropic.models.files.FileUploadParams;
216216 
217217 import java.io.InputStream;
218218 import java.nio.file.Files;
from line 234
234234 """;
235235 Files.writeString(Path.of("/tmp/rubric.md"), RUBRIC);
236236 
237 var rubric = client.beta().files().upload(
237 var rubric = client.files().upload(
238238 FileUploadParams.builder()
239239 .file(Path.of("/tmp/rubric.md"))
240240 .build());
from line 283
283283 MD
284284 File.write("/tmp/rubric.md", RUBRIC)
285285 
286 rubric = client.beta.files.upload(file: Pathname.new("/tmp/rubric.md"))
286 rubric = client.files.upload(file: Pathname.new("/tmp/rubric.md"))
287287 puts "Uploaded rubric: #{rubric.id}"
288288 ```
289289</CodeGroup>
from line 718
718718The agent writes output files to `/mnt/session/outputs/` inside the sandbox. Once the session is idle, fetch them through the [Files API](https://platform.claude.com/docs/en/build-with-claude/files) scoped to the session.
719719 
720720<Note>
721 Filtering by `scope_id` requires the `managed-agents-2026-04-01` beta header on the files request. The SDK files methods send only the files beta automatically, so the examples pass it explicitly.
721 Filtering by `scope_id` requires the `managed-agents-2026-04-01` beta header on the list request, so the SDK and CLI examples make that call through the `beta` namespace and pass the header explicitly. Downloading a file by ID needs no beta header.
722722</Note>
723723 
724724<CodeGroup>
from line 753
753753 --beta managed-agents-2026-04-01 \
754754 --transform 'data[0].id' --raw-output)
755755 if [[ -n $FILE_ID ]]; then
756 ant beta:files download --file-id "$FILE_ID" --output /tmp/output.txt
756 ant files download --file-id "$FILE_ID" --output /tmp/output.txt
757757 fi
758758 ```
759759 
from line 766
766766 
767767 # Download a file
768768 if files.data:
769 content = client.beta.files.download(files.data[0].id)
769 content = client.files.download(files.data[0].id)
770770 content.write_to_file("/tmp/output.txt")
771771 ```
772772 
from line 783
783783 
784784 // Download a file
785785 if (files.data.length > 0) {
786 const content = await client.beta.files.download(files.data[0].id);
786 const content = await client.files.download(files.data[0].id);
787787 await writeFile("/tmp/output.txt", new Uint8Array(await content.arrayBuffer()));
788788 }
789789 ```
from line 804
804804 // Download a file
805805 if (files.Items.Count > 0)
806806 {
807 using var download = await client.Beta.Files.Download(files.Items[0].ID);
807 using var download = await client.Files.Download(files.Items[0].ID);
808808 await using var output = File.Create("/tmp/output.txt");
809809 await (await download.ReadAsStream()).CopyToAsync(output);
810810 }
from line 826
826826 
827827 // Download a file
828828 if len(files.Data) > 0 {
829 resp, err := client.Beta.Files.Download(ctx, files.Data[0].ID, anthropic.BetaFileDownloadParams{})
829 resp, err := client.Files.Download(ctx, files.Data[0].ID)
830830 if err != nil {
831831 panic(err)
832832 }
from line 856
856856 
857857 // Download a file
858858 if (!files.data().isEmpty()) {
859 try (HttpResponse response = client.beta().files().download(files.data().getFirst().id())) {
859 try (HttpResponse response = client.files().download(files.data().getFirst().id())) {
860860 try (InputStream body = response.body()) {
861861 Files.copy(body, Path.of("/tmp/output.txt"), StandardCopyOption.REPLACE_EXISTING);
862862 }
from line 887
887887 
888888 # Download a file
889889 if (first = files.data.first)
890 content = client.beta.files.download(first.id)
890 content = client.files.download(first.id)
891891 File.binwrite("/tmp/output.txt", content.read)
892892 end
893893 ```

managed-agents/environments Changed · +56 / -34 lines

from line 36
3636 echo "Environment ID: $environment_id"
3737 ```
3838 
39 ```bash CLI
40 ant beta:environments create \
41 --name "python-dev" \
42 --config '{type: cloud, networking: {type: unrestricted}}'
43 ```
39 <MultiFileExample language="cli" label="CLI">
40 ```bash CLI
41 ant beta:environments create < python-dev.environment.yaml
42 ```
4443 
44 <File filename="python-dev.environment.yaml">
45 ```yaml
46 name: python-dev
47 config:
48 type: cloud
49 networking:
50 type: unrestricted
51 ```
52 </File>
53 </MultiFileExample>
54 
4555 ```python Python
4656 environment = client.beta.environments.create(
4757 name="python-dev",
from line 251
241251 )
242252 ```
243253 
244 ```bash CLI
245 ant beta:environments create <<'YAML'
246 name: data-analysis
247 config:
248 type: cloud
249 packages:
250 pip:
251 - pandas
252 - numpy
253 - scikit-learn
254 npm:
255 - express
256 networking:
257 type: unrestricted
258 YAML
259 ```
254 <MultiFileExample language="cli" label="CLI">
255 ```bash CLI
256 ant beta:environments create < environment.yaml
257 ```
260258 
259 <File filename="environment.yaml">
260 ```yaml
261 name: data-analysis
262 config:
263 type: cloud
264 packages:
265 pip:
266 - pandas
267 - numpy
268 - scikit-learn
269 npm:
270 - express
271 networking:
272 type: unrestricted
273 ```
274 </File>
275 </MultiFileExample>
276 
261277 ```python Python
262278 environment = client.beta.environments.create(
263279 name="data-analysis",
from line 429
413429 }'
414430 ```
415431 
416 ```bash CLI
417 ant beta:environments create <<'YAML'
418 name: api-access
419 config:
420 type: cloud
421 networking:
422 type: limited
423 allowed_hosts:
424 - api.example.com
425 allow_mcp_servers: true
426 allow_package_managers: true
427 YAML
428 ```
432 <MultiFileExample language="cli" label="CLI">
433 ```bash CLI
434 ant beta:environments create < environment.yaml
435 ```
436 
437 <File filename="environment.yaml">
438 ```yaml
439 name: api-access
440 config:
441 type: cloud
442 networking:
443 type: limited
444 allowed_hosts:
445 - api.example.com
446 allow_mcp_servers: true
447 allow_package_managers: true
448 ```
449 </File>
450 </MultiFileExample>
429451 
430452 ```python Python
431453 environment = client.beta.environments.create(

managed-agents/files Changed · +21 / -19 lines

from line 24
2424 ```
2525 
2626 ```bash CLI
27 FILE_ID=$(ant beta:files upload \
27 FILE_ID=$(ant files upload \
2828 --file data.csv \
2929 --transform id --raw-output)
3030 ```
3131 
3232 ```python Python
33 file = client.beta.files.upload(file=Path("data.csv"))
33 file = client.files.upload(file=Path("data.csv"))
3434 print(f"File ID: {file.id}")
3535 ```
3636 
3737 ```typescript TypeScript
38 const file = await client.beta.files.upload({
38 const file = await client.files.upload({
3939 file: await toFile(readFile("data.csv"), "data.csv", { type: "text/csv" }),
4040 });
4141 console.log(`File ID: ${file.id}`);
from line 43
4343 
4444 ```csharp C#
4545 await using var stream = File.OpenRead(csvPath);
46 var file = await client.Beta.Files.Upload(new() { File = stream });
46 var file = await client.Files.Upload(new() { File = stream });
4747 Console.WriteLine($"File ID: {file.ID}");
4848 ```
4949 
from line 54
5454 }
5555 defer csvFile.Close()
5656 
57 file, err := client.Beta.Files.Upload(ctx, anthropic.BetaFileUploadParams{
57 file, err := client.Files.Upload(ctx, anthropic.FileUploadParams{
5858 File: csvFile,
5959 })
6060 if err != nil {
from line 64
6464 ```
6565 
6666 ```java Java
67 var file = client.beta().files().upload(
67 var file = client.files().upload(
6868 FileUploadParams.builder().file(dataCsv).build()
6969 );
7070 IO.println("File ID: " + file.id());
from line 78
7878 ```
7979 
8080 ```ruby Ruby
81 file = client.beta.files.upload(file: Pathname(csv_path))
81 file = client.files.upload(file: Pathname(csv_path))
8282 puts "File ID: #{file.id}"
8383 ```
8484</CodeGroup>
from line 537
537537 
538538## Listing and downloading session files
539539 
540Use the [Files API](https://platform.claude.com/docs/en/build-with-claude/files) to list files scoped to a session and download them.
540Use the [Files API](https://platform.claude.com/docs/en/build-with-claude/files) to list files scoped to a session and download them. Filtering by `scope_id` requires the `managed-agents-2026-04-01` beta header, so the list examples use the `beta` files namespace and pass that header explicitly. Downloading a file doesn't require a beta header.
541541 
542542<CodeGroup>
543543 ```bash cURL
from line 551
551551 curl -fsSL "https://api.anthropic.com/v1/files/$FILE_ID/content" \
552552 -H "x-api-key: $ANTHROPIC_API_KEY" \
553553 -H "anthropic-version: 2023-06-01" \
554 -H "anthropic-beta: managed-agents-2026-04-01" \
555554 -o output.txt
556555 ```
557556 
from line 560
561560 --beta managed-agents-2026-04-01
562561 
563562 # Download a file
564 ant beta:files download --file-id "$FILE_ID" --output output.txt
563 ant files download --file-id "$FILE_ID" --output output.txt
565564 ```
566565 
567566 ```python Python
from line 573
574573 print(file.id, file.filename)
575574 
576575 # Download a file
577 content = client.beta.files.download(files.data[0].id)
576 content = client.files.download(files.data[0].id)
578577 content.write_to_file("output.txt")
579578 ```
580579 
581580 ```typescript TypeScript
581 import { writeFile } from "node:fs/promises";
582 
582583 // List files associated with a session
583584 const files = await client.beta.files.list({
584585 scope_id: "sesn_abc123",
from line 590
589590 }
590591 
591592 // Download a file
592 const content = await client.beta.files.download(files.data[0].id);
593 await content.writeToFile("output.txt");
593 const content = await client.files.download(files.data[0].id);
594 await writeFile("output.txt", new Uint8Array(await content.arrayBuffer()));
594595 ```
595596 
596597 ```csharp C#
597598 // List files associated with a session
598 var files = await client.Beta.Files.List(new FileListParams
599 var files = await client.Beta.Files.List(new()
599600 {
600601 ScopeID = "sesn_abc123",
601602 Betas = ["managed-agents-2026-04-01"],
from line 603
602603 });
603604 
604605 // Download a file
605 byte[] content = await client.Beta.Files.Download(files.Data[0].ID);
606 await File.WriteAllBytesAsync("output.txt", content);
606 using var content = await client.Files.Download(files.Items[0].ID);
607 await using var output = File.Create("output.txt");
608 await (await content.ReadAsStream()).CopyToAsync(output);
607609 ```
608610 
609611 ```go Go
from line 619
617619 }
618620 
619621 // Download a file
620 resp, err := client.Beta.Files.Download(ctx, files.Data[0].ID, anthropic.BetaFileDownloadParams{})
622 resp, err := client.Files.Download(ctx, files.Data[0].ID)
621623 if err != nil {
622624 panic(err)
623625 }
from line 642
640642 .build());
641643 
642644 // Download a file
643 try (HttpResponse response = client.beta().files().download(files.data().get(0).id())) {
645 try (HttpResponse response = client.files().download(files.data().get(0).id())) {
644646 try (InputStream body = response.body()) {
645647 Files.copy(body, Path.of("output.txt"), StandardCopyOption.REPLACE_EXISTING);
646648 }
from line 669
667669 )
668670 
669671 # Download a file
670 content = client.beta.files.download(files.data[0].id)
672 content = client.files.download(files.data[0].id)
671673 File.binwrite("output.txt", content.read)
672674 ```
673675</CodeGroup>
Feedback