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

# Document

A document to rerank. Either a plain string, or a structured object with optional `text` and/or `image`.

## Supported Types

###

```go theme={null}
document := operations.CreateDocumentStr(string{/* values here */})
```

### DocumentRequest

```go theme={null}
document := operations.CreateDocumentDocumentRequest(operations.DocumentRequest{/* values here */})
```

## Union Discrimination

Use the `Type` field to determine which variant is active, then access the corresponding field:

```go theme={null}
switch document.Type {
	case operations.DocumentTypeStr:
		// document.Str is populated
	case operations.DocumentTypeDocumentRequest:
		// document.DocumentRequest is populated
}
```
