# BaseOpenAI

> **Class** in `langchain_community`

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

Base OpenAI large language model class.

## Signature

```python
BaseOpenAI()
```

## Extends

- `BaseLLM`

## Properties

- `lc_secrets`
- `lc_attributes`
- `client`
- `async_client`
- `model_name`
- `temperature`
- `max_tokens`
- `top_p`
- `frequency_penalty`
- `presence_penalty`
- `n`
- `best_of`
- `model_kwargs`
- `openai_api_key`
- `openai_api_base`
- `openai_organization`
- `openai_proxy`
- `batch_size`
- `request_timeout`
- `logit_bias`
- `max_retries`
- `streaming`
- `allowed_special`
- `disallowed_special`
- `tiktoken_model_name`
- `default_headers`
- `default_query`
- `http_client`
- `model_config`
- `max_context_size`

## Methods

- [`get_lc_namespace()`](https://reference.langchain.com/python/langchain-community/llms/openai/BaseOpenAI/get_lc_namespace)
- [`is_lc_serializable()`](https://reference.langchain.com/python/langchain-community/llms/openai/BaseOpenAI/is_lc_serializable)
- [`build_extra()`](https://reference.langchain.com/python/langchain-community/llms/openai/BaseOpenAI/build_extra)
- [`validate_environment()`](https://reference.langchain.com/python/langchain-community/llms/openai/BaseOpenAI/validate_environment)
- [`get_sub_prompts()`](https://reference.langchain.com/python/langchain-community/llms/openai/BaseOpenAI/get_sub_prompts)
- [`create_llm_result()`](https://reference.langchain.com/python/langchain-community/llms/openai/BaseOpenAI/create_llm_result)
- [`get_token_ids()`](https://reference.langchain.com/python/langchain-community/llms/openai/BaseOpenAI/get_token_ids)
- [`modelname_to_contextsize()`](https://reference.langchain.com/python/langchain-community/llms/openai/BaseOpenAI/modelname_to_contextsize)
- [`max_tokens_for_prompt()`](https://reference.langchain.com/python/langchain-community/llms/openai/BaseOpenAI/max_tokens_for_prompt)

---

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