Claude Platform Docs

Datei herunterladen

client.Files.Download(ctx, fileID, query) (*Response, error)
GET/v1/files/{file_id}/content

Datei herunterladen

Parameters
fileID string⁠Path parameter

ID of the File.

query FileDownloadParams
WorkspaceID param.Opt[string] OptionalHeader parameter

Optional header to select the Workspace for this request. The value is a Workspace ID (for example, wrkspc_011CZkZaBF1tNoB5wlCeusgy).

Only needed for credentials that can act on more than one Workspace. A credential that belongs to a specific Workspace may omit it; if sent, it must match that Workspace.

Returns
type FileDownloadResponse interface{…}
Datei herunterladen
package main

import (
	"context"
	"fmt"

	"github.com/anthropics/anthropic-sdk-go"
	"github.com/anthropics/anthropic-sdk-go/option"
)

func main() {
	client := anthropic.NewClient(
		option.WithAPIKey("my-anthropic-api-key"),
	)
	response, err := client.Files.Download(
		context.TODO(),
		"file_id",
		anthropic.FileDownloadParams{},
	)
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", response)
}