OpenRouter TypeScript SDK - v1.0.6
    Preparing search index...

    Interface ChatMessage

    interface ChatMessage {
        role: ChatRole;
        content: string | ContentPart[];
        name?: string;
        tool_call_id?: string;
        tool_calls?: ToolCall[];
        cache_control?: CacheControl;
    }
    Index

    Properties

    role: ChatRole
    content: string | ContentPart[]
    name?: string
    tool_call_id?: string
    tool_calls?: ToolCall[]
    cache_control?: CacheControl

    Anthropic cache instruction for this message. Marking a message with { type: 'ephemeral' } creates a "cache breakpoint" allowing to cache all prompt content up to this point. Savings: 90% reduction on cached tokens (hit) vs. 10% surcharge (miss).