Get File Metadata
BetaFileMetadata beta().files().retrieveMetadata(FileRetrieveMetadataParamsparams = FileRetrieveMetadataParams.none(), RequestOptionsrequestOptions = RequestOptions.none())GET/v1/files/{file_id}
Get File Metadata
Parameters
Returns
Get File Metadata
package com.anthropic.example;
import com.anthropic.client.AnthropicClient;
import com.anthropic.client.okhttp.AnthropicOkHttpClient;
import com.anthropic.models.beta.files.BetaFileMetadata;
import com.anthropic.models.beta.files.FileRetrieveMetadataParams;
public final class Main {
private Main() {}
public static void main(String[] args) {
AnthropicClient client = AnthropicOkHttpClient.fromEnv();
BetaFileMetadata betaFileMetadata = client.beta().files().retrieveMetadata("file_id");
}
}{
"id": "file_011CNha8iCJcU1wXNR6q4V8w",
"created_at": "2025-04-15T18:37:24.100435Z",
"filename": "document.pdf",
"mime_type": "application/pdf",
"size_bytes": 102400,
"type": "file",
"downloadable": false,
"expires_at": "2025-05-15T18:37:24.100435Z",
"scope": {
"id": "id",
"type": "session"
}
}Returns Examples
{
"id": "file_011CNha8iCJcU1wXNR6q4V8w",
"created_at": "2025-04-15T18:37:24.100435Z",
"filename": "document.pdf",
"mime_type": "application/pdf",
"size_bytes": 102400,
"type": "file",
"downloadable": false,
"expires_at": "2025-05-15T18:37:24.100435Z",
"scope": {
"id": "id",
"type": "session"
}
}