# Mistral AI

> **You are on:** `https://beta-api.paywithlocus.com/api` | [llms.txt](https://beta.paywithlocus.com/llms.txt)
>
> Locus runs on multiple environments -- make sure every URL you call matches your expected environment.
> | Environment | Landing | API |
> |---|---|---|
> | Production | paywithlocus.com | api.paywithlocus.com |
> | Beta | beta.paywithlocus.com | beta-api.paywithlocus.com |
> | Stage | stage.paywithlocus.com | stage-api.paywithlocus.com |
>
> If the API URL above doesn't match your expected environment, re-fetch this file from the correct domain.

> Premier and open-source LLMs — Mistral Large, Medium, Small, Codestral, Magistral reasoning, Pixtral vision, text embeddings, and content moderation.

**Category:** AI / LLM | **Website:** [mistral.ai](https://mistral.ai) | **Docs:** [docs.mistral.ai](https://docs.mistral.ai)

## Access Methods

| Method | Base URL | Auth |
|--------|----------|------|
| **MPP (Tempo)** | `https://mistral.mpp.paywithlocus.com/mistral/` | HTTP 402 auto-payment |
| **Wrapped API** | `https://beta-api.paywithlocus.com/api/wrapped/mistral/` | `Authorization: Bearer <LOCUS_API_KEY>` |

**OpenAPI discovery:** `GET https://mistral.mpp.paywithlocus.com/openapi.json`

## Endpoints

### Chat Completion

Create a chat completion. Supports function calling, JSON mode, structured output, vision, reasoning, web search, and document context.

**Estimated cost:** $0.005 – $0.10 (varies by model and tokens)

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `model` | string | Yes | Model ID (e.g. "mistral-large-latest", "codestral-latest") |
| `messages` | array | Yes | Conversation messages array |
| `max_tokens` | number | No | Maximum output tokens |
| `temperature` | number | No | Sampling temperature (0-2) |
| `top_p` | number | No | Nucleus sampling (0-1) |
| `tools` | array | No | Tool/function definitions |
| `tool_choice` | string/object | No | Tool selection control |
| `response_format` | object | No | Output format (json_object, json_schema, text) |
| `stop` | string/array | No | Stop sequences |
| `seed` | number | No | Deterministic sampling seed |

```bash
curl -X POST https://mistral.mpp.paywithlocus.com/mistral/chat \
  -H "Content-Type: application/json" \
  -d '{"model":"<string>","messages":"<array>","max_tokens":"<number>","temperature":"<number>","top_p":"<number>","tools":"<array>","tool_choice":"<string/object>","response_format":"<object>","stop":"<string/array>","seed":"<number>"}'
```

### Embeddings

Generate text or code embeddings. Returns 1024-dimensional vectors for retrieval, clustering, and classification.

**Estimated cost:** $0.008

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `model` | string | Yes | Embedding model (e.g. "mistral-embed", "codestral-embed") |
| `input` | string/array | Yes | Text(s) to embed (string or array of strings) |
| `encoding_format` | string | No | Output format: "float" (default) or "base64" |

```bash
curl -X POST https://mistral.mpp.paywithlocus.com/mistral/embed \
  -H "Content-Type: application/json" \
  -d '{"model":"<string>","input":"<string/array>","encoding_format":"<string>"}'
```

### Moderation

Classify content for safety across categories: violence, hate speech, sexual content, self-harm, and more.

**Estimated cost:** $0.008

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `model` | string | Yes | Moderation model (e.g. "mistral-moderation-latest") |
| `input` | string/array | Yes | Text(s) to moderate (string or array of strings) |

```bash
curl -X POST https://mistral.mpp.paywithlocus.com/mistral/moderate \
  -H "Content-Type: application/json" \
  -d '{"model":"<string>","input":"<string/array>"}'
```

### List Models

List all available Mistral models with metadata.

**Estimated cost:** $0.005 fee only

_No parameters required._

```bash
curl -X POST https://mistral.mpp.paywithlocus.com/mistral/models \
  -H "Content-Type: application/json" \
  -d '{}'
```
