diff --git a/docs/getting-started/quickstart.mdx b/docs/getting-started/quickstart.mdx index 360daf4..b492e8e 100644 --- a/docs/getting-started/quickstart.mdx +++ b/docs/getting-started/quickstart.mdx @@ -9,32 +9,36 @@ import TabItem from '@theme/TabItem'; [platform_url]: https://console.mistral.ai/ - :::tip[ ] Looking for La Plateforme? Head to [console.mistral.ai][platform_url] ::: -## Account setup - -- To get started, create a Mistral account or sign in at [console.mistral.ai][platform_url]. -- Then, navigate to "Workspace" and "Billing" to add your payment information and activate payments on your account. -- After that, go to the "API keys" page and make a new API key by clicking "Create new key". -Make sure to copy the API key, save it safely, and do not share it with anyone. +## Getting started with the Mistral AI API -## Getting started with Mistral AI API +The Mistral AI API provides a seamless way for you to integrate Mistral's +state-of-the-art models into your applications and production workflows with +just a few lines of code. Open In Colab -Mistral AI API provides a seamless way for developers to integrate Mistral's state-of-the-art -models into their applications and production workflows with just a few lines of code. -Our API is currently available through [La Plateforme][platform_url]. -You need to activate payments on your account to enable your API keys. +### Get an API key + +1. Go to [console.mistral.ai][platform_url] and sign in or create an account. +2. In the **Billing** section of the left menu, click **Workspace**. +3. Click **Go to to the billing plans page**, then select a plan. +4. In the **API** section of the left menu, click **API Keys**. +5. Click **Create new key**, then click **Create key** to confirm. +6. Click **Copy**. Save the API key securely, and do not share it with anyone. + +### Try the Chat Completion API + After a few moments, you will be able to use our `chat` endpoint: + ```python import os from mistralai import Mistral @@ -59,6 +63,7 @@ print(chat_response.choices[0].message.content) + ```typescript import { Mistral } from '@mistralai/mistralai'; @@ -73,9 +78,11 @@ const chatResponse = await client.chat.complete({ console.log('Chat:', chatResponse.choices[0].message.content); ``` + + ```bash curl --location "https://api.mistral.ai/v1/chat/completions" \ --header 'Content-Type: application/json' \ @@ -86,16 +93,20 @@ curl --location "https://api.mistral.ai/v1/chat/completions" \ "messages": [{"role": "user", "content": "Who is the most renowned French painter?"}] }' ``` + -To generate text embeddings using Mistral AI's embeddings API, we can make a request to the API -endpoint and specify the embedding model `mistral-embed`, along with providing a list of input texts. -The API will then return the corresponding embeddings as numerical vectors, which can be used for -further analysis or processing in NLP applications. +### Try the Embeddings API + +To generate text embeddings, you can make a request that specifies the model +`mistral-embed` and includes a list of input texts. +The API returns the corresponding embeddings as numerical vectors, which you can +use for further analysis or processing in NLP applications. + ```python import os from mistralai import Mistral @@ -116,6 +127,7 @@ print(embeddings_response) + ```typescript import { Mistral } from '@mistralai/mistralai'; @@ -130,9 +142,11 @@ const embeddingsResponse = await client.embeddings.create({ console.log(embeddingsResponse); ``` + + ```bash curl --location "https://api.mistral.ai/v1/embeddings" \ --header 'Content-Type: application/json' \ @@ -143,10 +157,9 @@ curl --location "https://api.mistral.ai/v1/embeddings" \ "input": ["Embed this sentence.", "As well as this one."] }' ``` + - - -For a full description of the models offered on the API, head on to the **[model documentation](../models/models_overview)**. - +For a full description of the models offered by the API, see the +**[Models Overview](../models/models_overview)**.