Mistral
Mistral · GPT Actions
Mistral API
POST /v1/chat/completionsGet chat completionsSends a request to get chat completions.
原始 API 定义
{
"openapi": "3.1.0",
"info": {
"title": "Mistral API",
"version": "1.0"
},
"servers": [
{
"url": "https://mistral.chaoscomputerclub.com"
}
],
"paths": {
"/v1/chat/completions": {
"post": {
"summary": "Get chat completions",
"description": "Sends a request to get chat completions.",
"operationId": "GetChatCompletion",
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"model": {
"type": "string"
},
"messages": {
"description": "The chat context between user and GPT",
"type": "array",
"items": {
"type": "object",
"properties": {
"role": {
"type": "string"
},
"content": {
"type": "string"
}
},
"required": [
"role",
"content"
]
}
}
},
"required": [
"model",
"messages"
]
}
}
}
},
"responses": {
"200": {
"description": "Successful response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"object": {
"type": "string"
},
"created": {
"type": "integer"
},
"model": {
"type": "string"
},
"choices": {
"type": "array",
"items": {
"type": "object",
"properties": {
"index": {
"type": "integer"
},
"message": {
"type": "object",
"properties": {
"role": {
"type": "string"
},
"content": {
"type": "string"
}
}
},
"finish_reason": {
"type": "string"
}
}
}
},
"usage": {
"type": "object",
"properties": {
"prompt_tokens": {
"type": "integer"
},
"total_tokens": {
"type": "integer"
},
"completion_tokens": {
"type": "integer"
}
}
}
}
}
}
}
}
}
}
}
}
}