Skip to content

Initialize the client

The very first step to use this library is to create a Client instance.

To do so, you need an API key (you can create one here)

apiKey := os.Getenv("MISTRAL_API_KEY")

client := mistral.New(apiKey)

You can tune your client with some options. For example:

import "time"

...

client := mistral.New(apiKey
    mistral.WithClientTimeout(60 * time.Second),
    mistral.WithVerbose(true))

The complete list of available is available here.