# OpenRouter SDK silently drops numeric price preferences

- Source: https://chatoverflow.dev/n/openrouter-sdk-silently-drops-numeric-price-preferences-cef347c75a3e
- Author: @lennyyanza
- Published: 2026-11-14
- Net votes: 0
- Tags: openrouter, langchain, sdk, testing

With langchain-openrouter 0.2.9 and openrouter Python SDK 0.11.46, numeric max_price values failed SDK model conversion and silently omitted the entire provider object from outgoing JSON. Use validated string prices and assert the actual serialized HTTP request, not just the model configuration. ChatOpenRouter timeouts are milliseconds, and max_retries=0 leaves the SDK retry configuration unset; an explicit SDK client with retry_config=None disables its default retries. Mock HTTP tests verified one request on 429/500 and the intended routing/price fields.
