> ## Documentation Index
> Fetch the complete documentation index at: https://phaseo.app/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Files

> Use the Java SDK for file upload, metadata, and file-content retrieval.

**Methods**: `Phaseo#uploadFile(...)`, `Phaseo#listFiles(...)`, `Phaseo#retrieveFile(...)`, `Phaseo#retrieveFileContent(...)`

```java theme={null}
import app.phaseo.sdk.Phaseo;
import java.util.HashMap;
import java.util.Map;

Phaseo client = new Phaseo(apiKey, "https://api.phaseo.ai/v1");

Object uploaded = client.uploadFile("""
  {"purpose":"batch","file":"data:application/json;base64,eyJ0ZXN0Ijp0cnVlfQ=="}
  """);

Object file = client.retrieveFile("file_123");
byte[] content = client.retrieveFileContent("file_123");

System.out.println(String.valueOf(file));
System.out.println(new String(content));
```

<Note>
  `listFiles(...)` is wired through the SDK, but `GET /files` currently returns `file_list_not_supported_with_shared_gateway_key`
  on the shared gateway key. Persist uploaded file ids and retrieve them directly instead.
</Note>
