Skip to content

Fix using anthropic models with responses API in AI SDK#146

Open
aswink wants to merge 2 commits intomainfrom
aswin/03-18-fix_using_anthropic_models_with_responses_api_in_ai_sdk
Open

Fix using anthropic models with responses API in AI SDK#146
aswink wants to merge 2 commits intomainfrom
aswin/03-18-fix_using_anthropic_models_with_responses_api_in_ai_sdk

Conversation

@aswink
Copy link
Contributor

@aswink aswink commented Mar 19, 2026

A customer ran into an issue where AI SDK was failing because it has strict
type checks using a zod format. It expects responses API to always have IDs for
items and an annotations field, even if empty. We were dropping these when
translating between providers. Fix this by restoring the ID if the format
matches, otherwise putting a placeholder in. Also always fill in an empty
annotations.

At some point in the future we should look at adding annotations (openai) and
citations (anthropic's version) to the universal format.

A customer ran into an issue where AI SDK was failing because it has strict
type checks using a zod format. It expects responses API to always have IDs for
items and an annotations field, even if empty. We were dropping these when
translating between providers. Fix this by restoring the ID if the format
matches, otherwise putting a placeholder in. Also always fill in an empty
annotations.

At some point in the future we should look at adding annotations (openai) and
citations (anthropic's version) to the universal format.
Copy link
Contributor Author

aswink commented Mar 19, 2026

This stack of pull requests is managed by Graphite. Learn more about stacking.

@aswink aswink marked this pull request as ready for review March 19, 2026 00:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants