Mistral
Connect to Mistral with an API key, then choose a model ID from Mistral’s catalog.
Create a model
Section titled “Create a model”import std/osimport nimgentimport nimgent/providers/mistral
let model = mistral(getEnv("MISTRAL_API_KEY")).model("mistral-medium-latest")echo generateText(model, prompt = "Say hello in one sentence.").textSet MISTRAL_API_KEY before you run the program. Choose another model ID from Mistral’s catalog when you need a different model.
Mistral uses its OpenAI-compatible Chat Completions API. The standard nimgent generation, streaming, and local tool APIs work with the selected model.
Next steps
Section titled “Next steps”See Settings for portable controls, or Tools and agents to let a model call Nim functions.