Skip to content

[Bug] Persistent 400 "Invalid Argument" error with claude-opus-4-6-thinking model (with and without thinking budget) #1533

@RocketPower1997

Description

@RocketPower1997

I am encountering a persistent 400 Bad Request error with the message "Request contains an invalid argument" when attempting to use the claude-opus-4-6-thinking model via the API.

This happens specifically when using the Vercel AI SDK (Alma client) which sends a tools array definition in the request body.

To Reproduce

Send a POST request to /v1/chat/completions.

Set model to claude-opus-4-6-thinking (or claude-opus-4-6-thinking(31999)).

Include a tools array in the request body (Schema definitions for Function Calling).

Result: The API immediately returns a 400 error.

Expected behavior
The model should accept the tool definitions or gracefully ignore unsupported schema properties, and proceed with the generation/thinking process.

Logs & Error Details

Attempt 1: Using model claude-opus-4-6-thinking
Initially, I received specific validation errors regarding the propertyNames field in the JSON schema, which suggests the upstream provider (Vertex/Google?) does not support this keyword.

JSON
// Error detail example
"message": "Invalid JSON payload received. Unknown name "propertyNames" at 'request.tools[0]...': Cannot find field."
Attempt 2: Using model claude-opus-4-6-thinking(31999)
After removing the tools that used propertyNames (Notion/Godot plugins) and updating the model name to include the thinking budget as suggested in other threads, the detailed error disappeared, but I am still blocked by a generic Invalid Argument error.

Request Info:

HTTP
POST /v1/chat/completions
Content-Type: application/json
User-Agent: ai-sdk/openai-compatible/2.0.1
Request Body (Snippet):

JSON
{
"model": "claude-opus-4-6-thinking(31999)",
"max_tokens": 128000,
"messages": [...],
"tools": [ ... ] // Large array of tools (Bash, File operations, etc.)
}
Response:

JSON
{
"error": {
"code": 400,
"message": "Request contains an invalid argument.",
"status": "INVALID_ARGUMENT"
}
}
Additional Context

Client: Alma (running on Windows)

SDK: ai-sdk/openai-compatible/2.0.1

The payload size is large (~94KB) due to multiple tool definitions.

I have tried disabling the specific tools that caused the propertyNames error, but the generic 400 error persists with the remaining tools.

Is there a specific restriction on the tools schema for the "thinking" models, or is the proxy failing to map the (31999) parameter correctly when tools are present?

Image

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