-
Notifications
You must be signed in to change notification settings - Fork 50
Open
Description
Bug
When sending tool/function calls to Cohere models (cohere/command-r-08-2024, cohere/command-r7b-12-2024) via OpenRouter, the request fails with a 422 error:
{
"message": "unknown field: parameter 'strict' is not a valid field. For proper usage, please refer to https://docs.cohere.com/reference/chat"
}Cause
OpenRouter appears to forward the OpenAI-style "strict": true field in tool/function definitions to Cohere's API. Cohere's API does not recognize strict as a valid parameter and rejects the request.
Cohere has its own equivalent (strict_tools), but the strict field on individual tool definitions is OpenAI-specific and should be stripped or translated when routing to Cohere.
Steps to reproduce
- Send a chat completion request to
cohere/command-r-08-2024via OpenRouter - Include
toolswith function definitions that contain"strict": true - Cohere returns 422:
unknown field: parameter 'strict' is not a valid field
Expected behavior
OpenRouter should strip or translate the strict parameter from tool definitions when routing to Cohere models, similar to how other provider-specific parameters are handled.
Environment
- OpenRouter API (via OpenAI-compatible endpoint)
- Models affected:
cohere/command-r-08-2024,cohere/command-r7b-12-2024(likely all Cohere models) - Client: OpenClaw gateway (sends standard OpenAI-format tool definitions)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels