# Middleware

> langchain_openai → Middleware

!!! note "Reference docs"

    This page contains **reference documentation** for OpenAI Middleware. See [the docs](https://docs.langchain.com/oss/python/langchain/middleware/built-in#openai) for conceptual guides, tutorials, and examples on using OpenAI Middleware.

Provider-specific middleware for OpenAI models:

| CLASS                                                                                   | DESCRIPTION                                               |
| --------------------------------------------------------------------------------------- | --------------------------------------------------------- |
| [`OpenAIModerationMiddleware`](#langchain_openai.middleware.OpenAIModerationMiddleware) | Moderate agent traffic using OpenAI's moderation endpoint |

<!-- TODO: `ignore_init_summary` doesn't seem to work.  -->

<!-- `"^__init__$"` used to exclude everything other than `__init__` -->

## Classes

- [`OpenAIEmbeddings`](https://reference.langchain.com/python/langchain-openai/embeddings/base/OpenAIEmbeddings)
- [`AzureOpenAIEmbeddings`](https://reference.langchain.com/python/langchain-openai/embeddings/azure/AzureOpenAIEmbeddings)
- [`OpenAIModerationError`](https://reference.langchain.com/python/langchain-openai/middleware/openai_moderation/OpenAIModerationError)
- [`OpenAIModerationMiddleware`](https://reference.langchain.com/python/langchain-openai/middleware/openai_moderation/OpenAIModerationMiddleware)
- [`BaseOpenAI`](https://reference.langchain.com/python/langchain-openai/llms/base/BaseOpenAI)
- [`OpenAI`](https://reference.langchain.com/python/langchain-openai/llms/base/OpenAI)
- [`AzureOpenAI`](https://reference.langchain.com/python/langchain-openai/llms/azure/AzureOpenAI)
- [`OpenAIContextOverflowError`](https://reference.langchain.com/python/langchain-openai/chat_models/base/OpenAIContextOverflowError)
- [`OpenAIAPIContextOverflowError`](https://reference.langchain.com/python/langchain-openai/chat_models/base/OpenAIAPIContextOverflowError)
- [`BaseChatOpenAI`](https://reference.langchain.com/python/langchain-openai/chat_models/base/BaseChatOpenAI)
- [`ChatOpenAI`](https://reference.langchain.com/python/langchain-openai/chat_models/base/ChatOpenAI)
- [`OpenAIRefusalError`](https://reference.langchain.com/python/langchain-openai/chat_models/base/OpenAIRefusalError)
- [`StreamChunkTimeoutError`](https://reference.langchain.com/python/langchain-openai/chat_models/_client_utils/StreamChunkTimeoutError)
- [`AzureChatOpenAI`](https://reference.langchain.com/python/langchain-openai/chat_models/azure/AzureChatOpenAI)

## Functions

- [`decode_jwt_claims()`](https://reference.langchain.com/python/langchain-openai/chatgpt_oauth/decode_jwt_claims)
- [`login_chatgpt()`](https://reference.langchain.com/python/langchain-openai/chatgpt_oauth/login_chatgpt)
- [`login_chatgpt_device()`](https://reference.langchain.com/python/langchain-openai/chatgpt_oauth/login_chatgpt_device)
- [`custom_tool()`](https://reference.langchain.com/python/langchain-openai/tools/custom_tool/custom_tool)

## Modules

- [`langchain_openai`](https://reference.langchain.com/python/langchain-openai/langchain_openai)
- [`chatgpt_oauth`](https://reference.langchain.com/python/langchain-openai/chatgpt_oauth)
- [`embeddings`](https://reference.langchain.com/python/langchain-openai/embeddings)
- [`base`](https://reference.langchain.com/python/langchain-openai/embeddings/base)
- [`azure`](https://reference.langchain.com/python/langchain-openai/embeddings/azure)
- [`tools`](https://reference.langchain.com/python/langchain-openai/tools)
- [`custom_tool`](https://reference.langchain.com/python/langchain-openai/tools/custom_tool)
- [`middleware`](https://reference.langchain.com/python/langchain-openai/middleware)
- [`openai_moderation`](https://reference.langchain.com/python/langchain-openai/middleware/openai_moderation)
- [`llms`](https://reference.langchain.com/python/langchain-openai/llms)
- [`base`](https://reference.langchain.com/python/langchain-openai/llms/base)
- [`azure`](https://reference.langchain.com/python/langchain-openai/llms/azure)
- [`data`](https://reference.langchain.com/python/langchain-openai/data)
- [`chat_models`](https://reference.langchain.com/python/langchain-openai/chat_models)
- [`base`](https://reference.langchain.com/python/langchain-openai/chat_models/base)
- [`codex`](https://reference.langchain.com/python/langchain-openai/chat_models/codex)
- [`azure`](https://reference.langchain.com/python/langchain-openai/chat_models/azure)
- [`output_parsers`](https://reference.langchain.com/python/langchain-openai/output_parsers)
- [`tools`](https://reference.langchain.com/python/langchain-openai/output_parsers/tools)

## Constants

- [`logger`](https://reference.langchain.com/python/langchain-openai/chatgpt_oauth/logger)
- [`CHATGPT_CLIENT_ID`](https://reference.langchain.com/python/langchain-openai/chatgpt_oauth/CHATGPT_CLIENT_ID)
- [`CHATGPT_AUTHORIZE_URL`](https://reference.langchain.com/python/langchain-openai/chatgpt_oauth/CHATGPT_AUTHORIZE_URL)
- [`CHATGPT_TOKEN_URL`](https://reference.langchain.com/python/langchain-openai/chatgpt_oauth/CHATGPT_TOKEN_URL)
- [`CHATGPT_DEVICE_CODE_URL`](https://reference.langchain.com/python/langchain-openai/chatgpt_oauth/CHATGPT_DEVICE_CODE_URL)
- [`CHATGPT_DEVICE_TOKEN_URL`](https://reference.langchain.com/python/langchain-openai/chatgpt_oauth/CHATGPT_DEVICE_TOKEN_URL)
- [`CHATGPT_DEVICE_REDIRECT_URI`](https://reference.langchain.com/python/langchain-openai/chatgpt_oauth/CHATGPT_DEVICE_REDIRECT_URI)
- [`CHATGPT_AUTH_CLAIMS_NAMESPACE`](https://reference.langchain.com/python/langchain-openai/chatgpt_oauth/CHATGPT_AUTH_CLAIMS_NAMESPACE)
- [`DEFAULT_REDIRECT_HOST`](https://reference.langchain.com/python/langchain-openai/chatgpt_oauth/DEFAULT_REDIRECT_HOST)
- [`DEFAULT_REDIRECT_PORT`](https://reference.langchain.com/python/langchain-openai/chatgpt_oauth/DEFAULT_REDIRECT_PORT)
- [`DEFAULT_REDIRECT_PATH`](https://reference.langchain.com/python/langchain-openai/chatgpt_oauth/DEFAULT_REDIRECT_PATH)
- [`DEFAULT_SCOPE`](https://reference.langchain.com/python/langchain-openai/chatgpt_oauth/DEFAULT_SCOPE)
- [`DEFAULT_REFRESH_SKEW`](https://reference.langchain.com/python/langchain-openai/chatgpt_oauth/DEFAULT_REFRESH_SKEW)
- [`DEFAULT_STORE_PATH`](https://reference.langchain.com/python/langchain-openai/chatgpt_oauth/DEFAULT_STORE_PATH)
- [`access_token`](https://reference.langchain.com/python/langchain-openai/chatgpt_oauth/_ChatGPTToken/access_token)
- [`refresh_token`](https://reference.langchain.com/python/langchain-openai/chatgpt_oauth/_ChatGPTToken/refresh_token)
- [`expires_at`](https://reference.langchain.com/python/langchain-openai/chatgpt_oauth/_ChatGPTToken/expires_at)
- [`account_id`](https://reference.langchain.com/python/langchain-openai/chatgpt_oauth/_ChatGPTToken/account_id)
- [`plan_type`](https://reference.langchain.com/python/langchain-openai/chatgpt_oauth/_ChatGPTToken/plan_type)
- [`user_id`](https://reference.langchain.com/python/langchain-openai/chatgpt_oauth/_ChatGPTToken/user_id)
- [`id_token`](https://reference.langchain.com/python/langchain-openai/chatgpt_oauth/_ChatGPTToken/id_token)
- [`path`](https://reference.langchain.com/python/langchain-openai/chatgpt_oauth/_FileChatGPTOAuthTokenProvider/path)
- [`client_id`](https://reference.langchain.com/python/langchain-openai/chatgpt_oauth/_FileChatGPTOAuthTokenProvider/client_id)
- [`token_url`](https://reference.langchain.com/python/langchain-openai/chatgpt_oauth/_FileChatGPTOAuthTokenProvider/token_url)
- [`refresh_skew`](https://reference.langchain.com/python/langchain-openai/chatgpt_oauth/_FileChatGPTOAuthTokenProvider/refresh_skew)
- [`timeout`](https://reference.langchain.com/python/langchain-openai/chatgpt_oauth/_FileChatGPTOAuthTokenProvider/timeout)
- [`server_result`](https://reference.langchain.com/python/langchain-openai/chatgpt_oauth/_CallbackHandler/server_result)
- [`callback_path`](https://reference.langchain.com/python/langchain-openai/chatgpt_oauth/_CallbackHandler/callback_path)
- [`logger`](https://reference.langchain.com/python/langchain-openai/embeddings/base/logger)
- [`MAX_TOKENS_PER_REQUEST`](https://reference.langchain.com/python/langchain-openai/embeddings/base/MAX_TOKENS_PER_REQUEST)
- [`client`](https://reference.langchain.com/python/langchain-openai/embeddings/base/OpenAIEmbeddings/client)
- [`async_client`](https://reference.langchain.com/python/langchain-openai/embeddings/base/OpenAIEmbeddings/async_client)
- [`model`](https://reference.langchain.com/python/langchain-openai/embeddings/base/OpenAIEmbeddings/model)
- [`dimensions`](https://reference.langchain.com/python/langchain-openai/embeddings/base/OpenAIEmbeddings/dimensions)
- [`deployment`](https://reference.langchain.com/python/langchain-openai/embeddings/base/OpenAIEmbeddings/deployment)
- [`openai_api_version`](https://reference.langchain.com/python/langchain-openai/embeddings/base/OpenAIEmbeddings/openai_api_version)
- [`openai_api_base`](https://reference.langchain.com/python/langchain-openai/embeddings/base/OpenAIEmbeddings/openai_api_base)
- [`openai_api_type`](https://reference.langchain.com/python/langchain-openai/embeddings/base/OpenAIEmbeddings/openai_api_type)
- [`openai_proxy`](https://reference.langchain.com/python/langchain-openai/embeddings/base/OpenAIEmbeddings/openai_proxy)
- [`embedding_ctx_length`](https://reference.langchain.com/python/langchain-openai/embeddings/base/OpenAIEmbeddings/embedding_ctx_length)
- [`openai_api_key`](https://reference.langchain.com/python/langchain-openai/embeddings/base/OpenAIEmbeddings/openai_api_key)
- [`openai_organization`](https://reference.langchain.com/python/langchain-openai/embeddings/base/OpenAIEmbeddings/openai_organization)
- [`allowed_special`](https://reference.langchain.com/python/langchain-openai/embeddings/base/OpenAIEmbeddings/allowed_special)
- [`disallowed_special`](https://reference.langchain.com/python/langchain-openai/embeddings/base/OpenAIEmbeddings/disallowed_special)
- [`chunk_size`](https://reference.langchain.com/python/langchain-openai/embeddings/base/OpenAIEmbeddings/chunk_size)
- [`max_retries`](https://reference.langchain.com/python/langchain-openai/embeddings/base/OpenAIEmbeddings/max_retries)
- [`request_timeout`](https://reference.langchain.com/python/langchain-openai/embeddings/base/OpenAIEmbeddings/request_timeout)
- [`headers`](https://reference.langchain.com/python/langchain-openai/embeddings/base/OpenAIEmbeddings/headers)
- [`tiktoken_enabled`](https://reference.langchain.com/python/langchain-openai/embeddings/base/OpenAIEmbeddings/tiktoken_enabled)
- [`tiktoken_model_name`](https://reference.langchain.com/python/langchain-openai/embeddings/base/OpenAIEmbeddings/tiktoken_model_name)
- [`show_progress_bar`](https://reference.langchain.com/python/langchain-openai/embeddings/base/OpenAIEmbeddings/show_progress_bar)
- [`model_kwargs`](https://reference.langchain.com/python/langchain-openai/embeddings/base/OpenAIEmbeddings/model_kwargs)
- [`skip_empty`](https://reference.langchain.com/python/langchain-openai/embeddings/base/OpenAIEmbeddings/skip_empty)
- [`default_headers`](https://reference.langchain.com/python/langchain-openai/embeddings/base/OpenAIEmbeddings/default_headers)
- [`default_query`](https://reference.langchain.com/python/langchain-openai/embeddings/base/OpenAIEmbeddings/default_query)
- [`retry_min_seconds`](https://reference.langchain.com/python/langchain-openai/embeddings/base/OpenAIEmbeddings/retry_min_seconds)
- [`retry_max_seconds`](https://reference.langchain.com/python/langchain-openai/embeddings/base/OpenAIEmbeddings/retry_max_seconds)
- [`http_client`](https://reference.langchain.com/python/langchain-openai/embeddings/base/OpenAIEmbeddings/http_client)
- [`http_async_client`](https://reference.langchain.com/python/langchain-openai/embeddings/base/OpenAIEmbeddings/http_async_client)
- [`check_embedding_ctx_length`](https://reference.langchain.com/python/langchain-openai/embeddings/base/OpenAIEmbeddings/check_embedding_ctx_length)
- [`model_config`](https://reference.langchain.com/python/langchain-openai/embeddings/base/OpenAIEmbeddings/model_config)
- [`azure_endpoint`](https://reference.langchain.com/python/langchain-openai/embeddings/azure/AzureOpenAIEmbeddings/azure_endpoint)
- [`deployment`](https://reference.langchain.com/python/langchain-openai/embeddings/azure/AzureOpenAIEmbeddings/deployment)
- [`openai_api_key`](https://reference.langchain.com/python/langchain-openai/embeddings/azure/AzureOpenAIEmbeddings/openai_api_key)
- [`openai_api_version`](https://reference.langchain.com/python/langchain-openai/embeddings/azure/AzureOpenAIEmbeddings/openai_api_version)
- [`azure_ad_token`](https://reference.langchain.com/python/langchain-openai/embeddings/azure/AzureOpenAIEmbeddings/azure_ad_token)
- [`azure_ad_token_provider`](https://reference.langchain.com/python/langchain-openai/embeddings/azure/AzureOpenAIEmbeddings/azure_ad_token_provider)
- [`azure_ad_async_token_provider`](https://reference.langchain.com/python/langchain-openai/embeddings/azure/AzureOpenAIEmbeddings/azure_ad_async_token_provider)
- [`openai_api_type`](https://reference.langchain.com/python/langchain-openai/embeddings/azure/AzureOpenAIEmbeddings/openai_api_type)
- [`validate_base_url`](https://reference.langchain.com/python/langchain-openai/embeddings/azure/AzureOpenAIEmbeddings/validate_base_url)
- [`chunk_size`](https://reference.langchain.com/python/langchain-openai/embeddings/azure/AzureOpenAIEmbeddings/chunk_size)
- [`ViolationStage`](https://reference.langchain.com/python/langchain-openai/middleware/openai_moderation/ViolationStage)
- [`DEFAULT_VIOLATION_TEMPLATE`](https://reference.langchain.com/python/langchain-openai/middleware/openai_moderation/DEFAULT_VIOLATION_TEMPLATE)
- [`content`](https://reference.langchain.com/python/langchain-openai/middleware/openai_moderation/OpenAIModerationError/content)
- [`stage`](https://reference.langchain.com/python/langchain-openai/middleware/openai_moderation/OpenAIModerationError/stage)
- [`result`](https://reference.langchain.com/python/langchain-openai/middleware/openai_moderation/OpenAIModerationError/result)
- [`model`](https://reference.langchain.com/python/langchain-openai/middleware/openai_moderation/OpenAIModerationMiddleware/model)
- [`check_input`](https://reference.langchain.com/python/langchain-openai/middleware/openai_moderation/OpenAIModerationMiddleware/check_input)
- [`check_output`](https://reference.langchain.com/python/langchain-openai/middleware/openai_moderation/OpenAIModerationMiddleware/check_output)
- [`check_tool_results`](https://reference.langchain.com/python/langchain-openai/middleware/openai_moderation/OpenAIModerationMiddleware/check_tool_results)
- [`exit_behavior`](https://reference.langchain.com/python/langchain-openai/middleware/openai_moderation/OpenAIModerationMiddleware/exit_behavior)
- [`violation_message`](https://reference.langchain.com/python/langchain-openai/middleware/openai_moderation/OpenAIModerationMiddleware/violation_message)
- [`logger`](https://reference.langchain.com/python/langchain-openai/llms/base/logger)
- [`client`](https://reference.langchain.com/python/langchain-openai/llms/base/BaseOpenAI/client)
- [`async_client`](https://reference.langchain.com/python/langchain-openai/llms/base/BaseOpenAI/async_client)
- [`model_name`](https://reference.langchain.com/python/langchain-openai/llms/base/BaseOpenAI/model_name)
- [`temperature`](https://reference.langchain.com/python/langchain-openai/llms/base/BaseOpenAI/temperature)
- [`max_tokens`](https://reference.langchain.com/python/langchain-openai/llms/base/BaseOpenAI/max_tokens)
- [`top_p`](https://reference.langchain.com/python/langchain-openai/llms/base/BaseOpenAI/top_p)
- [`frequency_penalty`](https://reference.langchain.com/python/langchain-openai/llms/base/BaseOpenAI/frequency_penalty)
- [`presence_penalty`](https://reference.langchain.com/python/langchain-openai/llms/base/BaseOpenAI/presence_penalty)
- [`n`](https://reference.langchain.com/python/langchain-openai/llms/base/BaseOpenAI/n)
- [`best_of`](https://reference.langchain.com/python/langchain-openai/llms/base/BaseOpenAI/best_of)
- [`model_kwargs`](https://reference.langchain.com/python/langchain-openai/llms/base/BaseOpenAI/model_kwargs)
- [`openai_api_key`](https://reference.langchain.com/python/langchain-openai/llms/base/BaseOpenAI/openai_api_key)
- [`openai_api_base`](https://reference.langchain.com/python/langchain-openai/llms/base/BaseOpenAI/openai_api_base)
- [`openai_organization`](https://reference.langchain.com/python/langchain-openai/llms/base/BaseOpenAI/openai_organization)
- [`openai_proxy`](https://reference.langchain.com/python/langchain-openai/llms/base/BaseOpenAI/openai_proxy)
- [`batch_size`](https://reference.langchain.com/python/langchain-openai/llms/base/BaseOpenAI/batch_size)
- [`request_timeout`](https://reference.langchain.com/python/langchain-openai/llms/base/BaseOpenAI/request_timeout)
- [`logit_bias`](https://reference.langchain.com/python/langchain-openai/llms/base/BaseOpenAI/logit_bias)
- [`max_retries`](https://reference.langchain.com/python/langchain-openai/llms/base/BaseOpenAI/max_retries)
- [`seed`](https://reference.langchain.com/python/langchain-openai/llms/base/BaseOpenAI/seed)
- [`logprobs`](https://reference.langchain.com/python/langchain-openai/llms/base/BaseOpenAI/logprobs)
- [`streaming`](https://reference.langchain.com/python/langchain-openai/llms/base/BaseOpenAI/streaming)
- [`allowed_special`](https://reference.langchain.com/python/langchain-openai/llms/base/BaseOpenAI/allowed_special)
- [`disallowed_special`](https://reference.langchain.com/python/langchain-openai/llms/base/BaseOpenAI/disallowed_special)
- [`tiktoken_model_name`](https://reference.langchain.com/python/langchain-openai/llms/base/BaseOpenAI/tiktoken_model_name)
- [`default_headers`](https://reference.langchain.com/python/langchain-openai/llms/base/BaseOpenAI/default_headers)
- [`default_query`](https://reference.langchain.com/python/langchain-openai/llms/base/BaseOpenAI/default_query)
- [`http_client`](https://reference.langchain.com/python/langchain-openai/llms/base/BaseOpenAI/http_client)
- [`http_async_client`](https://reference.langchain.com/python/langchain-openai/llms/base/BaseOpenAI/http_async_client)
- [`extra_body`](https://reference.langchain.com/python/langchain-openai/llms/base/BaseOpenAI/extra_body)
- [`model_config`](https://reference.langchain.com/python/langchain-openai/llms/base/BaseOpenAI/model_config)
- [`max_context_size`](https://reference.langchain.com/python/langchain-openai/llms/base/BaseOpenAI/max_context_size)
- [`lc_secrets`](https://reference.langchain.com/python/langchain-openai/llms/base/OpenAI/lc_secrets)
- [`lc_attributes`](https://reference.langchain.com/python/langchain-openai/llms/base/OpenAI/lc_attributes)
- [`logger`](https://reference.langchain.com/python/langchain-openai/llms/azure/logger)
- [`azure_endpoint`](https://reference.langchain.com/python/langchain-openai/llms/azure/AzureOpenAI/azure_endpoint)
- [`deployment_name`](https://reference.langchain.com/python/langchain-openai/llms/azure/AzureOpenAI/deployment_name)
- [`openai_api_version`](https://reference.langchain.com/python/langchain-openai/llms/azure/AzureOpenAI/openai_api_version)
- [`openai_api_key`](https://reference.langchain.com/python/langchain-openai/llms/azure/AzureOpenAI/openai_api_key)
- [`azure_ad_token`](https://reference.langchain.com/python/langchain-openai/llms/azure/AzureOpenAI/azure_ad_token)
- [`azure_ad_token_provider`](https://reference.langchain.com/python/langchain-openai/llms/azure/AzureOpenAI/azure_ad_token_provider)
- [`azure_ad_async_token_provider`](https://reference.langchain.com/python/langchain-openai/llms/azure/AzureOpenAI/azure_ad_async_token_provider)
- [`openai_api_type`](https://reference.langchain.com/python/langchain-openai/llms/azure/AzureOpenAI/openai_api_type)
- [`validate_base_url`](https://reference.langchain.com/python/langchain-openai/llms/azure/AzureOpenAI/validate_base_url)
- [`lc_secrets`](https://reference.langchain.com/python/langchain-openai/llms/azure/AzureOpenAI/lc_secrets)
- [`lc_attributes`](https://reference.langchain.com/python/langchain-openai/llms/azure/AzureOpenAI/lc_attributes)
- [`logger`](https://reference.langchain.com/python/langchain-openai/chat_models/base/logger)
- [`global_ssl_context`](https://reference.langchain.com/python/langchain-openai/chat_models/base/global_ssl_context)
- [`WellKnownTools`](https://reference.langchain.com/python/langchain-openai/chat_models/base/WellKnownTools)
- [`client`](https://reference.langchain.com/python/langchain-openai/chat_models/base/BaseChatOpenAI/client)
- [`async_client`](https://reference.langchain.com/python/langchain-openai/chat_models/base/BaseChatOpenAI/async_client)
- [`root_client`](https://reference.langchain.com/python/langchain-openai/chat_models/base/BaseChatOpenAI/root_client)
- [`root_async_client`](https://reference.langchain.com/python/langchain-openai/chat_models/base/BaseChatOpenAI/root_async_client)
- [`model_name`](https://reference.langchain.com/python/langchain-openai/chat_models/base/BaseChatOpenAI/model_name)
- [`temperature`](https://reference.langchain.com/python/langchain-openai/chat_models/base/BaseChatOpenAI/temperature)
- [`model_kwargs`](https://reference.langchain.com/python/langchain-openai/chat_models/base/BaseChatOpenAI/model_kwargs)
- [`openai_api_key`](https://reference.langchain.com/python/langchain-openai/chat_models/base/BaseChatOpenAI/openai_api_key)
- [`openai_api_base`](https://reference.langchain.com/python/langchain-openai/chat_models/base/BaseChatOpenAI/openai_api_base)
- [`openai_organization`](https://reference.langchain.com/python/langchain-openai/chat_models/base/BaseChatOpenAI/openai_organization)
- [`openai_proxy`](https://reference.langchain.com/python/langchain-openai/chat_models/base/BaseChatOpenAI/openai_proxy)
- [`request_timeout`](https://reference.langchain.com/python/langchain-openai/chat_models/base/BaseChatOpenAI/request_timeout)
- [`stream_usage`](https://reference.langchain.com/python/langchain-openai/chat_models/base/BaseChatOpenAI/stream_usage)
- [`max_retries`](https://reference.langchain.com/python/langchain-openai/chat_models/base/BaseChatOpenAI/max_retries)
- [`presence_penalty`](https://reference.langchain.com/python/langchain-openai/chat_models/base/BaseChatOpenAI/presence_penalty)
- [`frequency_penalty`](https://reference.langchain.com/python/langchain-openai/chat_models/base/BaseChatOpenAI/frequency_penalty)
- [`seed`](https://reference.langchain.com/python/langchain-openai/chat_models/base/BaseChatOpenAI/seed)
- [`logprobs`](https://reference.langchain.com/python/langchain-openai/chat_models/base/BaseChatOpenAI/logprobs)
- [`top_logprobs`](https://reference.langchain.com/python/langchain-openai/chat_models/base/BaseChatOpenAI/top_logprobs)
- [`logit_bias`](https://reference.langchain.com/python/langchain-openai/chat_models/base/BaseChatOpenAI/logit_bias)
- [`streaming`](https://reference.langchain.com/python/langchain-openai/chat_models/base/BaseChatOpenAI/streaming)
- [`n`](https://reference.langchain.com/python/langchain-openai/chat_models/base/BaseChatOpenAI/n)
- [`top_p`](https://reference.langchain.com/python/langchain-openai/chat_models/base/BaseChatOpenAI/top_p)
- [`max_tokens`](https://reference.langchain.com/python/langchain-openai/chat_models/base/BaseChatOpenAI/max_tokens)
- [`reasoning_effort`](https://reference.langchain.com/python/langchain-openai/chat_models/base/BaseChatOpenAI/reasoning_effort)
- [`reasoning`](https://reference.langchain.com/python/langchain-openai/chat_models/base/BaseChatOpenAI/reasoning)
- [`verbosity`](https://reference.langchain.com/python/langchain-openai/chat_models/base/BaseChatOpenAI/verbosity)
- [`tiktoken_model_name`](https://reference.langchain.com/python/langchain-openai/chat_models/base/BaseChatOpenAI/tiktoken_model_name)
- [`default_headers`](https://reference.langchain.com/python/langchain-openai/chat_models/base/BaseChatOpenAI/default_headers)
- [`default_query`](https://reference.langchain.com/python/langchain-openai/chat_models/base/BaseChatOpenAI/default_query)
- [`http_client`](https://reference.langchain.com/python/langchain-openai/chat_models/base/BaseChatOpenAI/http_client)
- [`http_async_client`](https://reference.langchain.com/python/langchain-openai/chat_models/base/BaseChatOpenAI/http_async_client)
- [`http_socket_options`](https://reference.langchain.com/python/langchain-openai/chat_models/base/BaseChatOpenAI/http_socket_options)
- [`stream_chunk_timeout`](https://reference.langchain.com/python/langchain-openai/chat_models/base/BaseChatOpenAI/stream_chunk_timeout)
- [`stop`](https://reference.langchain.com/python/langchain-openai/chat_models/base/BaseChatOpenAI/stop)
- [`extra_body`](https://reference.langchain.com/python/langchain-openai/chat_models/base/BaseChatOpenAI/extra_body)
- [`include_response_headers`](https://reference.langchain.com/python/langchain-openai/chat_models/base/BaseChatOpenAI/include_response_headers)
- [`disabled_params`](https://reference.langchain.com/python/langchain-openai/chat_models/base/BaseChatOpenAI/disabled_params)
- [`context_management`](https://reference.langchain.com/python/langchain-openai/chat_models/base/BaseChatOpenAI/context_management)
- [`include`](https://reference.langchain.com/python/langchain-openai/chat_models/base/BaseChatOpenAI/include)
- [`prompt_cache_options`](https://reference.langchain.com/python/langchain-openai/chat_models/base/BaseChatOpenAI/prompt_cache_options)
- [`service_tier`](https://reference.langchain.com/python/langchain-openai/chat_models/base/BaseChatOpenAI/service_tier)
- [`store`](https://reference.langchain.com/python/langchain-openai/chat_models/base/BaseChatOpenAI/store)
- [`truncation`](https://reference.langchain.com/python/langchain-openai/chat_models/base/BaseChatOpenAI/truncation)
- [`use_previous_response_id`](https://reference.langchain.com/python/langchain-openai/chat_models/base/BaseChatOpenAI/use_previous_response_id)
- [`use_responses_api`](https://reference.langchain.com/python/langchain-openai/chat_models/base/BaseChatOpenAI/use_responses_api)
- [`output_version`](https://reference.langchain.com/python/langchain-openai/chat_models/base/BaseChatOpenAI/output_version)
- [`model_config`](https://reference.langchain.com/python/langchain-openai/chat_models/base/BaseChatOpenAI/model_config)
- [`model`](https://reference.langchain.com/python/langchain-openai/chat_models/base/BaseChatOpenAI/model)
- [`max_tokens`](https://reference.langchain.com/python/langchain-openai/chat_models/base/ChatOpenAI/max_tokens)
- [`lc_secrets`](https://reference.langchain.com/python/langchain-openai/chat_models/base/ChatOpenAI/lc_secrets)
- [`lc_attributes`](https://reference.langchain.com/python/langchain-openai/chat_models/base/ChatOpenAI/lc_attributes)
- [`logger`](https://reference.langchain.com/python/langchain-openai/chat_models/codex/logger)
- [`CHATGPT_CODEX_BASE_URL`](https://reference.langchain.com/python/langchain-openai/chat_models/codex/CHATGPT_CODEX_BASE_URL)
- [`ORIGINATOR_HEADER`](https://reference.langchain.com/python/langchain-openai/chat_models/codex/ORIGINATOR_HEADER)
- [`ORIGINATOR_VALUE`](https://reference.langchain.com/python/langchain-openai/chat_models/codex/ORIGINATOR_VALUE)
- [`ORIGINATOR_ENV_VAR`](https://reference.langchain.com/python/langchain-openai/chat_models/codex/ORIGINATOR_ENV_VAR)
- [`ACCOUNT_ID_HEADER`](https://reference.langchain.com/python/langchain-openai/chat_models/codex/ACCOUNT_ID_HEADER)
- [`EXPERIMENTAL_UNOFFICIAL_WARNING`](https://reference.langchain.com/python/langchain-openai/chat_models/codex/EXPERIMENTAL_UNOFFICIAL_WARNING)
- [`DEFAULT_INSTRUCTIONS`](https://reference.langchain.com/python/langchain-openai/chat_models/codex/DEFAULT_INSTRUCTIONS)
- [`token_provider`](https://reference.langchain.com/python/langchain-openai/chat_models/codex/_ChatOpenAICodex/token_provider)
- [`originator`](https://reference.langchain.com/python/langchain-openai/chat_models/codex/_ChatOpenAICodex/originator)
- [`instructions`](https://reference.langchain.com/python/langchain-openai/chat_models/codex/_ChatOpenAICodex/instructions)
- [`logger`](https://reference.langchain.com/python/langchain-openai/chat_models/_client_utils/logger)
- [`SocketOption`](https://reference.langchain.com/python/langchain-openai/chat_models/_client_utils/SocketOption)
- [`T`](https://reference.langchain.com/python/langchain-openai/chat_models/_client_utils/T)
- [`timeout_s`](https://reference.langchain.com/python/langchain-openai/chat_models/_client_utils/StreamChunkTimeoutError/timeout_s)
- [`model_name`](https://reference.langchain.com/python/langchain-openai/chat_models/_client_utils/StreamChunkTimeoutError/model_name)
- [`chunks_received`](https://reference.langchain.com/python/langchain-openai/chat_models/_client_utils/StreamChunkTimeoutError/chunks_received)
- [`logger`](https://reference.langchain.com/python/langchain-openai/chat_models/azure/logger)
- [`azure_endpoint`](https://reference.langchain.com/python/langchain-openai/chat_models/azure/AzureChatOpenAI/azure_endpoint)
- [`deployment_name`](https://reference.langchain.com/python/langchain-openai/chat_models/azure/AzureChatOpenAI/deployment_name)
- [`openai_api_version`](https://reference.langchain.com/python/langchain-openai/chat_models/azure/AzureChatOpenAI/openai_api_version)
- [`openai_api_key`](https://reference.langchain.com/python/langchain-openai/chat_models/azure/AzureChatOpenAI/openai_api_key)
- [`azure_ad_token`](https://reference.langchain.com/python/langchain-openai/chat_models/azure/AzureChatOpenAI/azure_ad_token)
- [`azure_ad_token_provider`](https://reference.langchain.com/python/langchain-openai/chat_models/azure/AzureChatOpenAI/azure_ad_token_provider)
- [`azure_ad_async_token_provider`](https://reference.langchain.com/python/langchain-openai/chat_models/azure/AzureChatOpenAI/azure_ad_async_token_provider)
- [`model_version`](https://reference.langchain.com/python/langchain-openai/chat_models/azure/AzureChatOpenAI/model_version)
- [`openai_api_type`](https://reference.langchain.com/python/langchain-openai/chat_models/azure/AzureChatOpenAI/openai_api_type)
- [`validate_base_url`](https://reference.langchain.com/python/langchain-openai/chat_models/azure/AzureChatOpenAI/validate_base_url)
- [`model_name`](https://reference.langchain.com/python/langchain-openai/chat_models/azure/AzureChatOpenAI/model_name)
- [`disabled_params`](https://reference.langchain.com/python/langchain-openai/chat_models/azure/AzureChatOpenAI/disabled_params)
- [`max_tokens`](https://reference.langchain.com/python/langchain-openai/chat_models/azure/AzureChatOpenAI/max_tokens)
- [`lc_secrets`](https://reference.langchain.com/python/langchain-openai/chat_models/azure/AzureChatOpenAI/lc_secrets)
- [`lc_attributes`](https://reference.langchain.com/python/langchain-openai/chat_models/azure/AzureChatOpenAI/lc_attributes)
