Newv2.4.4SDK โ€ข Go

Mistral Go SDK

A comprehensive Go SDK for the Mistral AI API with 100% feature parity with the official Python SDK (v2.4.4). Built with zero external dependencies using only Go's standard library for maximum compatibility, security, and performance.

๐ŸŽ‰ v2.4.4 Released: Python SDK v2.4.4 compatibility with workflow orchestration, observability resources, connectors, RAG ingestion pipeline configuration, speech generation, and voice management APIs while maintaining zero external dependencies.

๐Ÿ”ง v2.0.1 Critical Fix: Added User-Agent header to all HTTP requests to prevent Cloudflare 400 errors. This resolves issues when using the SDK directly or through proxies/gateways.

Key Features

100% Feature Parity

Complete parity with Mistral Python SDK v2.4.4. All major resources and generated endpoint groups are implemented.

Zero Dependencies

Built entirely with Go's standard library for maximum compatibility and security.

Chat Completions

Full-featured chat with streaming, tool calling, and all advanced parameters.

OCR & Audio

Document processing with OCR and speech-to-text transcription with timestamps.

Files & Fine-tuning

Complete file management and fine-tuning API for custom model training.

Beta Features

Conversations, Libraries, Documents, Accesses, and Mistral Agents APIs.

Quality Metrics

65.2% Test Coverage

Comprehensive test suite covering all major functionality and edge cases.

A- Security Grade

Zero security vulnerabilities. Comprehensive security audit passed.

Complete API Coverage

All 12 Mistral AI APIs fully implemented with 100+ methods:

Chat Completions
Chat Streaming
Embeddings
Fill-in-the-Middle (FIM)
Models API
Files API
Fine-tuning API
Batch API
Agents API
Classifiers API
OCR API
Audio/Transcriptions API
Audio/Speech & Voices API
Workflows API
Connectors API
Observability API
RAG API

Quick Start

Installation

go get github.com/ZaguanLabs/mistral-go/v2/sdk

Basic Chat Completion

package main

import (
    "context"
    "fmt"
    "log"
    
    "github.com/ZaguanLabs/mistral-go/v2/sdk"
)

func main() {
    client := sdk.NewClient("your-api-key")
    
    response, err := client.Chat(context.Background(), &sdk.ChatRequest{
        Model: "mistral-large-latest",
        Messages: []sdk.Message{
            {Role: "user", Content: "Hello, Mistral!"},
        },
    })
    
    if err != nil {
        log.Fatal(err)
    }
    
    fmt.Println(response.Choices[0].Message.Content)
}

Streaming Responses

stream, err := client.ChatStream(context.Background(), &sdk.ChatRequest{
    Model: "mistral-large-latest",
    Messages: []sdk.Message{
        {Role: "user", Content: "Tell me a story"},
    },
})

if err != nil {
    log.Fatal(err)
}
defer stream.Close()

for {
    chunk, err := stream.Recv()
    if err == io.EOF {
        break
    }
    if err != nil {
        log.Fatal(err)
    }
    fmt.Print(chunk.Choices[0].Delta.Content)
}

Recent Updates

v2.4.4 - Latest2026-05-02

Python SDK v2.4.4 Compatibility

  • Audio/Speech & Voices: Speech generation, streaming speech, voice CRUD, and voice sample audio downloads.
  • Connectors: Connector CRUD, authentication URLs and methods, tool listing, tool calls, and credentials management.
  • Workflows: Registration, execution, deployments, metrics, runs, events, schedules, and execution control.
  • Workflow Executions: History, signal, query, update, reset, cancel, terminate, tracing, and execution streaming.
  • Observability: Campaigns, datasets, records, imports, exports, tasks, judges, live judging, fields, and chat completion events.
  • RAG: Ingestion pipeline configuration list, register, and update-run-info operations.

Version 2.0.0 Highlights

Major milestone release achieving 100% feature parity with the official Mistral Python SDK!

  • Complete Models API: All CRUD operations including retrieve, delete, update, archive/unarchive
  • Enhanced Embeddings: Full parameter support with encoding formats and output dimensions
  • FIM Streaming: Streaming support for code completions
  • OCR API: Complete document processing with page selection and bounding boxes
  • Audio API: Speech-to-text with word and segment-level timestamps
  • Beta Features: Conversations, Libraries, Documents, Accesses, and Mistral Agents
  • Zero Dependencies: Pure Go implementation using only standard library
  • Security: A- grade with 0 vulnerabilities

See the full CHANGELOG.md for complete details.

Acknowledgments

Huge thanks to Gage Technologies for creating the initial version of this SDK! ๐Ÿ™

This project builds upon their excellent foundation from the original repository. We're grateful for their pioneering work in bringing Mistral AI capabilities to the Go ecosystem.

MIT Licensed- The Mistral Go SDK is free and open source software. You're welcome to use, modify, and distribute it for any purpose.

Get Started Today

Version 2.4.4 with Python SDK v2.4.4 compatibility is available now. Star the repository on GitHub to follow updates.