Mixtral 8x7b
Mistral MoE 8x7B Instruct v0.1 model with Sparse Mixture of Experts. Fine tuned for instruction following.
API Format: OpenAI GPT (Standard Format)
This model uses OpenAI-compatible request/response format.
1import requests
2
3url = "https://api.segmind.com/v1/mixtral-8x22b-instruct"
4
5headers = {
6 "Authorization": "Bearer YOUR_API_KEY",
7 "Content-Type": "application/json"
8}
9
10data = {
11 "messages": [
12 {
13 "role": "user",
14 "content": [
15 {
16 "type": "text",
17 "text": "What's in this image?"
18 },
19 {
20 "type": "image_url",
21 "image_url": {
22 "url": "https://example.com/image.jpg"
23 }
24 }
25 ]
26 }
27 ]
28}
29
30response = requests.post(url, json=data, headers=headers)
31print(response.json())
1import requests
2
3url = "https://api.segmind.com/v1/mixtral-8x22b-instruct"
4
5headers = {
6 "Authorization": "Bearer YOUR_API_KEY",
7 "Content-Type": "application/json"
8}
9
10data = {
11 "messages": [
12 {
13 "role": "user",
14 "content": [
15 {
16 "type": "text",
17 "text": "What's in this image?"
18 },
19 {
20 "type": "image_url",
21 "image_url": {
22 "url": "https://example.com/image.jpg"
23 }
24 }
25 ]
26 }
27 ]
28}
29
30response = requests.post(url, json=data, headers=headers)
31print(response.json())
API Endpoint
POST https://api.segmind.com/v1/mixtral-8x22b-instruct
Parameters
messages
requiredobject[]
Array of message objects with role and content. Content can be text or multimodal (text + images).
role
requiredstring
Role of the message sender
"user"
"assistant"
content
requiredarray
String or array of content blocks
Response Format
{
"id": "chat_abc123",
"object": "chat.completion",
"created": 1677652288,
"model": "mixtral-8x7b-instruct",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "I can see a beautiful sunset over the ocean with vibrant orange and pink hues in the sky."
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 56,
"completion_tokens": 31,
"total_tokens": 87
}
}
Image Input Format
Important: OpenAI GPT (Standard Format) Format
Images can be provided as URLs or base64 data URIs (data:image/jpeg;base64,...)
This model supports vision capabilities. You can include images in your requests.
Common Error Codes
The API returns standard HTTP status codes. Detailed error messages are provided in the response body.
Bad Request
Invalid message format or parameters
Unauthorized
Missing or invalid API key
Forbidden
Insufficient permissions
Not Found
Model or endpoint not found
Insufficient Credits
Not enough credits to process request
Rate Limited
Too many requests
Server Error
Internal server error
Bad Gateway
Service temporarily unavailable
Timeout
Request timed out