Loading...
    • Developer Guide
    • API Reference
    • MCP
    • Resources
    • Release Notes
    Search...
    ⌘K
    Using the API
    Features overviewClient SDKsBeta headersErrors
    Messages
    Create a Message
    Count tokens in a Message
    Models
    List Models
    Get a Model
    Beta
    Upload File
    List Files
    Download File
    Get File Metadata
    Delete File
    Admin
    Completions
    Create a Text Completion
    Support & configuration
    Rate limitsService tiersVersionsIP addressesSupported regionsOpenAI SDK compatibility
    Console
    Log in

    Files

    Upload File
    beta.files.upload(**kwargs) -> FileMetadata { id, created_at, filename, 4 more }
    post/v1/files
    List Files
    beta.files.list(**kwargs) -> Page<FileMetadata { id, created_at, filename, 4 more } >
    get/v1/files
    Download File
    beta.files.download(file_id, **kwargs) -> StringIO
    get/v1/files/{file_id}/content
    Get File Metadata
    beta.files.retrieve_metadata(file_id, **kwargs) -> FileMetadata { id, created_at, filename, 4 more }
    get/v1/files/{file_id}
    Delete File
    beta.files.delete(file_id, **kwargs) -> DeletedFile { id, type }
    delete/v1/files/{file_id}
    ModelsExpand Collapse
    class DeletedFile { id, type }
    id: String

    ID of the deleted file.

    type: :file_deleted

    Deleted object type.

    For file deletion, this is always "file_deleted".

    Accepts one of the following:
    :file_deleted
    class FileMetadata { id, created_at, filename, 4 more }
    id: String

    Unique object identifier.

    The format and length of IDs may change over time.

    created_at: Time

    RFC 3339 datetime string representing when the file was created.

    formatdate-time
    filename: String

    Original filename of the uploaded file.

    maxLength500
    minLength1
    mime_type: String

    MIME type of the file.

    maxLength255
    minLength1
    size_bytes: Integer

    Size of the file in bytes.

    minimum0
    type: :file

    Object type.

    For files, this is always "file".

    Accepts one of the following:
    :file
    downloadable: bool

    Whether the file can be downloaded.

    Solutions

    • AI agents
    • Code modernization
    • Coding
    • Customer support
    • Education
    • Financial services
    • Government
    • Life sciences

    Partners

    • Amazon Bedrock
    • Google Cloud's Vertex AI

    Learn

    • Blog
    • Catalog
    • Courses
    • Use cases
    • Connectors
    • Customer stories
    • Engineering at Anthropic
    • Events
    • Powered by Claude
    • Service partners
    • Startups program

    Company

    • Anthropic
    • Careers
    • Economic Futures
    • Research
    • News
    • Responsible Scaling Policy
    • Security and compliance
    • Transparency

    Learn

    • Blog
    • Catalog
    • Courses
    • Use cases
    • Connectors
    • Customer stories
    • Engineering at Anthropic
    • Events
    • Powered by Claude
    • Service partners
    • Startups program

    Help and security

    • Availability
    • Status
    • Support
    • Discord

    Terms and policies

    • Privacy policy
    • Responsible disclosure policy
    • Terms of service: Commercial
    • Terms of service: Consumer
    • Usage policy