Get File Metadata
client.Beta.Files.GetMetadata(ctx, fileID, query) (*FileMetadata, error)
/v1/files/{file_id}?beta=true
Get File Metadata
Parameters
fileID string
ID of the File.
Returns
Get File Metadata
Go
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"),
)
fileMetadata, err := client.Beta.Files.GetMetadata(
context.TODO(),
"file_id",
anthropic.BetaFileGetMetadataParams{
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", fileMetadata.ID)
}
{
"id": "id",
"created_at": "2019-12-27T18:11:19.117Z",
"filename": "x",
"mime_type": "x",
"size_bytes": 0,
"type": "file",
"downloadable": true
}Returns Examples
{
"id": "id",
"created_at": "2019-12-27T18:11:19.117Z",
"filename": "x",
"mime_type": "x",
"size_bytes": 0,
"type": "file",
"downloadable": true
}