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

# Files

> Use the Go SDK for file metadata and file-content retrieval.

**Methods**: `client.ListFiles()`, `client.RetrieveFile()`, `client.RetrieveFileContent()`.

```go theme={null}
import (
  "fmt"
  "context"
  aistats "github.com/AI-Stats/AI-Stats/packages/sdk/sdk-go"
)

client := aistats.New(apiKey, "https://api.phaseo.app/v1")

file, err := client.RetrieveFile(context.Background(), "file_123")
if err != nil {
  panic(err)
}

content, err := client.RetrieveFileContent(context.Background(), "file_123")
if err != nil {
  panic(err)
}

fmt.Println(file)
fmt.Println(string(content))
```

<Note>
  `ListFiles()` is available in the wrapper, but `GET /files` currently returns `file_list_not_supported_with_shared_gateway_key`
  when you use the shared gateway key. Persist uploaded file ids and retrieve them directly instead.
</Note>

<Note>
  The Go wrapper still does not provide a first-class multipart upload helper for `POST /files`. Use direct REST or the generated
  client if you need to experiment with upload wiring.
</Note>
