Mistral AI API (0.0.2)
Download OpenAPI specification:Download
Our Chat Completion and Embeddings APIs specification. Create your account on La Plateforme to get access and read the docs to learn how to use it.
Chat Completion
Authorizations:
Request Body schema: application/jsonrequired
required | Model (string) or Model (null) (Model) ID of the model to use. You can use the List Available Models API to see all of your available models, or see our Model overview for model descriptions. |
Temperature (number) or Temperature (null) (Temperature) What sampling temperature to use, we recommend between 0.0 and 0.7. Higher values like 0.7 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or | |
top_p | number (Top P) [ 0 .. 1 ] Default: 1 Nucleus sampling, where the model considers the results of the tokens with |
Max Tokens (integer) or Max Tokens (null) (Max Tokens) The maximum number of tokens to generate in the completion. The token count of your prompt plus | |
stream | boolean (Stream) Default: false Whether to stream back partial progress. If set, tokens will be sent as data-only server-side events as they become available, with the stream terminated by a data: [DONE] message. Otherwise, the server will hold the request open until the timeout or until completion, with the response containing the full result as JSON. |
Stop (string) or Array of Stop (strings) (Stop) Stop generation if this token is detected. Or if one of these tokens is detected when providing an array | |
Random Seed (integer) or Random Seed (null) (Random Seed) The seed to use for random sampling. If set, different calls will generate deterministic results. | |
required | Array of any (Messages) The prompt(s) to generate completions for, encoded as a list of dict with role and content. |
object (ResponseFormat) | |
Array of Tools (objects) or Tools (null) (Tools) | |
ToolChoice (object) or ToolChoiceEnum (string) (Tool Choice) Default: "auto" | |
presence_penalty | number (Presence Penalty) [ -2 .. 2 ] Default: 0 presence_penalty determines how much the model penalizes the repetition of words or phrases. A higher presence penalty encourages the model to use a wider variety of words and phrases, making the output more diverse and creative. |
frequency_penalty | number (Frequency Penalty) [ -2 .. 2 ] Default: 0 frequency_penalty penalizes the repetition of words based on their frequency in the generated text. A higher frequency penalty discourages the model from repeating words that have already appeared frequently in the output, promoting diversity and reducing repetition. |
N (integer) or N (null) (N) Number of completions to return for each request, input tokens are only billed once. | |
safe_prompt | boolean Default: false Whether to inject a safety prompt before all conversations. |
Responses
Request samples
- Payload
{- "model": "mistral-small-latest",
- "temperature": 1.5,
- "top_p": 1,
- "max_tokens": 0,
- "stream": false,
- "stop": "string",
- "random_seed": 0,
- "messages": [
- {
- "role": "user",
- "content": "Who is the best French painter? Answer in one short sentence."
}
], - "response_format": {
- "type": "text"
}, - "tools": [
- {
- "type": "function",
- "function": {
- "name": "string",
- "description": "",
- "parameters": { }
}
}
], - "tool_choice": "auto",
- "presence_penalty": 0,
- "frequency_penalty": 0,
- "n": 1,
- "safe_prompt": false
}
Response samples
- 200
- 422
{- "id": "cmpl-e5cc70bb28c444948073e77776eb30ef",
- "object": "chat.completion",
- "model": "mistral-small-latest",
- "usage": {
- "prompt_tokens": 16,
- "completion_tokens": 34,
- "total_tokens": 50
}, - "created": 1702256327,
- "choices": [
- {
- "index": 0,
- "message": {
- "content": "string",
- "tool_calls": [
- {
- "id": "null",
- "type": "function",
- "function": {
- "name": "string",
- "arguments": { }
}
}
], - "prefix": false,
- "role": "assistant"
}, - "finish_reason": "stop"
}
]
}
Fim Completion
FIM completion.
Authorizations:
Request Body schema: application/jsonrequired
required | Model (string) or Model (null) (Model) Default: "codestral-2405" ID of the model to use. Only compatible for now with:
|
Temperature (number) or Temperature (null) (Temperature) What sampling temperature to use, we recommend between 0.0 and 0.7. Higher values like 0.7 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or | |
top_p | number (Top P) [ 0 .. 1 ] Default: 1 Nucleus sampling, where the model considers the results of the tokens with |
Max Tokens (integer) or Max Tokens (null) (Max Tokens) The maximum number of tokens to generate in the completion. The token count of your prompt plus | |
stream | boolean (Stream) Default: false Whether to stream back partial progress. If set, tokens will be sent as data-only server-side events as they become available, with the stream terminated by a data: [DONE] message. Otherwise, the server will hold the request open until the timeout or until completion, with the response containing the full result as JSON. |
Stop (string) or Array of Stop (strings) (Stop) Stop generation if this token is detected. Or if one of these tokens is detected when providing an array | |
Random Seed (integer) or Random Seed (null) (Random Seed) The seed to use for random sampling. If set, different calls will generate deterministic results. | |
prompt required | string (Prompt) The text/code to complete. |
Suffix (string) or Suffix (null) (Suffix) Default: "" Optional text/code that adds more context for the model. When given a | |
Min Tokens (integer) or Min Tokens (null) (Min Tokens) The minimum number of tokens to generate in the completion. |
Responses
Request samples
- Payload
{- "model": "codestral-2405",
- "temperature": 1.5,
- "top_p": 1,
- "max_tokens": 0,
- "stream": false,
- "stop": "string",
- "random_seed": 0,
- "prompt": "def",
- "suffix": "return a+b",
- "min_tokens": 0
}
Response samples
- 200
- 422
{- "id": "cmpl-e5cc70bb28c444948073e77776eb30ef",
- "object": "chat.completion",
- "model": "codestral-latest",
- "usage": {
- "prompt_tokens": 16,
- "completion_tokens": 34,
- "total_tokens": 50
}, - "created": 1702256327,
- "choices": [
- {
- "index": 0,
- "message": {
- "content": "string",
- "tool_calls": [
- {
- "id": "null",
- "type": "function",
- "function": {
- "name": "string",
- "arguments": { }
}
}
], - "prefix": false,
- "role": "assistant"
}, - "finish_reason": "stop"
}
]
}
Agents Completion
Authorizations:
Request Body schema: application/jsonrequired
Max Tokens (integer) or Max Tokens (null) (Max Tokens) The maximum number of tokens to generate in the completion. The token count of your prompt plus | |
stream | boolean (Stream) Default: false Whether to stream back partial progress. If set, tokens will be sent as data-only server-side events as they become available, with the stream terminated by a data: [DONE] message. Otherwise, the server will hold the request open until the timeout or until completion, with the response containing the full result as JSON. |
Stop (string) or Array of Stop (strings) (Stop) Stop generation if this token is detected. Or if one of these tokens is detected when providing an array | |
Random Seed (integer) or Random Seed (null) (Random Seed) The seed to use for random sampling. If set, different calls will generate deterministic results. | |
required | Array of any (Messages) The prompt(s) to generate completions for, encoded as a list of dict with role and content. |
object (ResponseFormat) | |
Array of Tools (objects) or Tools (null) (Tools) | |
ToolChoice (object) or ToolChoiceEnum (string) (Tool Choice) Default: "auto" | |
presence_penalty | number (Presence Penalty) [ -2 .. 2 ] Default: 0 presence_penalty determines how much the model penalizes the repetition of words or phrases. A higher presence penalty encourages the model to use a wider variety of words and phrases, making the output more diverse and creative. |
frequency_penalty | number (Frequency Penalty) [ -2 .. 2 ] Default: 0 frequency_penalty penalizes the repetition of words based on their frequency in the generated text. A higher frequency penalty discourages the model from repeating words that have already appeared frequently in the output, promoting diversity and reducing repetition. |
N (integer) or N (null) (N) Number of completions to return for each request, input tokens are only billed once. | |
agent_id required | string The ID of the agent to use for this completion. |
Responses
Request samples
- Payload
{- "max_tokens": 0,
- "stream": false,
- "stop": "string",
- "random_seed": 0,
- "messages": [
- {
- "role": "user",
- "content": "Who is the best French painter? Answer in one short sentence."
}
], - "response_format": {
- "type": "text"
}, - "tools": [
- {
- "type": "function",
- "function": {
- "name": "string",
- "description": "",
- "parameters": { }
}
}
], - "tool_choice": "auto",
- "presence_penalty": 0,
- "frequency_penalty": 0,
- "n": 1,
- "agent_id": "string"
}
Response samples
- 200
- 422
{- "id": "cmpl-e5cc70bb28c444948073e77776eb30ef",
- "object": "chat.completion",
- "model": "mistral-small-latest",
- "usage": {
- "prompt_tokens": 16,
- "completion_tokens": 34,
- "total_tokens": 50
}, - "created": 1702256327,
- "choices": [
- {
- "index": 0,
- "message": {
- "content": "string",
- "tool_calls": [
- {
- "id": "null",
- "type": "function",
- "function": {
- "name": "string",
- "arguments": { }
}
}
], - "prefix": false,
- "role": "assistant"
}, - "finish_reason": "stop"
}
]
}
Embeddings
Embeddings
Authorizations:
Request Body schema: application/jsonrequired
required | Input (string) or Array of Input (strings) (Input) Text to embed. |
model required | string (Model) Default: "mistral-embed" ID of the model to use. |
Encoding Format (string) or Encoding Format (null) (Encoding Format) Default: "float" The format to return the embeddings in. |
Responses
Request samples
- Payload
{- "input": [
- "Embed this sentence.",
- "As well as this one."
], - "model": "mistral-embed",
- "encoding_format": "float"
}
Response samples
- 200
- 422
{- "id": "cmpl-e5cc70bb28c444948073e77776eb30ef",
- "object": "chat.completion",
- "model": "mistral-small-latest",
- "usage": {
- "prompt_tokens": 16,
- "completion_tokens": 34,
- "total_tokens": 50
}, - "data": [
- [
- {
- "object": "embedding",
- "embedding": [
- 0.1,
- 0.2,
- 0.3
], - "index": 0
}, - {
- "object": "embedding",
- "embedding": [
- 0.4,
- 0.5,
- 0.6
], - "index": 1
}
]
]
}
Moderations
Authorizations:
Request Body schema: application/jsonrequired
required | Input (string) or Array of Input (strings) (Input) Text to classify. |
Model (string) or Model (null) (Model) |
Responses
Request samples
- Payload
{- "input": "string",
- "model": "string"
}
Response samples
- 200
- 422
{- "id": "mod-e5cc70bb28c444948073e77776eb30ef",
- "model": "string",
- "results": [
- {
- "categories": {
- "property1": true,
- "property2": true
}, - "category_scores": {
- "property1": 0,
- "property2": 0
}
}
]
}
Moderations Chat
Authorizations:
Request Body schema: application/jsonrequired
required | Array of Input (any) or Array of Input (any) (Input) Chat to classify |
required | Model (string) or Model (null) (Model) |
Responses
Request samples
- Payload
{- "input": [
- {
- "content": "string",
- "role": "system"
}
], - "model": "string"
}
Response samples
- 200
- 422
{- "id": "mod-e5cc70bb28c444948073e77776eb30ef",
- "model": "string",
- "results": [
- {
- "categories": {
- "property1": true,
- "property2": true
}, - "category_scores": {
- "property1": 0,
- "property2": 0
}
}
]
}
Upload File
Upload a file that can be used across various endpoints.
The size of individual files can be a maximum of 512 MB. The Fine-tuning API only supports .jsonl files.
Please contact us if you need to increase these storage limits.
Authorizations:
Request Body schema: multipart/form-datarequired
purpose | string (FilePurpose) Default: "fine-tune" Enum: "fine-tune" "batch" |
file required | string <binary> (File) The File object (not file name) to be uploaded. To upload a file and specify a custom file name you should format your request as such:
Otherwise, you can just keep the original file name:
|
Responses
Response samples
- 200
{- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f09",
- "object": "file",
- "bytes": 13000,
- "created_at": 1716963433,
- "filename": "files_upload.jsonl",
- "purpose": "fine-tune",
- "sample_type": "pretrain",
- "num_lines": 0,
- "source": "upload"
}
List Files
Returns a list of files that belong to the user's organization.
Authorizations:
query Parameters
page | integer (Page) Default: 0 |
page_size | integer (Page Size) Default: 100 |
Array of Sample Type (strings) or Sample Type (null) (Sample Type) | |
Array of Source (strings) or Source (null) (Source) | |
Search (string) or Search (null) (Search) | |
FilePurpose (string) or null |
Responses
Response samples
- 200
{- "data": [
- {
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f09",
- "object": "file",
- "bytes": 13000,
- "created_at": 1716963433,
- "filename": "files_upload.jsonl",
- "purpose": "fine-tune",
- "sample_type": "pretrain",
- "num_lines": 0,
- "source": "upload"
}
], - "object": "string",
- "total": 0
}
Retrieve File
Returns information about a specific file.
Authorizations:
path Parameters
file_id required | string (File Id) |
Responses
Response samples
- 200
{- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f09",
- "object": "file",
- "bytes": 13000,
- "created_at": 1716963433,
- "filename": "files_upload.jsonl",
- "purpose": "fine-tune",
- "sample_type": "pretrain",
- "num_lines": 0,
- "source": "upload",
- "deleted": true
}
Get Fine Tuning Jobs
Get a list of fine-tuning jobs for your organization and user.
Authorizations:
query Parameters
page | integer (Page) Default: 0 The page number of the results to be returned. |
page_size | integer (Page Size) Default: 100 The number of items to return per page. |
Model (string) or Model (null) (Model) The model name used for fine-tuning to filter on. When set, the other results are not displayed. | |
Created After (string) or Created After (null) (Created After) The date/time to filter on. When set, the results for previous creation times are not displayed. | |
created_by_me | boolean (Created By Me) Default: false When set, only return results for jobs created by the API caller. Other results are not displayed. |
Status (string) or Status (null) (Status) The current job state to filter on. When set, the other results are not displayed. | |
Wandb Project (string) or Wandb Project (null) (Wandb Project) The Weights and Biases project to filter on. When set, the other results are not displayed. | |
Wandb Name (string) or Wandb Name (null) (Wandb Name) The Weight and Biases run name to filter on. When set, the other results are not displayed. | |
Suffix (string) or Suffix (null) (Suffix) The model suffix to filter on. When set, the other results are not displayed. |
Responses
Response samples
- 200
{- "data": [ ],
- "object": "list",
- "total": 0
}
Create Fine Tuning Job
Create a new fine-tuning job, it will be queued for processing.
Authorizations:
query Parameters
Dry Run (boolean) or Dry Run (null) (Dry Run)
|
Request Body schema: application/jsonrequired
model required | string (FineTuneableModel) Enum: "open-mistral-7b" "mistral-small-latest" "codestral-latest" "mistral-large-latest" "open-mistral-nemo" The name of the model to fine-tune. |
Array of objects (Training Files) Default: [] | |
Array of Validation Files (strings) or Validation Files (null) (Validation Files) A list containing the IDs of uploaded files that contain validation data. If you provide these files, the data is used to generate validation metrics periodically during fine-tuning. These metrics can be viewed in | |
required | object (TrainingParametersIn) The fine-tuning hyperparameter settings used in a fine-tune job. |
Suffix (string) or Suffix (null) (Suffix) A string that will be added to your fine-tuning model name. For example, a suffix of "my-great-model" would produce a model name like | |
Array of Integrations (any) or Integrations (null) (Integrations) A list of integrations to enable for your fine-tuning job. | |
Array of any (Repositories) Default: [] | |
auto_start | boolean (Auto Start) This field will be required in a future release. |
Responses
Request samples
- Payload
{- "model": "open-mistral-7b",
- "training_files": [ ],
- "validation_files": [
- "497f6eca-6276-4993-bfeb-53cbbbba6f08"
], - "hyperparameters": {
- "training_steps": 1,
- "learning_rate": 0.0001,
- "weight_decay": 0.1,
- "warmup_fraction": 0.05,
- "epochs": 0,
- "fim_ratio": 0.9,
- "seq_len": 100
}, - "suffix": "string",
- "integrations": [
- {
- "type": "wandb",
- "project": "string",
- "name": "string",
- "api_key": "stringstringstringstringstringstringstri",
- "run_name": "string"
}
], - "repositories": [ ],
- "auto_start": true
}
Response samples
- 200
{- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "auto_start": true,
- "hyperparameters": {
- "training_steps": 1,
- "learning_rate": 0.0001,
- "weight_decay": 0.1,
- "warmup_fraction": 0.05,
- "epochs": 0,
- "fim_ratio": 0.9,
- "seq_len": 100
}, - "model": "open-mistral-7b",
- "status": "QUEUED",
- "job_type": "string",
- "created_at": 0,
- "modified_at": 0,
- "training_files": [
- "497f6eca-6276-4993-bfeb-53cbbbba6f08"
], - "validation_files": [ ],
- "object": "job",
- "fine_tuned_model": "string",
- "suffix": "string",
- "integrations": [
- {
- "type": "wandb",
- "project": "string",
- "name": "string",
- "run_name": "string"
}
], - "trained_tokens": 0,
- "repositories": [ ],
- "metadata": {
- "expected_duration_seconds": 0,
- "cost": 0,
- "cost_currency": "string",
- "train_tokens_per_step": 0,
- "train_tokens": 0,
- "data_tokens": 0,
- "estimated_start_time": 0
}
}
Get Fine Tuning Job
Get a fine-tuned job details by its UUID.
Authorizations:
path Parameters
job_id required | string <uuid> (Job Id) The ID of the job to analyse. |
Responses
Response samples
- 200
{- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "auto_start": true,
- "hyperparameters": {
- "training_steps": 1,
- "learning_rate": 0.0001,
- "weight_decay": 0.1,
- "warmup_fraction": 0.05,
- "epochs": 0,
- "fim_ratio": 0.9,
- "seq_len": 100
}, - "model": "open-mistral-7b",
- "status": "QUEUED",
- "job_type": "string",
- "created_at": 0,
- "modified_at": 0,
- "training_files": [
- "497f6eca-6276-4993-bfeb-53cbbbba6f08"
], - "validation_files": [ ],
- "object": "job",
- "fine_tuned_model": "string",
- "suffix": "string",
- "integrations": [
- {
- "type": "wandb",
- "project": "string",
- "name": "string",
- "run_name": "string"
}
], - "trained_tokens": 0,
- "repositories": [ ],
- "metadata": {
- "expected_duration_seconds": 0,
- "cost": 0,
- "cost_currency": "string",
- "train_tokens_per_step": 0,
- "train_tokens": 0,
- "data_tokens": 0,
- "estimated_start_time": 0
}, - "events": [ ],
- "checkpoints": [ ]
}
Cancel Fine Tuning Job
Request the cancellation of a fine tuning job.
Authorizations:
path Parameters
job_id required | string <uuid> (Job Id) The ID of the job to cancel. |
Responses
Response samples
- 200
{- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "auto_start": true,
- "hyperparameters": {
- "training_steps": 1,
- "learning_rate": 0.0001,
- "weight_decay": 0.1,
- "warmup_fraction": 0.05,
- "epochs": 0,
- "fim_ratio": 0.9,
- "seq_len": 100
}, - "model": "open-mistral-7b",
- "status": "QUEUED",
- "job_type": "string",
- "created_at": 0,
- "modified_at": 0,
- "training_files": [
- "497f6eca-6276-4993-bfeb-53cbbbba6f08"
], - "validation_files": [ ],
- "object": "job",
- "fine_tuned_model": "string",
- "suffix": "string",
- "integrations": [
- {
- "type": "wandb",
- "project": "string",
- "name": "string",
- "run_name": "string"
}
], - "trained_tokens": 0,
- "repositories": [ ],
- "metadata": {
- "expected_duration_seconds": 0,
- "cost": 0,
- "cost_currency": "string",
- "train_tokens_per_step": 0,
- "train_tokens": 0,
- "data_tokens": 0,
- "estimated_start_time": 0
}, - "events": [ ],
- "checkpoints": [ ]
}
Start Fine Tuning Job
Request the start of a validated fine tuning job.
Authorizations:
path Parameters
job_id required | string <uuid> (Job Id) |
Responses
Response samples
- 200
{- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "auto_start": true,
- "hyperparameters": {
- "training_steps": 1,
- "learning_rate": 0.0001,
- "weight_decay": 0.1,
- "warmup_fraction": 0.05,
- "epochs": 0,
- "fim_ratio": 0.9,
- "seq_len": 100
}, - "model": "open-mistral-7b",
- "status": "QUEUED",
- "job_type": "string",
- "created_at": 0,
- "modified_at": 0,
- "training_files": [
- "497f6eca-6276-4993-bfeb-53cbbbba6f08"
], - "validation_files": [ ],
- "object": "job",
- "fine_tuned_model": "string",
- "suffix": "string",
- "integrations": [
- {
- "type": "wandb",
- "project": "string",
- "name": "string",
- "run_name": "string"
}
], - "trained_tokens": 0,
- "repositories": [ ],
- "metadata": {
- "expected_duration_seconds": 0,
- "cost": 0,
- "cost_currency": "string",
- "train_tokens_per_step": 0,
- "train_tokens": 0,
- "data_tokens": 0,
- "estimated_start_time": 0
}, - "events": [ ],
- "checkpoints": [ ]
}
Response samples
- 200
- 422
{- "object": "list",
- "data": [
- {
- "id": "string",
- "object": "model",
- "created": 0,
- "owned_by": "mistralai",
- "capabilities": {
- "completion_chat": true,
- "completion_fim": false,
- "function_calling": true,
- "fine_tuning": false,
- "vision": false
}, - "name": "string",
- "description": "string",
- "max_context_length": 32768,
- "aliases": [ ],
- "deprecation": "2019-08-24T14:15:22Z",
- "default_model_temperature": 0,
- "type": "base"
}
]
}
Retrieve Model
Retrieve a model information.
Authorizations:
path Parameters
model_id required | string (Model Id) Example: ft:open-mistral-7b:587a6b29:20240514:7e773925 The ID of the model to retrieve. |
Responses
Response samples
- 200
- 422
{- "id": "string",
- "object": "model",
- "created": 0,
- "owned_by": "mistralai",
- "capabilities": {
- "completion_chat": true,
- "completion_fim": false,
- "function_calling": true,
- "fine_tuning": false,
- "vision": false
}, - "name": "string",
- "description": "string",
- "max_context_length": 32768,
- "aliases": [ ],
- "deprecation": "2019-08-24T14:15:22Z",
- "default_model_temperature": 0,
- "type": "base"
}
Delete Model
Delete a fine-tuned model.
Authorizations:
path Parameters
model_id required | string (Model Id) Example: ft:open-mistral-7b:587a6b29:20240514:7e773925 The ID of the model to delete. |
Responses
Response samples
- 200
- 422
{- "id": "ft:open-mistral-7b:587a6b29:20240514:7e773925",
- "object": "model",
- "deleted": true
}
Update Fine Tuned Model
Update a model name or description.
Authorizations:
path Parameters
model_id required | string (Model Id) Example: ft:open-mistral-7b:587a6b29:20240514:7e773925 The ID of the model to update. |
Request Body schema: application/jsonrequired
Name (string) or Name (null) (Name) | |
Description (string) or Description (null) (Description) |
Responses
Request samples
- Payload
{- "name": "string",
- "description": "string"
}
Response samples
- 200
{- "id": "string",
- "object": "model",
- "created": 0,
- "owned_by": "string",
- "root": "string",
- "archived": true,
- "name": "string",
- "description": "string",
- "capabilities": {
- "completion_chat": true,
- "completion_fim": false,
- "function_calling": false,
- "fine_tuning": false
}, - "max_context_length": 32768,
- "aliases": [ ],
- "job": "4bbaedb0-902b-4b27-8218-8f40d3470a54"
}
Archive Fine Tuned Model
Archive a fine-tuned model.
Authorizations:
path Parameters
model_id required | string (Model Id) Example: ft:open-mistral-7b:587a6b29:20240514:7e773925 The ID of the model to archive. |
Responses
Response samples
- 200
{- "id": "string",
- "object": "model",
- "archived": true
}
Unarchive Fine Tuned Model
Un-archive a fine-tuned model.
Authorizations:
path Parameters
model_id required | string (Model Id) Example: ft:open-mistral-7b:587a6b29:20240514:7e773925 The ID of the model to unarchive. |
Responses
Response samples
- 200
{- "id": "string",
- "object": "model",
- "archived": false
}
Get Batch Jobs
Get a list of batch jobs for your organization and user.
Authorizations:
query Parameters
page | integer (Page) Default: 0 |
page_size | integer (Page Size) Default: 100 |
Model (string) or Model (null) (Model) | |
Metadata (object) or Metadata (null) (Metadata) | |
Created After (string) or Created After (null) (Created After) | |
created_by_me | boolean (Created By Me) Default: false |
BatchJobStatus (string) or null |
Responses
Response samples
- 200
{- "data": [ ],
- "object": "list",
- "total": 0
}
Create Batch Job
Create a new batch job, it will be queued for processing.
Authorizations:
Request Body schema: application/jsonrequired
input_files required | Array of strings <uuid> (Input Files) [ items <uuid > ] |
endpoint required | string (ApiEndpoint) Enum: "/v1/chat/completions" "/v1/embeddings" "/v1/fim/completions" "/v1/moderations" |
model required | string (Model) |
Metadata (object) or Metadata (null) (Metadata) | |
timeout_hours | integer (Timeout Hours) Default: 24 |
Responses
Request samples
- Payload
{- "input_files": [
- "497f6eca-6276-4993-bfeb-53cbbbba6f08"
], - "endpoint": "/v1/chat/completions",
- "model": "string",
- "metadata": {
- "property1": "string",
- "property2": "string"
}, - "timeout_hours": 24
}
Response samples
- 200
{- "id": "string",
- "object": "batch",
- "input_files": [
- "497f6eca-6276-4993-bfeb-53cbbbba6f08"
], - "metadata": { },
- "endpoint": "string",
- "model": "string",
- "output_file": "c7c9cb17-f818-4ee3-85de-0d2f8954882c",
- "error_file": "6b79e6a4-c3aa-4da1-8fb4-9e2520d26bfa",
- "errors": [
- {
- "message": "string",
- "count": 1
}
], - "status": "QUEUED",
- "created_at": 0,
- "total_requests": 0,
- "completed_requests": 0,
- "succeeded_requests": 0,
- "failed_requests": 0,
- "started_at": 0,
- "completed_at": 0
}
Get Batch Job
Get a batch job details by its UUID.
Authorizations:
path Parameters
job_id required | string <uuid> (Job Id) |
Responses
Response samples
- 200
{- "id": "string",
- "object": "batch",
- "input_files": [
- "497f6eca-6276-4993-bfeb-53cbbbba6f08"
], - "metadata": { },
- "endpoint": "string",
- "model": "string",
- "output_file": "c7c9cb17-f818-4ee3-85de-0d2f8954882c",
- "error_file": "6b79e6a4-c3aa-4da1-8fb4-9e2520d26bfa",
- "errors": [
- {
- "message": "string",
- "count": 1
}
], - "status": "QUEUED",
- "created_at": 0,
- "total_requests": 0,
- "completed_requests": 0,
- "succeeded_requests": 0,
- "failed_requests": 0,
- "started_at": 0,
- "completed_at": 0
}
Cancel Batch Job
Request the cancellation of a batch job.
Authorizations:
path Parameters
job_id required | string <uuid> (Job Id) |
Responses
Response samples
- 200
{- "id": "string",
- "object": "batch",
- "input_files": [
- "497f6eca-6276-4993-bfeb-53cbbbba6f08"
], - "metadata": { },
- "endpoint": "string",
- "model": "string",
- "output_file": "c7c9cb17-f818-4ee3-85de-0d2f8954882c",
- "error_file": "6b79e6a4-c3aa-4da1-8fb4-9e2520d26bfa",
- "errors": [
- {
- "message": "string",
- "count": 1
}
], - "status": "QUEUED",
- "created_at": 0,
- "total_requests": 0,
- "completed_requests": 0,
- "succeeded_requests": 0,
- "failed_requests": 0,
- "started_at": 0,
- "completed_at": 0
}