Repository: langchain
Issue: max_completion_tokens (and max_tokens) param in ChatOpenAI() can't be processed by OpenAI() object
Labels: 🤖:bug,investigate

### Checked other resources

- [X] I added a very descriptive title to this issue.
- [X] I searched the LangChain documentation with the integrated search.
- [X] I used the GitHub search to find a similar question and didn't find it.
- [X] I am sure that this is a bug in LangChain rather than my code.
- [X] The bug is not resolved by updating to the latest stable version of LangChain (or the specific integration package).

### Example Code

```python
from langchain_openai import ChatOpenAI

chat_model = ChatOpenAI(
    model_name="model",
    max_completion_tokens=800,
    openai_api_base="base_url",
    openai_api_key="your_key"
)

chat_model.invoke("Hello, how are you ?")
```

### Error Message and Stack Trace (if applicable)

```bash
Traceback (most recent call last):
  File "/home/user/test_python/langchain_bug.py", line 12, in <module>
    chat_model.invoke("Hello, how are you ?")
  File "/home/user/.cache/pypoetry/virtualenvs/test-python-OI3Fy4Nv-py3.12/lib/python3.12/site-packages/langchain_core/language_models/chat_models.py", line 289, in invoke
    self.generate_prompt(
  File "/home/user/.cache/pypoetry/virtualenvs/test-python-OI3Fy4Nv-py3.12/lib/python3.12/site-packages/langchain_core/language_models/chat_models.py", line 800, in generate_prompt
    return self.generate(prompt_messages, stop=stop, callbacks=callbacks, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/user/.cache/pypoetry/virtualenvs/test-python-OI3Fy4Nv-py3.12/lib/python3.12/site-packages/langchain_core/language_models/chat_models.py", line 655, in generate
    raise e
  File "/home/user/.cache/pypoetry/virtualenvs/test-python-OI3Fy4Nv-py3.12/lib/python3.12/site-packages/langchain_core/language_models/chat_models.py", line 645, in generate
    self._generate_with_cache(
  File "/home/user/.cache/pypoetry/virtualenvs/test-python-OI3Fy4Nv-py3.12/lib/python3.12/site-packages/langchain_core/language_models/chat_models.py", line 872, in _generate_with_cache
    result = self._generate(
             ^^^^^^^^^^^^^^^
  File "/home/user/.cache/pypoetry/virtualenvs/test-python-OI3Fy4Nv-py3.12/lib/python3.12/site-packages/langchain_openai/chat_models/base.py", line 726, in _generate
    response = self.client.create(**payload)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/user/.cache/pypoetry/virtualenvs/test-python-OI3Fy4Nv-py3.12/lib/python3.12/site-packages/openai/_utils/_utils.py", line 275, in wrapper
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/user/.cache/pypoetry/virtualenvs/test-python-OI3Fy4Nv-py3.12/lib/python3.12/site-packages/openai/resources/chat/completions.py", line 859, in create
    return self._post(
           ^^^^^^^^^^^
  File "/home/user/.cache/pypoetry/virtualenvs/test-python-OI3Fy4Nv-py3.12/lib/python3.12/site-packages/openai/_base_client.py", line 1280, in post
    return cast(ResponseT, self.request(cast_to, opts, stream=stream, stream_cls=stream_cls))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/user/.cache/pypoetry/virtualenvs/test-python-OI3Fy4Nv-py3.12/lib/python3.12/site-packages/openai/_base_client.py", line 957, in request
    return self._request(
           ^^^^^^^^^^^^^^
  File "/home/user/.cache/pypoetry/virtualenvs/test-python-OI3Fy4Nv-py3.12/lib/python3.12/site-packages/openai/_base_client.py", line 1061, in _request
    raise self._make_status_error_from_response(err.response) from None
openai.BadRequestError: Error code: 400 - {'object': 'error', 'message': "[{'type': 'extra_forbidden', 'loc': ('body', 'max_completion_tokens'), 'msg': 'Extra inputs are not permitted', 'input': 800}]", 'type': 'BadRequestError', 'param': None, 'code': 400}
```

### Description

I'm trying to use langchain ChatOpenAI() object with max_completion_tokens parameter initialized. Since September 2024, the max_tokens parameter is deprecated in favor of max_completion_tokens. The change was made in langchain but for now, it has not been done in the OpenAI Python library.

When I pass max_completion_tokens parameter, an error is raised because extra parameter is forbidden when we create OpenAI() object (from the OpenAI Python library).

I know, it's not a bug from the langchain library strictly speaking. But while waiting for the OpenAI library to make the change, is it possible to mitigate the problem? Because, for now, the feature is unavailable.

### System Info

System Information
------------------
> OS:  Linux
> OS Version: #1 SMP Tue Nov 5
> Python Version:  3.12.5
 
Package Information
-------------------
> langchain_core: 0.3.28
> langchain: 0.3.13
> langsmith: 0.2.6
> langchain_bug: Installed. No version info available.
> langchain_openai: 0.2.14
> langchain_text_splitters: 0.3.4
 
Optional packages not installed
-------------------------------
> langserve
 
Other Dependencies
------------------
> aiohttp: 3.11.11
> async-timeout: Installed. No version info available.
> httpx: 0.27.2
> httpx-sse: 0.4.0
> jsonpatch: 1.33
> langsmith-pyo3: Installed. No version info available.
> numpy: 2.2.1
> openai: 1.58.1
> orjson: 3.10.12
> packaging: 24.2
> pydantic: 2.10.4
> PyYAML: 6.0.2
> requests: 2.32.3
> requests-toolbelt: 1.0.0
> SQLAlchemy: 2.0.36
> tenacity: 9.0.0
> tiktoken: 0.8.0
> tokenizers: 0.21.0
> typing-extensions: 4.12.2
> zstandard: Installed. No version info available.