> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ag2.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# autogen.oai.mistral.MistralAIClient

<h2 id="autogen.oai.mistral.MistralAIClient" class="doc doc-heading">
  <code class="doc-symbol doc-symbol-heading doc-symbol-class" />

  <span class="doc doc-object-name doc-class-name">MistralAIClient</span>
</h2>

```python theme={null}
MistralAIClient(**kwargs)
```

Client for Mistral.AI's API.<br />Requires api\_key or environment variable to be set

<b>Parameters:</b>

| Name       | Description |
| ---------- | ----------- |
| `**kwargs` |             |

### Instance Methods

<code class="doc-symbol doc-symbol-heading doc-symbol-method" />

#### cost

```python theme={null}
cost(self, response) -> float
```

<b>Parameters:</b>

| Name       | Description |
| ---------- | ----------- |
| `response` |             |

<br />

<code class="doc-symbol doc-symbol-heading doc-symbol-method" />

#### create

```python theme={null}
create(self, params: dict[str, Any]) -> ChatCompletionExtended
```

<b>Parameters:</b>

| Name     | Description                      |
| -------- | -------------------------------- |
| `params` | **Type:** dict\[str, typing.Any] |

<br />

<code class="doc-symbol doc-symbol-heading doc-symbol-method" />

#### get\_usage

```python theme={null}
get_usage(response: ChatCompletionExtended) -> dict
```

<b>Parameters:</b>

| Name       | Description                                                               |
| ---------- | ------------------------------------------------------------------------- |
| `response` | **Type:** autogen.oai.oai\_models.chat\_completion.ChatCompletionExtended |

<br />

<code class="doc-symbol doc-symbol-heading doc-symbol-method" />

#### message\_retrieval

```python theme={null}
message_retrieval(self, response: ChatCompletionExtended) -> list[str] | list[ChatCompletionMessage]
```

Retrieve the messages from the response.

<b>Parameters:</b>

| Name       | Description                                                               |
| ---------- | ------------------------------------------------------------------------- |
| `response` | **Type:** autogen.oai.oai\_models.chat\_completion.ChatCompletionExtended |

<br />

<code class="doc-symbol doc-symbol-heading doc-symbol-method" />

#### parse\_params

```python theme={null}
parse_params(self, params: dict[str, Any]) -> dict[str, Any]
```

Loads the parameters for Mistral.AI API from the passed in parameters and returns a validated set. Checks types, ranges, and sets defaults

<b>Parameters:</b>

| Name     | Description                      |
| -------- | -------------------------------- |
| `params` | **Type:** dict\[str, typing.Any] |

<br />
