AnthropicDocumentBlockParam - TypeScript SDK

AnthropicDocumentBlockParam type definition

The TypeScript SDK and docs are currently in beta. Report issues on GitHub.

Example Usage

1import { AnthropicDocumentBlockParam } from "@openrouter/sdk/models";
2
3let value: AnthropicDocumentBlockParam = {
4 source: {
5 data: "Hello, world!",
6 mediaType: "text/plain",
7 type: "text",
8 },
9 type: "document",
10};

Fields

FieldTypeRequiredDescriptionExample
cacheControlmodels.AnthropicCacheControlDirectiveEnable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models.{"type": "ephemeral"}
citationsmodels.AnthropicDocumentBlockParamCitationsN/A
contextstringN/A
sourcemodels.AnthropicDocumentBlockParamSourceUnion✔️N/A
titlestringN/A
type”document”✔️N/A