[GH-ISSUE #138] [Issue]: [BUG] Anthropic API fails with error 400: anthropic-version header is required #36

Closed
opened 2026-10-20 17:24:19 +07:00 by bsakaguchi · 4 comments
Owner

Originally created by @v374q72m93-ai on GitHub (Apr 20, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/138

Summary

Direct connection to Anthropic API fails because the mandatory anthropic-version header is missing in the request.

Expected behavior

The engine should include anthropic-version: 2023-06-01 in the headers when the Anthropic provider is selected.

Actual behavior

API returns error 400: {"type":"error","error":{"type":"invalid_request_error","message":"anthropic-version: header is required"}}

Steps to reproduce

Select Anthropic provider.
Enter a valid Anthropic API key.
Attempt to "Test Connection" or send a message.
Error 400 is returned.

Technical Details

I've investigated the source code and it seems that ProviderDefinition in packages/shared/src/constants/providers.ts does not account for mandatory extra headers like the one Anthropic requires. Manual patching of anthropic.provider.ts and api-client.ts didn't solve the issue, likely because headers are being filtered or reconstructed elsewhere based on the shared provider definitions.

Originally created by @v374q72m93-ai on GitHub (Apr 20, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/138 ## Summary Direct connection to Anthropic API fails because the mandatory anthropic-version header is missing in the request. ## Expected behavior The engine should include anthropic-version: 2023-06-01 in the headers when the Anthropic provider is selected. ## Actual behavior API returns error 400: {"type":"error","error":{"type":"invalid_request_error","message":"anthropic-version: header is required"}} ## Steps to reproduce Select Anthropic provider. Enter a valid Anthropic API key. Attempt to "Test Connection" or send a message. Error 400 is returned. ## Technical Details I've investigated the source code and it seems that ProviderDefinition in packages/shared/src/constants/providers.ts does not account for mandatory extra headers like the one Anthropic requires. Manual patching of anthropic.provider.ts and api-client.ts didn't solve the issue, likely because headers are being filtered or reconstructed elsewhere based on the shared provider definitions.
bsakaguchi 2026-10-20 17:24:19 +07:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@SpicyMarinara commented on GitHub (Apr 20, 2026):

Addressed in v1.5.3.

<!-- gh-comment-id:4283704792 --> @SpicyMarinara commented on GitHub (Apr 20, 2026): Addressed in v1.5.3.
Author
Owner

@v374q72m93-ai commented on GitHub (Apr 21, 2026):

"I've updated to v1.5.3 (official installer), but the error 400 persists.
I've analyzed the request using the Network Tab (F12). In the Request Headers, the anthropic-version is completely missing.
Only standard headers like Content-Type, Accept, and Host are being sent to the local server (127.0.0.1). It seems the client-side or the server-side wrapper is stripping away the mandatory Anthropic header before the final fetch.
Please verify why anthropic-version: 2023-06-01 isn't reaching the API even with the new provider logic."

<!-- gh-comment-id:4286422149 --> @v374q72m93-ai commented on GitHub (Apr 21, 2026): "I've updated to v1.5.3 (official installer), but the error 400 persists. I've analyzed the request using the Network Tab (F12). In the Request Headers, the anthropic-version is completely missing. Only standard headers like Content-Type, Accept, and Host are being sent to the local server (127.0.0.1). It seems the client-side or the server-side wrapper is stripping away the mandatory Anthropic header before the final fetch. Please verify why anthropic-version: 2023-06-01 isn't reaching the API even with the new provider logic."
Author
Owner

@SpicyMarinara commented on GitHub (Apr 21, 2026):

I don't know what you expect me to do. I've been using the Official Claude API for Opus-4.7 tests since it came out, and it works for me. No reports from others either.

<!-- gh-comment-id:4289684489 --> @SpicyMarinara commented on GitHub (Apr 21, 2026): I don't know what you expect me to do. I've been using the Official Claude API for Opus-4.7 tests since it came out, and it works for me. No reports from others either.
Author
Owner

@v374q72m93-ai commented on GitHub (Apr 22, 2026):

Thanks for the reply. I'm a basic user and don't know much about
programming. I was trying to solve a problem I had using Google Gemini. If
you're interested, I created a Word file that shows two screenshots and
Google Gemini's response to them. Anyway, thank you for your project. Good
luck. P.S. Everything works fine for me through OpenRouter.

вт, 21 апр. 2026 г. в 20:16, Spicy Marinara @.***>:

SpicyMarinara left a comment (Pasta-Devs/Marinara-Engine#138)
https://github.com/Pasta-Devs/Marinara-Engine/issues/138#issuecomment-4289684489

I don't know what you expect me to do. I've been using the Official Claude
API for Opus-4.7 tests since it came out, and it works for me. No reports
from others either.

—
Reply to this email directly, view it on GitHub
https://github.com/Pasta-Devs/Marinara-Engine/issues/138?email_source=notifications&email_token=CCG3JAW5VDB46DRVI27BG3D4W6GE3A5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTIMRYHE3DQNBUHA42M4TFMFZW63VGMF2XI2DPOKSWK5TFNZ2KYZTPN52GK4S7MNWGSY3L#issuecomment-4289684489,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/CCG3JASXPT3HFR4Y2SSCEOD4W6GE3AVCNFSM6AAAAACX7NWKR6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHM2DEOBZGY4DINBYHE
.
You are receiving this because you authored the thread.Message ID:
@.***>

<!-- gh-comment-id:4294152980 --> @v374q72m93-ai commented on GitHub (Apr 22, 2026): Thanks for the reply. I'm a basic user and don't know much about programming. I was trying to solve a problem I had using Google Gemini. If you're interested, I created a Word file that shows two screenshots and Google Gemini's response to them. Anyway, thank you for your project. Good luck. P.S. Everything works fine for me through OpenRouter. вт, 21 апр. 2026 г. в 20:16, Spicy Marinara ***@***.***>: > *SpicyMarinara* left a comment (Pasta-Devs/Marinara-Engine#138) > <https://github.com/Pasta-Devs/Marinara-Engine/issues/138#issuecomment-4289684489> > > I don't know what you expect me to do. I've been using the Official Claude > API for Opus-4.7 tests since it came out, and it works for me. No reports > from others either. > > — > Reply to this email directly, view it on GitHub > <https://github.com/Pasta-Devs/Marinara-Engine/issues/138?email_source=notifications&email_token=CCG3JAW5VDB46DRVI27BG3D4W6GE3A5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTIMRYHE3DQNBUHA42M4TFMFZW63VGMF2XI2DPOKSWK5TFNZ2KYZTPN52GK4S7MNWGSY3L#issuecomment-4289684489>, > or unsubscribe > <https://github.com/notifications/unsubscribe-auth/CCG3JASXPT3HFR4Y2SSCEOD4W6GE3AVCNFSM6AAAAACX7NWKR6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHM2DEOBZGY4DINBYHE> > . > You are receiving this because you authored the thread.Message ID: > ***@***.***> >
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#36
No description provided.