# StochasticAI

> **Class** in `langchain_community`

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

StochasticAI large language models.

To use, you should have the environment variable ``STOCHASTICAI_API_KEY``
set with your API key.

## Signature

```python
StochasticAI()
```

## Description

**Example:**

.. code-block:: python

from langchain_community.llms import StochasticAI
stochasticai = StochasticAI(api_url="")

## Extends

- `LLM`

## Properties

- `api_url`
- `model_kwargs`
- `stochasticai_api_key`
- `model_config`

## Methods

- [`build_extra()`](https://reference.langchain.com/python/langchain-community/llms/stochasticai/StochasticAI/build_extra)
- [`validate_environment()`](https://reference.langchain.com/python/langchain-community/llms/stochasticai/StochasticAI/validate_environment)

---

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