A comprehensive Go SDK for the Mistral AI API with 100% feature parity with the official Python SDK (v1.9.11). Built with zero external dependencies using only Go's standard library for maximum compatibility, security, and performance.
๐ Major Milestone: Version 2.0.1 achieves 100% feature parity with the official Mistral Python SDK! Complete implementation of all 12 APIs with 100+ methods, 65.2% test coverage, A- security grade, and zero vulnerabilities.
๐ง 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.
Complete parity with Mistral Python SDK v1.9.11. All 12 APIs, 100+ methods fully implemented.
Built entirely with Go's standard library for maximum compatibility and security.
Full-featured chat with streaming, tool calling, and all advanced parameters.
Document processing with OCR and speech-to-text transcription with timestamps.
Complete file management and fine-tuning API for custom model training.
Conversations, Libraries, Documents, Accesses, and Mistral Agents APIs.
Comprehensive test suite covering all major functionality and edge cases.
Zero security vulnerabilities. Comprehensive security audit passed.
All 12 Mistral AI APIs fully implemented with 100+ methods:
go get github.com/ZaguanLabs/mistral-go/v2/sdkpackage 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)
}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)
}Major milestone release achieving 100% feature parity with the official Mistral Python SDK!
See the full CHANGELOG.md for complete details.
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.