# ChatUpstage

> **Class** in `langchain_upstage`

📖 [View in docs](https://reference.langchain.com/python/langchain-upstage/chat_models/ChatUpstage)

ChatUpstage chat model.

To use, you should have the environment variable `UPSTAGE_API_KEY` set with your
API key or pass it as a named parameter to the constructor.

## Signature

```python
ChatUpstage()
```

## Description

**Example:**

```python
from langchain_upstage import ChatUpstage

model = ChatUpstage()
```

## Extends

- `BaseChatOpenAI`

## Properties

- `lc_secrets`
- `lc_attributes`
- `model_name`
- `upstage_api_key`
- `upstage_api_base`
- `openai_api_key`
- `openai_api_base`
- `openai_organization`
- `tiktoken_model_name`
- `tokenizer_name`
- `top_k`
- `prompt_cache_key`
- `default_headers`
- `disabled_params`

## Methods

- [`get_lc_namespace()`](https://reference.langchain.com/python/langchain-upstage/chat_models/ChatUpstage/get_lc_namespace)
- [`validate_environment()`](https://reference.langchain.com/python/langchain-upstage/chat_models/ChatUpstage/validate_environment)
- [`get_token_ids()`](https://reference.langchain.com/python/langchain-upstage/chat_models/ChatUpstage/get_token_ids)
- [`get_num_tokens_from_messages()`](https://reference.langchain.com/python/langchain-upstage/chat_models/ChatUpstage/get_num_tokens_from_messages)

---

[View source on GitHub](https://github.com/langchain-ai/langchain-upstage/blob/1acdf18d9c969bb59ae0c5365f8b964e397f8b16/libs/upstage/langchain_upstage/chat_models.py#L44)