Skip to content

Instantly share code, notes, and snippets.

@vdespa
Created January 15, 2024 19:30
Show Gist options
  • Save vdespa/decfc522a64000f062b5f65b555d7072 to your computer and use it in GitHub Desktop.
Save vdespa/decfc522a64000f062b5f65b555d7072 to your computer and use it in GitHub Desktop.
Mistral AI API Postman collection
{
"info": {
"_postman_id": "f2f80199-0b76-4e18-85de-680172cd17d6",
"name": "Mistral AI API",
"description": "To get started, you need to set the Postman collection variable `mistralAPIKey` with a valid Mistral AI API key.",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
"_exporter_id": "20537536"
},
"item": [
{
"name": "List models",
"request": {
"auth": {
"type": "bearer",
"bearer": [
{
"key": "token",
"value": "{{mistralAPIKey}}",
"type": "string"
}
]
},
"method": "GET",
"header": [],
"url": {
"raw": "https://api.mistral.ai/v1/models",
"protocol": "https",
"host": [
"api",
"mistral",
"ai"
],
"path": [
"v1",
"models"
]
}
},
"response": []
},
{
"name": "Chat completion",
"request": {
"auth": {
"type": "bearer",
"bearer": [
{
"key": "token",
"value": "{{mistralAPIKey}}",
"type": "string"
}
]
},
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "Accept",
"value": "application/json"
},
{
"key": "Authorization",
"value": "Bearer 1B6JEMhjoZC2mzB2YymDw5LZLcvzWyNk"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"model\": \"mistral-tiny\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"I currently have two bananas. I ate one yerstarday. How any do I have now?\"\n }\n ]\n}"
},
"url": {
"raw": "https://api.mistral.ai/v1/chat/completions",
"protocol": "https",
"host": [
"api",
"mistral",
"ai"
],
"path": [
"v1",
"chat",
"completions"
]
}
},
"response": []
}
],
"event": [
{
"listen": "prerequest",
"script": {
"type": "text/javascript",
"exec": [
""
]
}
},
{
"listen": "test",
"script": {
"type": "text/javascript",
"exec": [
""
]
}
}
],
"variable": [
{
"key": "mistralAPIKey",
"value": "YOUR MISTRAL AI API KEY HERE",
"type": "string"
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment