# OpenAIChat

> **Class** in `langchain_community`

📖 [View in docs](https://reference.langchain.com/python/langchain-community/llms/openai/OpenAIChat)

OpenAI Chat large language models.

To use, you should have the ``openai`` python package installed, and the
environment variable ``OPENAI_API_KEY`` set with your API key.

Any parameters that are valid to be passed to the openai.create call can be passed
in, even if not explicitly saved on this class.

## Signature

```python
OpenAIChat()
```

## Description

**Example:**

.. code-block:: python

from langchain_community.llms import OpenAIChat
openaichat = OpenAIChat(model_name="gpt-3.5-turbo")

## Extends

- `BaseLLM`

## Properties

- `client`
- `async_client`
- `model_name`
- `model_kwargs`
- `openai_api_key`
- `openai_api_base`
- `openai_proxy`
- `max_retries`
- `prefix_messages`
- `streaming`
- `allowed_special`
- `disallowed_special`

## Methods

- [`build_extra()`](https://reference.langchain.com/python/langchain-community/llms/openai/OpenAIChat/build_extra)
- [`validate_environment()`](https://reference.langchain.com/python/langchain-community/llms/openai/OpenAIChat/validate_environment)
- [`get_token_ids()`](https://reference.langchain.com/python/langchain-community/llms/openai/OpenAIChat/get_token_ids)

## ⚠️ Deprecated

Deprecated since version 0.0.1.

---

[View source on GitHub](https://github.com/langchain-ai/langchain-community/blob/4b280287bd55b99b44db2dd849f02d66c89534d5/libs/community/langchain_community/llms/openai.py#L982)