Skip to content
Back to skills

Mistral

ASecurity

Mistral AI provides frontier open and commercial AI models, featuring `mistral-large-latest`, `mistral-small-latest`, `codestral-latest` for coding, and `mistral-embed` for semantic search.

  • 13 stars
  • 0 votes
  • 0 copies
  • 3 views
  • Added September 21, 2026
ai-agentstypescriptbashapi

Works with

  • cli
  • api

Security analysis

A92/100
  • mediumInstalls packages at runtime which could introduce malicious dependencies
  • mediumInstalls packages at runtime which could introduce malicious dependencies

Pro shows the line behind each finding and how to fix it

Scanned September 21, 2026

npx -y skills add ashish7802/awesome-api-skills --skill mistral --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Mistral?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Mistral
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/ashish7802-mistral/badge)](https://www.skillsdirectory.com/skills/ashish7802-mistral)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
# Mistral AI API Skill

## Overview
Mistral AI provides frontier open and commercial AI models, featuring `mistral-large-latest`, `mistral-small-latest`, `codestral-latest` for coding, and `mistral-embed` for semantic search.

## Installation
```bash
npm install @mistralai/mistralai
pip install mistralai
```

## Authentication & Client Setup
```typescript
import { Mistral } from '@mistralai/mistralai';

const client = new Mistral({
  apiKey: process.env.MISTRAL_API_KEY,
});
```

## Core API Operations

### 1. Chat Completion with Tool Calling
```typescript
const response = await client.chat.complete({
  model: 'mistral-large-latest',
  messages: [
    { role: 'user', content: 'What is the stock price of AAPL?' },
  ],
  tools: [
    {
      type: 'function',
      function: {
        name: 'getStockPrice',
        description: 'Get the current stock price for a ticker',
        parameters: {
          type: 'object',
          properties: {
            ticker: { type: 'string' },
          },
          required: ['ticker'],
        },
      },
    },
  ],
  toolChoice: 'auto',
});
```

### 2. Code Generation (Codestral)
```typescript
const codeCompletion = await client.chat.complete({
  model: 'codestral-latest',
  messages: [
    { role: 'system', content: 'You are an expert TypeScript developer.' },
    { role: 'user', content: 'Write a debounce function in TypeScript with type generics.' },
  ],
});
```

### 3. Generate Semantic Text Embeddings
```typescript
const embeddings = await client.embeddings.create({
  model: 'mistral-embed',
  inputs: ['Document chunk 1', 'Document chunk 2'],
});

console.log(embeddings.data[0].embedding.length); // 1024
```

## AI Pitfalls & Anti-Hallucination Guidelines
- **Codestral Endpoint Confusion**: Codestral has dedicated API keys and rate limits when accessed via `codestral.mistral.ai`.
- **JSON Mode Requirement**: When requesting JSON mode, the word "json" must explicitly appear in the prompt instructions.

## Production Checklist
- [ ] Structured JSON responses verified with Zod
- [ ] Safe fallback for tool calls without infinite agent loops
- [ ] Rate limits handled on embedding batch calls

---
> **Last Verified:** 2026-07-03

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.