Skip to content

1 hour prompt caching problem #196

@FaresMakki

Description

@FaresMakki

hi sorry for bothering,does anyone know if ai sdk support anthropic 1 hour prompt caching via openrouter , i tried what the docs says

messages: [
{role: 'system', content: 'You are a podcast summary assistant. You are detail-oriented and critical about the content.',},
{ role: 'user', content: [{type: 'text', text: 'Given the text body below:'},
{ type: 'text', text: ,
providerOptions: {
openrouter: { cacheControl: { type: 'ephemeral' ,ttl:"1h"}, }, }, },
{ type: 'text', text: 'List the speakers?',},],},],

it works, but the cache write cost 1.25×input not 2×input i thinks this mean that this the 5min cache not the 1hour cache

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions