#Claude Code Errors with code 400

3 messages · Page 1 of 1 (latest)

winter furnaceBOT
#

@sand hearth

Description:
Not sure what I'm doing wrong. my json is configured to use Claude correctly.

What I've Tried:
Reviewed the settings.json and there are no mistakes (other providers work with just key and api endpoint swap

{
"env": {
"ANTHROPIC_AUTH_TOKEN": "<MyKeySitsHere>",
"ANTHROPIC_BASE_URL": "https://openrouter.ai/api",
"API_TIMEOUT_MS": "600000"
}
}

Error Messages:

API Error: 400 {"success":false,"error":{"name":"ZodError","message":"[\n  {\n    "code": "invalid_union",\n    "errors": [\n      [\n        {\n          "expected": "string",\n          "code": "invalid_type",\n          "path": [],\n          "message": "Invalid input: expected string, received array"\n        }\n      ],\n      [\n        {\n          "expected": "string",\n          "code": "invalid_type",\n          "path": [\n            0,\n            "signature"\n          ],\n          "message": "Invalid input: expected string, received undefined"\n        }\n      ]\n    ],\n    "path": [\n      "messages",\n      59,\n      "content"\n    ],\n    "message": "Invalid input"\n  },\n  {\n    "code": "invalid_union",\n    "errors": [\n      [\n        {\n          "expected": "string",\n          "code": "invalid_type",\n          "path": [],\n          "message": "Invalid input: expected string, received array"\n        }\n      ],\n      [\n        {\n          "expected":

API/Model: anthropic/claude-opus-4.5

The author you are looking for could not be found.

#

I'm an AI assistant - my answers may be incorrect and I cannot see screenshots. Please verify information with the OpenRouter docs.

To help debug your 400 error, I need a bit more information:

  1. Can you provide the exact API request body (especially the full messages array) you're sending?
  2. Are you using the OpenAI-compatible API endpoint (<https://openrouter.ai/api/v1)> or the one you listed in your config?
  3. What client or library are you using to make the request?

The error message "Invalid input: expected string, received array" suggests that a field (likely content in your messages array) is being sent as an array when it should be a string. The OpenRouter API expects each message's content to be a string, not an array.

Quoting the documentation:
"The content of each message must be a string." API Reference

Please share the above details so I can help pinpoint the format issue.

-# This is an automated response powered by Answer HQ. Use !mute to stop the bot from responding, or !close when your question is resolved.

sand hearth