openapi: 3.0.3 info: title: Mistral AI API description: "Our Chat Completion and Embeddings APIs specification. Create your\ \ account on [La Plateforme](https://console.mistral.ai) to get access and read\ \ the [docs](https://docs.mistral.ai) to learn how to use it." version: 0.0.2 servers: - url: https://api.mistral.ai/v1 description: Production server security: - ApiKey: [] tags: - name: chat description: Chat Completion API. x-displayName: Chat - name: fim description: Fill-in-the-middle API. x-displayName: FIM - name: agents description: Agents API. x-displayName: Agents - name: embeddings description: Embeddings API. x-displayName: Embeddings - name: classifiers description: Classifiers API. x-displayName: Classifiers - name: files description: Files API x-displayName: Files - name: fine-tuning description: Fine-tuning API x-displayName: Fine Tuning - name: models description: Model Management API x-displayName: Models - name: batch description: Batch API x-displayName: Batch - name: ocr description: OCR API x-displayName: OCR API paths: /models: get: tags: - models summary: List Models description: List all models available to the user. operationId: list_models_v1_models_get responses: "200": description: Successful Response content: application/json: schema: $ref: '#/components/schemas/ModelList' "422": description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /models/{modelId}: get: tags: - models summary: Retrieve Model description: Retrieve a model information. operationId: retrieve_model_v1_models__model_id__get parameters: - name: modelId in: path description: The ID of the model to retrieve. required: true style: simple explode: false schema: title: Model Id type: string example: ft:open-mistral-7b:587a6b29:20240514:7e773925 responses: "200": description: Successful Response content: application/json: schema: title: Response Retrieve Model V1 Models Model Id Get discriminator: propertyName: type mapping: base: '#/components/schemas/BaseModelCard' fine-tuned: '#/components/schemas/FTModelCard' oneOf: - $ref: '#/components/schemas/BaseModelCard' - $ref: '#/components/schemas/FTModelCard' "422": description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' delete: tags: - models summary: Delete Model description: Delete a fine-tuned model. operationId: delete_model_v1_models__model_id__delete parameters: - name: modelId in: path description: The ID of the model to delete. required: true style: simple explode: false schema: title: Model Id type: string example: ft:open-mistral-7b:587a6b29:20240514:7e773925 responses: "200": description: Successful Response content: application/json: schema: $ref: '#/components/schemas/DeleteModelOut' "422": description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /files: get: tags: - files summary: List Files description: Returns a list of files that belong to the user's organization. operationId: files_api_routes_list_files parameters: - name: page in: query required: false style: form explode: true schema: title: Page type: integer default: 0 - name: page_size in: query required: false style: form explode: true schema: title: Page Size type: integer default: 100 x-ballerina-name: pageSize - name: sample_type in: query required: false style: form explode: true schema: title: Sample Type type: array nullable: true items: $ref: '#/components/schemas/SampleType' x-ballerina-name: sampleType - name: source in: query required: false style: form explode: true schema: title: Source type: array nullable: true items: $ref: '#/components/schemas/Source' - name: search in: query required: false style: form explode: true schema: title: Search type: string nullable: true - name: purpose in: query required: false style: form explode: true schema: $ref: '#/components/schemas/FilePurpose' responses: "200": description: OK content: application/json: schema: $ref: '#/components/schemas/ListFilesOut' post: tags: - files summary: Upload File description: |- 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. operationId: files_api_routes_upload_file requestBody: content: multipart/form-data: schema: title: MultiPartBodyParams required: - file type: object properties: file: title: File type: string description: |- 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: ```bash file=@path/to/your/file.jsonl;filename=custom_name.jsonl ``` Otherwise, you can just keep the original file name: ```bash file=@path/to/your/file.jsonl ``` format: binary purpose: $ref: '#/components/schemas/FilePurpose' required: true responses: "200": description: OK content: application/json: schema: $ref: '#/components/schemas/UploadFileOut' /files/{fileId}: get: tags: - files summary: Retrieve File description: Returns information about a specific file. operationId: files_api_routes_retrieve_file parameters: - name: fileId in: path required: true style: simple explode: false schema: title: File Id type: string responses: "200": description: OK content: application/json: schema: $ref: '#/components/schemas/RetrieveFileOut' delete: tags: - files summary: Delete File description: Delete a file. operationId: files_api_routes_delete_file parameters: - name: fileId in: path required: true style: simple explode: false schema: title: File Id type: string responses: "200": description: OK content: application/json: schema: $ref: '#/components/schemas/DeleteFileOut' /files/{fileId}/content: get: tags: - files summary: Download File description: Download a file operationId: files_api_routes_download_file parameters: - name: fileId in: path required: true style: simple explode: false schema: title: File Id type: string responses: "200": description: OK content: application/octet-stream: schema: type: string format: binary /files/{fileId}/url: get: tags: - files summary: Get Signed Url operationId: files_api_routes_get_signed_url parameters: - name: fileId in: path required: true style: simple explode: false schema: title: File Id type: string - name: expiry in: query description: Number of hours before the url becomes invalid. Defaults to 24h required: false style: form explode: true schema: title: Expiry type: integer description: Number of hours before the url becomes invalid. Defaults to 24h default: 24 responses: "200": description: OK content: application/json: schema: $ref: '#/components/schemas/FileSignedURL' /fine_tuning/jobs: get: tags: - fine-tuning summary: Get Fine Tuning Jobs description: Get a list of fine-tuning jobs for your organization and user. operationId: jobs_api_routes_fine_tuning_get_fine_tuning_jobs parameters: - name: page in: query description: The page number of the results to be returned. required: false style: form explode: true schema: title: Page type: integer default: 0 - name: page_size in: query description: The number of items to return per page. required: false style: form explode: true schema: title: Page Size type: integer default: 100 x-ballerina-name: pageSize - name: model in: query description: "The model name used for fine-tuning to filter on. When set,\ \ the other results are not displayed." required: false style: form explode: true schema: title: Model type: string nullable: true - name: created_after in: query description: "The date/time to filter on. When set, the results for previous\ \ creation times are not displayed." required: false style: form explode: true schema: title: Created After type: string format: date-time nullable: true x-ballerina-name: createdAfter - name: created_by_me in: query description: "When set, only return results for jobs created by the API caller.\ \ Other results are not displayed." required: false style: form explode: true schema: title: Created By Me type: boolean default: false x-ballerina-name: createdByMe - name: status in: query description: "The current job state to filter on. When set, the other results\ \ are not displayed." required: false style: form explode: true schema: title: Status type: string nullable: true enum: - QUEUED - STARTED - VALIDATING - VALIDATED - RUNNING - FAILED_VALIDATION - FAILED - SUCCESS - CANCELLED - CANCELLATION_REQUESTED - name: wandb_project in: query description: "The Weights and Biases project to filter on. When set, the other\ \ results are not displayed." required: false style: form explode: true schema: title: Wandb Project type: string nullable: true x-ballerina-name: wandbProject - name: wandb_name in: query description: "The Weight and Biases run name to filter on. When set, the other\ \ results are not displayed." required: false style: form explode: true schema: title: Wandb Name type: string nullable: true x-ballerina-name: wandbName - name: suffix in: query description: "The model suffix to filter on. When set, the other results are\ \ not displayed." required: false style: form explode: true schema: title: Suffix type: string nullable: true responses: "200": description: OK content: application/json: schema: $ref: '#/components/schemas/JobsOut' post: tags: - fine-tuning summary: Create Fine Tuning Job description: "Create a new fine-tuning job, it will be queued for processing." operationId: jobs_api_routes_fine_tuning_create_fine_tuning_job parameters: - name: dry_run in: query description: | * If `true` the job is not spawned, instead the query returns a handful of useful metadata for the user to perform sanity checks (see `LegacyJobMetadataOut` response). * Otherwise, the job is started and the query returns the job ID along with some of the input parameters (see `JobOut` response). required: false style: form explode: true schema: title: Dry Run type: boolean nullable: true x-ballerina-name: dryRun requestBody: content: application/json: schema: $ref: '#/components/schemas/JobIn' required: true responses: "200": description: OK content: application/json: schema: title: Response anyOf: - $ref: '#/components/schemas/JobOut' - $ref: '#/components/schemas/LegacyJobMetadataOut' /fine_tuning/jobs/{jobId}: get: tags: - fine-tuning summary: Get Fine Tuning Job description: Get a fine-tuned job details by its UUID. operationId: jobs_api_routes_fine_tuning_get_fine_tuning_job parameters: - name: jobId in: path description: The ID of the job to analyse. required: true style: simple explode: false schema: title: Job Id type: string format: uuid responses: "200": description: OK content: application/json: schema: $ref: '#/components/schemas/DetailedJobOut' /fine_tuning/jobs/{jobId}/cancel: post: tags: - fine-tuning summary: Cancel Fine Tuning Job description: Request the cancellation of a fine tuning job. operationId: jobs_api_routes_fine_tuning_cancel_fine_tuning_job parameters: - name: jobId in: path description: The ID of the job to cancel. required: true style: simple explode: false schema: title: Job Id type: string format: uuid responses: "200": description: OK content: application/json: schema: $ref: '#/components/schemas/DetailedJobOut' /fine_tuning/jobs/{jobId}/start: post: tags: - fine-tuning summary: Start Fine Tuning Job description: Request the start of a validated fine tuning job. operationId: jobs_api_routes_fine_tuning_start_fine_tuning_job parameters: - name: jobId in: path required: true style: simple explode: false schema: title: Job Id type: string format: uuid responses: "200": description: OK content: application/json: schema: $ref: '#/components/schemas/DetailedJobOut' /fine_tuning/models/{modelId}: patch: tags: - models summary: Update Fine Tuned Model description: Update a model name or description. operationId: jobs_api_routes_fine_tuning_update_fine_tuned_model parameters: - name: modelId in: path description: The ID of the model to update. required: true style: simple explode: false schema: title: Model Id type: string example: ft:open-mistral-7b:587a6b29:20240514:7e773925 requestBody: content: application/json: schema: $ref: '#/components/schemas/UpdateFTModelIn' required: true responses: "200": description: OK content: application/json: schema: $ref: '#/components/schemas/FTModelOut' /fine_tuning/models/{modelId}/archive: post: tags: - models summary: Archive Fine Tuned Model description: Archive a fine-tuned model. operationId: jobs_api_routes_fine_tuning_archive_fine_tuned_model parameters: - name: modelId in: path description: The ID of the model to archive. required: true style: simple explode: false schema: title: Model Id type: string example: ft:open-mistral-7b:587a6b29:20240514:7e773925 responses: "200": description: OK content: application/json: schema: $ref: '#/components/schemas/ArchiveFTModelOut' delete: tags: - models summary: Unarchive Fine Tuned Model description: Un-archive a fine-tuned model. operationId: jobs_api_routes_fine_tuning_unarchive_fine_tuned_model parameters: - name: modelId in: path description: The ID of the model to unarchive. required: true style: simple explode: false schema: title: Model Id type: string example: ft:open-mistral-7b:587a6b29:20240514:7e773925 responses: "200": description: OK content: application/json: schema: $ref: '#/components/schemas/UnarchiveFTModelOut' /batch/jobs: get: tags: - batch summary: Get Batch Jobs description: Get a list of batch jobs for your organization and user. operationId: jobs_api_routes_batch_get_batch_jobs parameters: - name: page in: query required: false style: form explode: true schema: title: Page type: integer default: 0 - name: page_size in: query required: false style: form explode: true schema: title: Page Size type: integer default: 100 x-ballerina-name: pageSize - name: model in: query required: false style: form explode: true schema: title: Model type: string nullable: true - name: metadata in: query required: false style: form explode: true schema: title: Metadata type: object additionalProperties: true nullable: true - name: created_after in: query required: false style: form explode: true schema: title: Created After type: string format: date-time nullable: true x-ballerina-name: createdAfter - name: created_by_me in: query required: false style: form explode: true schema: title: Created By Me type: boolean default: false x-ballerina-name: createdByMe - name: status in: query required: false style: form explode: true schema: $ref: '#/components/schemas/BatchJobStatus' responses: "200": description: OK content: application/json: schema: $ref: '#/components/schemas/BatchJobsOut' post: tags: - batch summary: Create Batch Job description: "Create a new batch job, it will be queued for processing." operationId: jobs_api_routes_batch_create_batch_job requestBody: content: application/json: schema: $ref: '#/components/schemas/BatchJobIn' required: true responses: "200": description: OK content: application/json: schema: $ref: '#/components/schemas/BatchJobOut' /batch/jobs/{jobId}: get: tags: - batch summary: Get Batch Job description: Get a batch job details by its UUID. operationId: jobs_api_routes_batch_get_batch_job parameters: - name: jobId in: path required: true style: simple explode: false schema: title: Job Id type: string format: uuid responses: "200": description: OK content: application/json: schema: $ref: '#/components/schemas/BatchJobOut' /batch/jobs/{jobId}/cancel: post: tags: - batch summary: Cancel Batch Job description: Request the cancellation of a batch job. operationId: jobs_api_routes_batch_cancel_batch_job parameters: - name: jobId in: path required: true style: simple explode: false schema: title: Job Id type: string format: uuid responses: "200": description: OK content: application/json: schema: $ref: '#/components/schemas/BatchJobOut' /chat/completions: post: tags: - chat summary: Chat Completion operationId: chat_completion_v1_chat_completions_post requestBody: content: application/json: schema: $ref: '#/components/schemas/ChatCompletionRequest' required: true responses: "200": description: Successful Response content: application/json: schema: $ref: '#/components/schemas/ChatCompletionResponse' text/event-stream: schema: $ref: '#/components/schemas/CompletionEvent' "422": description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /fim/completions: post: tags: - fim summary: Fim Completion description: FIM completion. operationId: fim_completion_v1_fim_completions_post requestBody: content: application/json: schema: $ref: '#/components/schemas/FIMCompletionRequest' required: true responses: "200": description: Successful Response content: application/json: schema: $ref: '#/components/schemas/FIMCompletionResponse' text/event-stream: schema: $ref: '#/components/schemas/CompletionEvent' "422": description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /ocr: post: tags: - ocr summary: OCR operationId: ocr_v1_ocr_post requestBody: content: application/json: schema: $ref: '#/components/schemas/OCRRequest' required: true responses: "200": description: Successful Response content: application/json: schema: $ref: '#/components/schemas/OCRResponse' "422": description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /moderations: post: tags: - classifiers summary: Moderations operationId: moderations_v1_moderations_post requestBody: content: application/json: schema: $ref: '#/components/schemas/ClassificationRequest' required: true responses: "200": description: Successful Response content: application/json: schema: $ref: '#/components/schemas/ClassificationResponse' "422": description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /chat/moderations: post: tags: - classifiers summary: Moderations Chat operationId: moderations_chat_v1_chat_moderations_post requestBody: content: application/json: schema: $ref: '#/components/schemas/ChatModerationRequest' required: true responses: "200": description: Successful Response content: application/json: schema: $ref: '#/components/schemas/ClassificationResponse' "422": description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /embeddings: post: tags: - embeddings summary: Embeddings description: Embeddings operationId: embeddings_v1_embeddings_post requestBody: content: application/json: schema: $ref: '#/components/schemas/EmbeddingRequest' required: true responses: "200": description: Successful Response content: application/json: schema: $ref: '#/components/schemas/EmbeddingResponse' "422": description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /agents/completions: post: tags: - agents summary: Agents Completion operationId: agents_completion_v1_agents_completions_post requestBody: content: application/json: schema: $ref: '#/components/schemas/AgentsCompletionRequest' required: true responses: "200": description: Successful Response content: application/json: schema: $ref: '#/components/schemas/ChatCompletionResponse' "422": description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' components: schemas: ToolCall: title: ToolCall required: - function type: object properties: function: $ref: '#/components/schemas/FunctionCall' index: title: Index type: integer default: 0 id: title: Id type: string default: "null" type: $ref: '#/components/schemas/ToolTypes' additionalProperties: false CompletionEvent: title: CompletionEvent required: - data type: object properties: data: $ref: '#/components/schemas/CompletionChunk' JsonSchema: title: JsonSchema required: - name - schema type: object properties: schema: title: Schema type: object additionalProperties: true x-speakeasy-name-override: schema_definition name: title: Name type: string description: title: Description type: string nullable: true strict: title: Strict type: boolean default: false additionalProperties: false CompletionChunk: title: CompletionChunk required: - choices - id - model type: object properties: created: type: integer usage: $ref: '#/components/schemas/UsageInfo' model: type: string id: type: string choices: type: array items: $ref: '#/components/schemas/CompletionResponseStreamChoice' object: type: string OCRRequest: title: OCRRequest required: - document - model type: object properties: pages: title: Pages type: array description: "Specific pages user wants to process in various formats: single\ \ number, range, or list of both. Starts from 0" nullable: true items: type: integer image_min_size: title: Image Min Size type: integer description: Minimum height and width of image to extract nullable: true x-ballerina-name: imageMinSize document: title: Document description: Document to run OCR on anyOf: - $ref: '#/components/schemas/DocumentURLChunk' - $ref: '#/components/schemas/ImageURLChunk' include_image_base64: title: Include Image Base64 type: boolean description: Include image URLs in response nullable: true x-ballerina-name: includeImageBase64 image_limit: title: Image Limit type: integer description: Max images to extract nullable: true x-ballerina-name: imageLimit model: title: Model type: string nullable: true id: title: Id type: string additionalProperties: false ChatCompletionChoice: title: ChatCompletionChoice required: - finish_reason - index - message type: object properties: finish_reason: type: string example: stop enum: - stop - length - model_length - error - tool_calls x-ballerina-name: finishReason index: type: integer example: 0 message: $ref: '#/components/schemas/AssistantMessage' FilePurpose: title: FilePurpose type: string enum: - fine-tune - batch LegacyJobMetadataOut: title: LegacyJobMetadataOut required: - details type: object properties: data_tokens: title: Data Tokens type: integer description: The total number of tokens in the training dataset. nullable: true x-ballerina-name: dataTokens train_tokens_per_step: title: Train Tokens Per Step type: integer description: The number of tokens consumed by one training step. nullable: true x-ballerina-name: trainTokensPerStep cost: title: Cost type: number description: The cost of the fine-tuning job. nullable: true cost_currency: title: Cost Currency type: string description: The currency used for the fine-tuning job cost. nullable: true example: "[\"EUR\"]" x-ballerina-name: costCurrency estimated_start_time: title: Estimated Start Time type: integer nullable: true x-ballerina-name: estimatedStartTime expected_duration_seconds: title: Expected Duration Seconds type: integer description: The approximated time (in seconds) for the fine-tuning process to complete. nullable: true x-ballerina-name: expectedDurationSeconds deprecated: title: Deprecated type: boolean default: true details: title: Details type: string train_tokens: title: Train Tokens type: integer description: The total number of tokens used during the fine-tuning process. nullable: true x-ballerina-name: trainTokens epochs: title: Epochs type: number description: The number of complete passes through the entire training dataset. nullable: true training_steps: title: Training Steps type: integer description: The number of training steps to perform. A training step refers to a single update of the model weights during the fine-tuning process. This update is typically calculated using a batch of samples from the training dataset. nullable: true x-ballerina-name: trainingSteps object: title: Object type: string enum: - job.metadata default: job.metadata FunctionName: title: FunctionName required: - name type: object properties: name: title: Name type: string additionalProperties: false description: this restriction of `Function` is used to select a specific function to call DeltaMessage: title: DeltaMessage type: object properties: role: type: string nullable: true tool_calls: type: array nullable: true items: $ref: '#/components/schemas/ToolCall' x-ballerina-name: toolCalls content: nullable: true anyOf: - type: string - type: array items: $ref: '#/components/schemas/ContentChunk' DeleteFileOut: title: DeleteFileOut required: - deleted - id - object type: object properties: deleted: title: Deleted type: boolean description: The deletion status. example: false id: title: Id type: string description: The ID of the deleted file. format: uuid object: title: Object type: string description: The object type that was deleted example: "[\"file\"]" DocumentURLChunk: title: DocumentURLChunk required: - document_url type: object properties: document_name: title: Document Name type: string description: The filename of the document nullable: true x-ballerina-name: documentName type: title: Type type: string default: document_url document_url: title: Document Url type: string x-ballerina-name: documentUrl additionalProperties: false ArchiveFTModelOut: title: ArchiveFTModelOut required: - id type: object properties: archived: title: Archived type: boolean default: true id: title: Id type: string object: title: Object type: string enum: - model default: model OCRResponse: title: OCRResponse required: - model - pages - usage_info type: object properties: pages: title: Pages type: array description: List of OCR info for pages. items: $ref: '#/components/schemas/OCRPageObject' model: title: Model type: string description: The model used to generate the OCR. usage_info: allOf: - $ref: '#/components/schemas/OCRUsageInfo' x-ballerina-name: usageInfo additionalProperties: false RetrieveFileOut: title: RetrieveFileOut required: - bytes - created_at - deleted - filename - id - object - purpose - sample_type - source type: object properties: filename: title: Filename type: string description: The name of the uploaded file. example: "[\"files_upload.jsonl\"]" deleted: title: Deleted type: boolean purpose: $ref: '#/components/schemas/FilePurpose' bytes: title: Bytes type: integer description: "The size of the file, in bytes." created_at: title: Created At type: integer description: The UNIX timestamp (in seconds) of the event. x-ballerina-name: createdAt id: title: Id type: string description: The unique identifier of the file. format: uuid source: $ref: '#/components/schemas/Source' sample_type: allOf: - $ref: '#/components/schemas/SampleType' x-ballerina-name: sampleType num_lines: title: Num Lines type: integer nullable: true x-ballerina-name: numLines object: title: Object type: string description: "The object type, which is always \"file\"." example: "[\"file\"]" GithubRepositoryIn: title: GithubRepositoryIn required: - name - owner - token type: object properties: owner: title: Owner type: string ref: title: Ref type: string nullable: true name: title: Name type: string weight: title: Weight minimum: 0 exclusiveMinimum: true type: number default: 1 type: title: Type type: string enum: - github default: github token: title: Token type: string EventOut: title: EventOut required: - created_at - name type: object properties: data: title: Data type: object additionalProperties: true nullable: true name: title: Name type: string description: The name of the event. created_at: title: Created At type: integer description: The UNIX timestamp (in seconds) of the event. x-ballerina-name: createdAt ValidationError: title: ValidationError required: - loc - msg - type type: object properties: msg: title: Message type: string loc: title: Location type: array items: anyOf: - type: string - type: integer type: title: Error Type type: string FileSchema: title: FileSchema required: - bytes - created_at - filename - id - object - purpose - sample_type - source type: object properties: filename: title: Filename type: string description: The name of the uploaded file. example: "[\"files_upload.jsonl\"]" purpose: $ref: '#/components/schemas/FilePurpose' bytes: title: Bytes type: integer description: "The size of the file, in bytes." created_at: title: Created At type: integer description: The UNIX timestamp (in seconds) of the event. x-ballerina-name: createdAt id: title: Id type: string description: The unique identifier of the file. format: uuid source: $ref: '#/components/schemas/Source' sample_type: allOf: - $ref: '#/components/schemas/SampleType' x-ballerina-name: sampleType num_lines: title: Num Lines type: integer nullable: true x-ballerina-name: numLines object: title: Object type: string description: "The object type, which is always \"file\"." example: "[\"file\"]" TrainingParametersIn: title: TrainingParametersIn type: object properties: fim_ratio: title: Fim Ratio maximum: 1 minimum: 0 type: number nullable: true default: 0.9 x-ballerina-name: fimRatio weight_decay: title: Weight Decay maximum: 1 minimum: 0 type: number description: (Advanced Usage) Weight decay adds a term to the loss function that is proportional to the sum of the squared weights. This term reduces the magnitude of the weights and prevents them from growing too large. nullable: true default: 0.1 x-ballerina-name: weightDecay training_steps: title: Training Steps minimum: 1 type: integer description: The number of training steps to perform. A training step refers to a single update of the model weights during the fine-tuning process. This update is typically calculated using a batch of samples from the training dataset. nullable: true x-ballerina-name: trainingSteps learning_rate: title: Learning Rate maximum: 1 minimum: 0.000000010 type: number description: A parameter describing how much to adjust the pre-trained model's weights in response to the estimated error each time the weights are updated during the fine-tuning process. default: 0.00010 x-ballerina-name: learningRate epochs: title: Epochs minimum: 0 exclusiveMinimum: true type: number nullable: true seq_len: title: Seq Len minimum: 100 type: integer nullable: true x-ballerina-name: seqLen warmup_fraction: title: Warmup Fraction maximum: 1 minimum: 0 type: number description: "(Advanced Usage) A parameter that specifies the percentage\ \ of the total training steps at which the learning rate warm-up phase\ \ ends. During this phase, the learning rate gradually increases from\ \ a small value to the initial learning rate, helping to stabilize the\ \ training process and improve convergence. Similar to `pct_start` in\ \ [mistral-finetune](https://github.com/mistralai/mistral-finetune)" nullable: true default: 0.05 x-ballerina-name: warmupFraction description: The fine-tuning hyperparameter settings used in a fine-tune job. ToolMessage: title: ToolMessage required: - content type: object properties: role: type: string enum: - tool default: tool tool_call_id: title: Tool Call Id type: string nullable: true x-ballerina-name: toolCallId name: title: Name type: string nullable: true content: title: Content nullable: true anyOf: - type: string - type: array items: $ref: '#/components/schemas/ContentChunk' additionalProperties: false FTModelCard: title: FTModelCard required: - capabilities - id - job - root type: object properties: capabilities: $ref: '#/components/schemas/ModelCapabilities' aliases: title: Aliases type: array items: type: string default: [] created: title: Created type: integer description: title: Description type: string nullable: true owned_by: title: Owned By type: string default: mistralai x-ballerina-name: ownedBy deprecation: title: Deprecation type: string format: date-time nullable: true type: title: Type type: string enum: - fine-tuned default: fine-tuned archived: title: Archived type: boolean default: false max_context_length: title: Max Context Length type: integer default: 32768 x-ballerina-name: maxContextLength root: title: Root type: string name: title: Name type: string nullable: true default_model_temperature: title: Default Model Temperature type: number nullable: true x-ballerina-name: defaultModelTemperature id: title: Id type: string job: title: Job type: string object: title: Object type: string default: model description: Extra fields for fine-tuned models. Tool: title: Tool required: - function type: object properties: function: $ref: '#/components/schemas/Function' type: $ref: '#/components/schemas/ToolTypes' additionalProperties: false FTModelCapabilitiesOut: title: FTModelCapabilitiesOut type: object properties: completion_chat: title: Completion Chat type: boolean default: true x-ballerina-name: completionChat function_calling: title: Function Calling type: boolean default: false x-ballerina-name: functionCalling fine_tuning: title: Fine Tuning type: boolean default: false x-ballerina-name: fineTuning completion_fim: title: Completion Fim type: boolean default: false x-ballerina-name: completionFim BatchJobsOut: title: BatchJobsOut required: - total type: object properties: total: title: Total type: integer data: title: Data type: array items: $ref: '#/components/schemas/BatchJobOut' default: [] object: title: Object type: string enum: - list default: list ResponseFormat: title: ResponseFormat type: object properties: json_schema: allOf: - $ref: '#/components/schemas/JsonSchema' x-ballerina-name: jsonSchema type: $ref: '#/components/schemas/ResponseFormats' additionalProperties: false UnarchiveFTModelOut: title: UnarchiveFTModelOut required: - id type: object properties: archived: title: Archived type: boolean default: false id: title: Id type: string object: title: Object type: string enum: - model default: model AssistantMessage: title: AssistantMessage type: object properties: role: title: Role type: string enum: - assistant default: assistant prefix: title: Prefix type: boolean description: Set this to `true` when adding an assistant message as prefix to condition the model response. The role of the prefix message is to force the model to start its answer by the content of the message. default: false tool_calls: title: Tool Calls type: array nullable: true items: $ref: '#/components/schemas/ToolCall' x-ballerina-name: toolCalls content: title: Content nullable: true anyOf: - type: string - type: array items: $ref: '#/components/schemas/ContentChunk' additionalProperties: false CompletionResponseStreamChoice: title: CompletionResponseStreamChoice required: - delta - finish_reason - index type: object properties: finish_reason: type: string nullable: true enum: - stop - length - error - tool_calls - null x-ballerina-name: finishReason delta: $ref: '#/components/schemas/DeltaMessage' index: type: integer Prediction: title: Prediction type: object properties: type: title: Type type: string default: content content: title: Content type: string default: "" additionalProperties: false GithubRepositoryOut: title: GithubRepositoryOut required: - commit_id - name - owner type: object properties: owner: title: Owner type: string ref: title: Ref type: string nullable: true name: title: Name type: string weight: title: Weight minimum: 0 exclusiveMinimum: true type: number default: 1 type: title: Type type: string enum: - github default: github commit_id: title: Commit Id maxLength: 40 minLength: 40 type: string x-ballerina-name: commitId ImageURL: title: ImageURL required: - url type: object properties: detail: title: Detail type: string nullable: true url: title: Url type: string additionalProperties: false ChatModerationRequest: title: ChatModerationRequest required: - input - model type: object properties: truncate_for_context_length: title: Truncate For Context Length type: boolean default: false x-ballerina-name: truncateForContextLength input: title: Input description: Chat to classify anyOf: - type: array items: discriminator: propertyName: role mapping: assistant: '#/components/schemas/AssistantMessage' system: '#/components/schemas/SystemMessage' tool: '#/components/schemas/ToolMessage' user: '#/components/schemas/UserMessage' oneOf: - $ref: '#/components/schemas/SystemMessage' - $ref: '#/components/schemas/UserMessage' - $ref: '#/components/schemas/AssistantMessage' - $ref: '#/components/schemas/ToolMessage' - type: array items: type: array items: discriminator: propertyName: role mapping: assistant: '#/components/schemas/AssistantMessage' system: '#/components/schemas/SystemMessage' tool: '#/components/schemas/ToolMessage' user: '#/components/schemas/UserMessage' oneOf: - $ref: '#/components/schemas/SystemMessage' - $ref: '#/components/schemas/UserMessage' - $ref: '#/components/schemas/AssistantMessage' - $ref: '#/components/schemas/ToolMessage' model: title: Model type: string additionalProperties: false TextChunk: title: TextChunk required: - text type: object properties: text: title: Text type: string type: title: Type type: string enum: - text default: text additionalProperties: false ModelCapabilities: title: ModelCapabilities type: object properties: completion_chat: title: Completion Chat type: boolean default: true x-ballerina-name: completionChat function_calling: title: Function Calling type: boolean default: true x-ballerina-name: functionCalling vision: title: Vision type: boolean default: false fine_tuning: title: Fine Tuning type: boolean default: false x-ballerina-name: fineTuning completion_fim: title: Completion Fim type: boolean default: false x-ballerina-name: completionFim WandbIntegrationOut: title: WandbIntegrationOut required: - project type: object properties: name: title: Name type: string description: "A display name to set for the run. If not set, will use the\ \ job ID as the name." nullable: true project: title: Project type: string description: The name of the project that the new run will be created under. type: title: Type type: string enum: - wandb default: wandb run_name: title: Run Name type: string nullable: true x-ballerina-name: runName ChatCompletionResponse: allOf: - $ref: '#/components/schemas/ChatCompletionResponseBase' - title: ChatCompletionResponse required: - data - id - model - object - usage type: object properties: choices: type: array items: $ref: '#/components/schemas/ChatCompletionChoice' EmbeddingResponseData: title: EmbeddingResponseData type: object properties: index: type: integer example: 0 embedding: type: array example: - 0.1 - 0.2 - 0.3 items: type: number object: type: string example: embedding example: - object: embedding embedding: - 0.1 - 0.2 - 0.3 index: 0 - object: embedding embedding: - 0.4 - 0.5 - 0.6 index: 1 ListFilesOut: title: ListFilesOut required: - data - object - total type: object properties: total: title: Total type: integer data: title: Data type: array items: $ref: '#/components/schemas/FileSchema' object: title: Object type: string TrainingFile: title: TrainingFile required: - file_id type: object properties: file_id: title: File Id type: string format: uuid x-ballerina-name: fileId weight: title: Weight minimum: 0 exclusiveMinimum: true type: number default: 1 FTModelOut: title: FTModelOut required: - archived - capabilities - created - id - job - owned_by - root type: object properties: archived: title: Archived type: boolean capabilities: $ref: '#/components/schemas/FTModelCapabilitiesOut' aliases: title: Aliases type: array items: type: string default: [] max_context_length: title: Max Context Length type: integer default: 32768 x-ballerina-name: maxContextLength created: title: Created type: integer root: title: Root type: string name: title: Name type: string nullable: true description: title: Description type: string nullable: true owned_by: title: Owned By type: string x-ballerina-name: ownedBy id: title: Id type: string job: title: Job type: string format: uuid object: title: Object type: string enum: - model default: model OCRPageObject: title: OCRPageObject required: - dimensions - images - index - markdown type: object properties: images: title: Images type: array description: List of all extracted images in the page items: $ref: '#/components/schemas/OCRImageObject' markdown: title: Markdown type: string description: The markdown string response of the page index: title: Index minimum: 0 type: integer description: The page index in a pdf document starting from 0 dimensions: $ref: '#/components/schemas/OCRPageDimensions' additionalProperties: false ToolTypes: title: ToolTypes type: string enum: - function FileSignedURL: title: FileSignedURL required: - url type: object properties: url: title: Url type: string ToolChoice: title: ToolChoice required: - function type: object properties: function: $ref: '#/components/schemas/FunctionName' type: $ref: '#/components/schemas/ToolTypes' additionalProperties: false description: ToolChoice is either a ToolChoiceEnum or a ToolChoice ClassificationRequest: title: ClassificationRequest required: - input - model type: object properties: input: title: Input description: Text to classify. anyOf: - type: string - type: array items: type: string model: title: Model type: string description: ID of the model to use. additionalProperties: false FineTuneableModel: title: FineTuneableModel type: string description: The name of the model to fine-tune. enum: - open-mistral-7b - mistral-small-latest - codestral-latest - mistral-large-latest - open-mistral-nemo - ministral-3b-latest BaseModelCard: title: BaseModelCard required: - capabilities - id type: object properties: capabilities: $ref: '#/components/schemas/ModelCapabilities' aliases: title: Aliases type: array items: type: string default: [] max_context_length: title: Max Context Length type: integer default: 32768 x-ballerina-name: maxContextLength created: title: Created type: integer name: title: Name type: string nullable: true default_model_temperature: title: Default Model Temperature type: number nullable: true x-ballerina-name: defaultModelTemperature description: title: Description type: string nullable: true owned_by: title: Owned By type: string default: mistralai x-ballerina-name: ownedBy id: title: Id type: string deprecation: title: Deprecation type: string format: date-time nullable: true type: title: Type type: string enum: - base default: base object: title: Object type: string default: model WandbIntegration: title: WandbIntegration required: - api_key - project type: object properties: api_key: title: Api Key maxLength: 40 minLength: 40 type: string description: The WandB API key to use for authentication. x-ballerina-name: apiKey name: title: Name type: string description: "A display name to set for the run. If not set, will use the\ \ job ID as the name." nullable: true project: title: Project type: string description: The name of the project that the new run will be created under. type: title: Type type: string enum: - wandb default: wandb run_name: title: Run Name type: string nullable: true x-ballerina-name: runName ResponseFormats: title: ResponseFormats type: string description: "An object specifying the format that the model must output. Setting\ \ to `{ \"type\": \"json_object\" }` enables JSON mode, which guarantees the\ \ message the model generates is in JSON. When using JSON mode you MUST also\ \ instruct the model to produce JSON yourself with a system or a user message." enum: - text - json_object - json_schema FIMCompletionRequest: title: FIMCompletionRequest required: - model - prompt type: object properties: top_p: title: Top P maximum: 1 minimum: 0 type: number description: "Nucleus sampling, where the model considers the results of\ \ the tokens with `top_p` probability mass. So 0.1 means only the tokens\ \ comprising the top 10% probability mass are considered. We generally\ \ recommend altering this or `temperature` but not both." default: 1 x-ballerina-name: topP random_seed: title: Random Seed minimum: 0 type: integer description: "The seed to use for random sampling. If set, different calls\ \ will generate deterministic results." nullable: true x-ballerina-name: randomSeed stop: title: Stop description: Stop generation if this token is detected. Or if one of these tokens is detected when providing an array anyOf: - type: string - type: array items: type: string max_tokens: title: Max Tokens minimum: 0 type: integer description: The maximum number of tokens to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model's context length. nullable: true x-ballerina-name: maxTokens stream: title: Stream type: boolean description: "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." default: false temperature: title: Temperature maximum: 1.5 minimum: 0 type: number description: "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` but not both. The default\ \ value varies depending on the model you are targeting. Call the `/models`\ \ endpoint to retrieve the appropriate value." nullable: true model: title: Model type: string description: |- ID of the model to use. Only compatible for now with: - `codestral-2405` - `codestral-latest` example: "[\"codestral-2405\"]" default: codestral-2405 suffix: title: Suffix type: string description: "Optional text/code that adds more context for the model. When\ \ given a `prompt` and a `suffix` the model will fill what is between\ \ them. When `suffix` is not provided, the model will simply execute completion\ \ starting with `prompt`." nullable: true example: "[\"return a+b\"]" default: "" prompt: title: Prompt type: string description: The text/code to complete. example: "[\"def\"]" min_tokens: title: Min Tokens minimum: 0 type: integer description: The minimum number of tokens to generate in the completion. nullable: true x-ballerina-name: minTokens additionalProperties: false SystemMessage: title: SystemMessage required: - content type: object properties: role: type: string enum: - system default: system content: title: Content anyOf: - type: string - type: array items: $ref: '#/components/schemas/TextChunk' additionalProperties: false ContentChunk: title: ContentChunk discriminator: propertyName: type mapping: image_url: '#/components/schemas/ImageURLChunk' document_url: '#/components/schemas/DocumentURLChunk' text: '#/components/schemas/TextChunk' reference: '#/components/schemas/ReferenceChunk' oneOf: - $ref: '#/components/schemas/TextChunk' - $ref: '#/components/schemas/ImageURLChunk' - $ref: '#/components/schemas/DocumentURLChunk' - $ref: '#/components/schemas/ReferenceChunk' AgentsCompletionRequest: title: AgentsCompletionRequest required: - agent_id - messages type: object properties: random_seed: title: Random Seed minimum: 0 type: integer description: "The seed to use for random sampling. If set, different calls\ \ will generate deterministic results." nullable: true x-ballerina-name: randomSeed agent_id: type: string description: The ID of the agent to use for this completion. x-ballerina-name: agentId max_tokens: title: Max Tokens minimum: 0 type: integer description: The maximum number of tokens to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model's context length. nullable: true x-ballerina-name: maxTokens presence_penalty: title: Presence Penalty maximum: 2 minimum: -2 type: number description: "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." default: 0 x-ballerina-name: presencePenalty tools: title: Tools type: array nullable: true items: $ref: '#/components/schemas/Tool' "n": title: "N" minimum: 1 type: integer description: "Number of completions to return for each request, input tokens\ \ are only billed once." nullable: true response_format: allOf: - $ref: '#/components/schemas/ResponseFormat' x-ballerina-name: responseFormat frequency_penalty: title: Frequency Penalty maximum: 2 minimum: -2 type: number description: "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." default: 0 x-ballerina-name: frequencyPenalty stop: title: Stop description: Stop generation if this token is detected. Or if one of these tokens is detected when providing an array anyOf: - type: string - type: array items: type: string stream: title: Stream type: boolean description: "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." default: false prediction: $ref: '#/components/schemas/Prediction' messages: title: Messages type: array description: "The prompt(s) to generate completions for, encoded as a list\ \ of dict with role and content." example: - - role: user content: Who is the best French painter? Answer in one short sentence. items: discriminator: propertyName: role mapping: assistant: '#/components/schemas/AssistantMessage' system: '#/components/schemas/SystemMessage' tool: '#/components/schemas/ToolMessage' user: '#/components/schemas/UserMessage' oneOf: - $ref: '#/components/schemas/SystemMessage' - $ref: '#/components/schemas/UserMessage' - $ref: '#/components/schemas/AssistantMessage' - $ref: '#/components/schemas/ToolMessage' tool_choice: title: Tool Choice anyOf: - $ref: '#/components/schemas/ToolChoice' - $ref: '#/components/schemas/ToolChoiceEnum' default: auto x-ballerina-name: toolChoice additionalProperties: false ChatCompletionResponseBase: allOf: - $ref: '#/components/schemas/ResponseBase' - title: ChatCompletionResponseBase type: object properties: created: type: integer example: 1702256327 JobMetadataOut: title: JobMetadataOut type: object properties: data_tokens: title: Data Tokens type: integer nullable: true x-ballerina-name: dataTokens train_tokens_per_step: title: Train Tokens Per Step type: integer nullable: true x-ballerina-name: trainTokensPerStep cost: title: Cost type: number nullable: true cost_currency: title: Cost Currency type: string nullable: true x-ballerina-name: costCurrency estimated_start_time: title: Estimated Start Time type: integer nullable: true x-ballerina-name: estimatedStartTime expected_duration_seconds: title: Expected Duration Seconds type: integer nullable: true x-ballerina-name: expectedDurationSeconds train_tokens: title: Train Tokens type: integer nullable: true x-ballerina-name: trainTokens ApiEndpoint: title: ApiEndpoint type: string enum: - /chat/completions - /embeddings - /fim/completions - /moderations - /chat/moderations UserMessage: title: UserMessage required: - content type: object properties: role: type: string enum: - user default: user content: title: Content nullable: true anyOf: - type: string - type: array items: $ref: '#/components/schemas/ContentChunk' additionalProperties: false BatchJobStatus: title: BatchJobStatus type: string enum: - QUEUED - RUNNING - SUCCESS - FAILED - TIMEOUT_EXCEEDED - CANCELLATION_REQUESTED - CANCELLED Source: title: Source type: string enum: - upload - repository - mistral FIMCompletionResponse: allOf: - $ref: '#/components/schemas/ChatCompletionResponse' - type: object properties: model: type: string example: codestral-latest ChatCompletionRequest: title: ChatCompletionRequest required: - messages - model type: object properties: random_seed: title: Random Seed minimum: 0 type: integer description: "The seed to use for random sampling. If set, different calls\ \ will generate deterministic results." nullable: true x-ballerina-name: randomSeed safe_prompt: type: boolean description: Whether to inject a safety prompt before all conversations. default: false x-ballerina-name: safePrompt max_tokens: title: Max Tokens minimum: 0 type: integer description: The maximum number of tokens to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model's context length. nullable: true x-ballerina-name: maxTokens presence_penalty: title: Presence Penalty maximum: 2 minimum: -2 type: number description: "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." default: 0 x-ballerina-name: presencePenalty tools: title: Tools type: array nullable: true items: $ref: '#/components/schemas/Tool' "n": title: "N" minimum: 1 type: integer description: "Number of completions to return for each request, input tokens\ \ are only billed once." nullable: true top_p: title: Top P maximum: 1 minimum: 0 type: number description: "Nucleus sampling, where the model considers the results of\ \ the tokens with `top_p` probability mass. So 0.1 means only the tokens\ \ comprising the top 10% probability mass are considered. We generally\ \ recommend altering this or `temperature` but not both." default: 1 x-ballerina-name: topP response_format: allOf: - $ref: '#/components/schemas/ResponseFormat' x-ballerina-name: responseFormat frequency_penalty: title: Frequency Penalty maximum: 2 minimum: -2 type: number description: "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." default: 0 x-ballerina-name: frequencyPenalty stop: title: Stop description: Stop generation if this token is detected. Or if one of these tokens is detected when providing an array anyOf: - type: string - type: array items: type: string stream: title: Stream type: boolean description: "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." default: false temperature: title: Temperature maximum: 1.5 minimum: 0 type: number description: "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` but not both. The default\ \ value varies depending on the model you are targeting. Call the `/models`\ \ endpoint to retrieve the appropriate value." nullable: true prediction: $ref: '#/components/schemas/Prediction' messages: title: Messages type: array description: "The prompt(s) to generate completions for, encoded as a list\ \ of dict with role and content." example: - - role: user content: Who is the best French painter? Answer in one short sentence. items: discriminator: propertyName: role mapping: assistant: '#/components/schemas/AssistantMessage' system: '#/components/schemas/SystemMessage' tool: '#/components/schemas/ToolMessage' user: '#/components/schemas/UserMessage' oneOf: - $ref: '#/components/schemas/SystemMessage' - $ref: '#/components/schemas/UserMessage' - $ref: '#/components/schemas/AssistantMessage' - $ref: '#/components/schemas/ToolMessage' tool_choice: title: Tool Choice anyOf: - $ref: '#/components/schemas/ToolChoice' - $ref: '#/components/schemas/ToolChoiceEnum' default: auto x-ballerina-name: toolChoice model: title: Model type: string description: "ID of the model to use. You can use the [List Available Models](/api/#tag/models/operation/list_models_v1_models_get)\ \ API to see all of your available models, or see our [Model overview](/models)\ \ for model descriptions." example: "[\"mistral-small-latest\"]" additionalProperties: false ModelList: title: ModelList type: object properties: data: title: Data type: array items: discriminator: propertyName: type mapping: base: '#/components/schemas/BaseModelCard' fine-tuned: '#/components/schemas/FTModelCard' oneOf: - $ref: '#/components/schemas/BaseModelCard' - $ref: '#/components/schemas/FTModelCard' object: title: Object type: string default: list Function: title: Function required: - name - parameters type: object properties: name: title: Name type: string description: title: Description type: string default: "" strict: title: Strict type: boolean default: false parameters: title: Parameters type: object additionalProperties: true additionalProperties: false ImageURLChunk: title: ImageURLChunk required: - image_url type: object properties: image_url: title: Image Url anyOf: - $ref: '#/components/schemas/ImageURL' - type: string x-ballerina-name: imageUrl type: title: Type type: string enum: - image_url default: image_url additionalProperties: false description: "{\"type\":\"image_url\",\"image_url\":{\"url\":\"data:image/png;base64,iVBORw0" DeleteModelOut: title: DeleteModelOut required: - id type: object properties: deleted: title: Deleted type: boolean description: The deletion status example: false default: true id: title: Id type: string description: The ID of the deleted model. example: "[\"ft:open-mistral-7b:587a6b29:20240514:7e773925\"]" object: title: Object type: string description: The object type that was deleted default: model ToolChoiceEnum: title: ToolChoiceEnum type: string enum: - auto - none - any - required OCRUsageInfo: title: OCRUsageInfo required: - pages_processed type: object properties: pages_processed: title: Pages Processed minimum: 0 type: integer description: Number of pages processed x-ballerina-name: pagesProcessed doc_size_bytes: title: Doc Size Bytes type: integer description: Document size in bytes nullable: true x-ballerina-name: docSizeBytes additionalProperties: false TrainingParameters: title: TrainingParameters type: object properties: fim_ratio: title: Fim Ratio maximum: 1 minimum: 0 type: number nullable: true default: 0.9 x-ballerina-name: fimRatio weight_decay: title: Weight Decay maximum: 1 minimum: 0 type: number nullable: true default: 0.1 x-ballerina-name: weightDecay training_steps: title: Training Steps minimum: 1 type: integer nullable: true x-ballerina-name: trainingSteps learning_rate: title: Learning Rate maximum: 1 minimum: 0.000000010 type: number default: 0.00010 x-ballerina-name: learningRate epochs: title: Epochs minimum: 0 exclusiveMinimum: true type: number nullable: true seq_len: title: Seq Len minimum: 100 type: integer nullable: true x-ballerina-name: seqLen warmup_fraction: title: Warmup Fraction maximum: 1 minimum: 0 type: number nullable: true default: 0.05 x-ballerina-name: warmupFraction DetailedJobOut: title: DetailedJobOut required: - auto_start - created_at - hyperparameters - id - job_type - model - modified_at - status - training_files type: object properties: job_type: title: Job Type type: string x-ballerina-name: jobType metadata: $ref: '#/components/schemas/JobMetadataOut' fine_tuned_model: title: Fine Tuned Model type: string nullable: true x-ballerina-name: fineTunedModel created_at: title: Created At type: integer x-ballerina-name: createdAt checkpoints: title: Checkpoints type: array items: $ref: '#/components/schemas/CheckpointOut' default: [] suffix: title: Suffix type: string nullable: true auto_start: title: Auto Start type: boolean x-ballerina-name: autoStart training_files: title: Training Files type: array items: type: string format: uuid x-ballerina-name: trainingFiles repositories: title: Repositories type: array items: discriminator: propertyName: type mapping: github: '#/components/schemas/GithubRepositoryOut' oneOf: - $ref: '#/components/schemas/GithubRepositoryOut' default: [] hyperparameters: $ref: '#/components/schemas/TrainingParameters' model: $ref: '#/components/schemas/FineTuneableModel' id: title: Id type: string format: uuid trained_tokens: title: Trained Tokens type: integer nullable: true x-ballerina-name: trainedTokens modified_at: title: Modified At type: integer x-ballerina-name: modifiedAt integrations: title: Integrations type: array nullable: true items: discriminator: propertyName: type mapping: wandb: '#/components/schemas/WandbIntegrationOut' oneOf: - $ref: '#/components/schemas/WandbIntegrationOut' events: title: Events type: array description: Event items are created every time the status of a fine-tuning job changes. The timestamped list of all events is accessible here. items: $ref: '#/components/schemas/EventOut' default: [] status: title: Status type: string enum: - QUEUED - STARTED - VALIDATING - VALIDATED - RUNNING - FAILED_VALIDATION - FAILED - SUCCESS - CANCELLED - CANCELLATION_REQUESTED validation_files: title: Validation Files type: array nullable: true items: type: string format: uuid default: [] x-ballerina-name: validationFiles object: title: Object type: string enum: - job default: job OCRPageDimensions: title: OCRPageDimensions required: - dpi - height - width type: object properties: width: title: Width minimum: 0 type: integer description: Width of the image in pixels dpi: title: Dpi minimum: 0 type: integer description: Dots per inch of the page-image height: title: Height minimum: 0 type: integer description: Height of the image in pixels additionalProperties: false UpdateFTModelIn: title: UpdateFTModelIn type: object properties: name: title: Name type: string nullable: true description: title: Description type: string nullable: true ResponseBase: title: ResponseBase type: object properties: usage: $ref: '#/components/schemas/UsageInfo' model: type: string example: mistral-small-latest id: type: string example: cmpl-e5cc70bb28c444948073e77776eb30ef object: type: string example: chat.completion ClassificationResponse: title: ClassificationResponse type: object properties: model: type: string id: type: string example: mod-e5cc70bb28c444948073e77776eb30ef results: type: array items: $ref: '#/components/schemas/ClassificationObject' FunctionCall: title: FunctionCall required: - arguments - name type: object properties: name: title: Name type: string arguments: title: Arguments anyOf: - type: object additionalProperties: true - type: string additionalProperties: false UsageInfo: title: UsageInfo required: - completion_tokens - prompt_tokens - total_tokens type: object properties: completion_tokens: type: integer example: 34 x-ballerina-name: completionTokens prompt_tokens: type: integer example: 16 x-ballerina-name: promptTokens total_tokens: type: integer example: 50 x-ballerina-name: totalTokens JobOut: title: JobOut required: - auto_start - created_at - hyperparameters - id - job_type - model - modified_at - status - training_files type: object properties: job_type: title: Job Type type: string description: The type of job (`FT` for fine-tuning). x-ballerina-name: jobType metadata: $ref: '#/components/schemas/JobMetadataOut' fine_tuned_model: title: Fine Tuned Model type: string description: The name of the fine-tuned model that is being created. The value will be `null` if the fine-tuning job is still running. nullable: true x-ballerina-name: fineTunedModel created_at: title: Created At type: integer description: The UNIX timestamp (in seconds) for when the fine-tuning job was created. x-ballerina-name: createdAt suffix: title: Suffix type: string description: "Optional text/code that adds more context for the model. When\ \ given a `prompt` and a `suffix` the model will fill what is between\ \ them. When `suffix` is not provided, the model will simply execute completion\ \ starting with `prompt`." nullable: true auto_start: title: Auto Start type: boolean x-ballerina-name: autoStart training_files: title: Training Files type: array description: A list containing the IDs of uploaded files that contain training data. items: type: string format: uuid x-ballerina-name: trainingFiles repositories: title: Repositories type: array items: discriminator: propertyName: type mapping: github: '#/components/schemas/GithubRepositoryOut' oneOf: - $ref: '#/components/schemas/GithubRepositoryOut' default: [] hyperparameters: $ref: '#/components/schemas/TrainingParameters' model: $ref: '#/components/schemas/FineTuneableModel' id: title: Id type: string description: The ID of the job. format: uuid trained_tokens: title: Trained Tokens type: integer description: Total number of tokens trained. nullable: true x-ballerina-name: trainedTokens modified_at: title: Modified At type: integer description: The UNIX timestamp (in seconds) for when the fine-tuning job was last modified. x-ballerina-name: modifiedAt integrations: title: Integrations type: array description: A list of integrations enabled for your fine-tuning job. nullable: true items: discriminator: propertyName: type mapping: wandb: '#/components/schemas/WandbIntegrationOut' oneOf: - $ref: '#/components/schemas/WandbIntegrationOut' status: title: Status type: string description: The current status of the fine-tuning job. enum: - QUEUED - STARTED - VALIDATING - VALIDATED - RUNNING - FAILED_VALIDATION - FAILED - SUCCESS - CANCELLED - CANCELLATION_REQUESTED validation_files: title: Validation Files type: array description: A list containing the IDs of uploaded files that contain validation data. nullable: true items: type: string format: uuid default: [] x-ballerina-name: validationFiles object: title: Object type: string description: The object type of the fine-tuning job. enum: - job default: job UploadFileOut: title: UploadFileOut required: - bytes - created_at - filename - id - object - purpose - sample_type - source type: object properties: filename: title: Filename type: string description: The name of the uploaded file. example: "[\"files_upload.jsonl\"]" purpose: $ref: '#/components/schemas/FilePurpose' bytes: title: Bytes type: integer description: "The size of the file, in bytes." created_at: title: Created At type: integer description: The UNIX timestamp (in seconds) of the event. x-ballerina-name: createdAt id: title: Id type: string description: The unique identifier of the file. format: uuid source: $ref: '#/components/schemas/Source' sample_type: allOf: - $ref: '#/components/schemas/SampleType' x-ballerina-name: sampleType num_lines: title: Num Lines type: integer nullable: true x-ballerina-name: numLines object: title: Object type: string description: "The object type, which is always \"file\"." example: "[\"file\"]" MetricOut: title: MetricOut type: object properties: valid_loss: title: Valid Loss type: number nullable: true x-ballerina-name: validLoss valid_mean_token_accuracy: title: Valid Mean Token Accuracy type: number nullable: true x-ballerina-name: validMeanTokenAccuracy train_loss: title: Train Loss type: number nullable: true x-ballerina-name: trainLoss description: "Metrics at the step number during the fine-tuning job. Use these\ \ metrics to assess if the training is going smoothly (loss should decrease,\ \ token accuracy should increase)." JobIn: title: JobIn required: - hyperparameters - model type: object properties: training_files: title: Training Files type: array items: $ref: '#/components/schemas/TrainingFile' default: [] x-ballerina-name: trainingFiles repositories: title: Repositories maxItems: 50 type: array items: discriminator: propertyName: type mapping: github: '#/components/schemas/GithubRepositoryIn' oneOf: - $ref: '#/components/schemas/GithubRepositoryIn' default: [] hyperparameters: $ref: '#/components/schemas/TrainingParametersIn' model: $ref: '#/components/schemas/FineTuneableModel' suffix: title: Suffix maxLength: 18 type: string description: "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 `ft:open-mistral-7b:my-great-model:xxx...`" nullable: true integrations: title: Integrations type: array description: A list of integrations to enable for your fine-tuning job. nullable: true items: discriminator: propertyName: type mapping: wandb: '#/components/schemas/WandbIntegration' oneOf: - $ref: '#/components/schemas/WandbIntegration' validation_files: title: Validation Files type: array description: "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 `checkpoints` when getting the status of a running fine-tuning job.\ \ The same data should not be present in both train and validation files." nullable: true items: type: string format: uuid x-ballerina-name: validationFiles auto_start: title: Auto Start type: boolean description: This field will be required in a future release. x-ballerina-name: autoStart BatchJobIn: title: BatchJobIn required: - endpoint - input_files - model type: object properties: input_files: title: Input Files type: array items: type: string format: uuid x-ballerina-name: inputFiles endpoint: $ref: '#/components/schemas/ApiEndpoint' metadata: title: Metadata type: object additionalProperties: maxLength: 512 minLength: 1 type: string nullable: true timeout_hours: title: Timeout Hours type: integer default: 24 x-ballerina-name: timeoutHours model: title: Model type: string BatchError: title: BatchError required: - message type: object properties: count: title: Count type: integer default: 1 message: title: Message type: string JobsOut: title: JobsOut required: - total type: object properties: total: title: Total type: integer data: title: Data type: array items: $ref: '#/components/schemas/JobOut' default: [] object: title: Object type: string enum: - list default: list EmbeddingRequest: title: EmbeddingRequest required: - input - model type: object properties: input: title: Input description: Text to embed. example: - Embed this sentence. - As well as this one. anyOf: - type: string - type: array items: type: string model: title: Model type: string description: ID of the model to use. default: mistral-embed additionalProperties: false BatchJobOut: title: BatchJobOut required: - completed_requests - created_at - endpoint - errors - failed_requests - id - input_files - model - status - succeeded_requests - total_requests type: object properties: succeeded_requests: title: Succeeded Requests type: integer x-ballerina-name: succeededRequests metadata: title: Metadata type: object additionalProperties: true nullable: true failed_requests: title: Failed Requests type: integer x-ballerina-name: failedRequests created_at: title: Created At type: integer x-ballerina-name: createdAt output_file: title: Output File type: string format: uuid nullable: true x-ballerina-name: outputFile error_file: title: Error File type: string format: uuid nullable: true x-ballerina-name: errorFile input_files: title: Input Files type: array items: type: string format: uuid x-ballerina-name: inputFiles completed_at: title: Completed At type: integer nullable: true x-ballerina-name: completedAt endpoint: title: Endpoint type: string completed_requests: title: Completed Requests type: integer x-ballerina-name: completedRequests total_requests: title: Total Requests type: integer x-ballerina-name: totalRequests started_at: title: Started At type: integer nullable: true x-ballerina-name: startedAt model: title: Model type: string id: title: Id type: string errors: title: Errors type: array items: $ref: '#/components/schemas/BatchError' object: title: Object type: string enum: - batch default: batch status: $ref: '#/components/schemas/BatchJobStatus' EmbeddingResponse: allOf: - $ref: '#/components/schemas/ResponseBase' - required: - data - id - model - object - usage type: object properties: data: type: array items: $ref: '#/components/schemas/EmbeddingResponseData' ReferenceChunk: title: ReferenceChunk required: - reference_ids type: object properties: reference_ids: title: Reference Ids type: array items: type: integer x-ballerina-name: referenceIds type: title: Type type: string enum: - reference default: reference additionalProperties: false HTTPValidationError: title: HTTPValidationError type: object properties: detail: title: Detail type: array items: $ref: '#/components/schemas/ValidationError' OCRImageObject: title: OCRImageObject required: - bottom_right_x - bottom_right_y - id - top_left_x - top_left_y type: object properties: bottom_right_x: title: Bottom Right X minimum: 0 type: integer description: X coordinate of bottom-right corner of the extracted image nullable: true x-ballerina-name: bottomRightX bottom_right_y: title: Bottom Right Y minimum: 0 type: integer description: Y coordinate of bottom-right corner of the extracted image nullable: true x-ballerina-name: bottomRightY image_base64: title: Image Base64 type: string description: Base64 string of the extracted image nullable: true x-ballerina-name: imageBase64 top_left_y: title: Top Left Y minimum: 0 type: integer description: Y coordinate of top-left corner of the extracted image nullable: true x-ballerina-name: topLeftY id: title: Id type: string description: Image ID for extracted image in a page top_left_x: title: Top Left X minimum: 0 type: integer description: X coordinate of top-left corner of the extracted image nullable: true x-ballerina-name: topLeftX additionalProperties: false SampleType: title: SampleType type: string enum: - pretrain - instruct - batch_request - batch_result - batch_error ClassificationObject: title: ClassificationObject type: object properties: category_scores: type: object additionalProperties: type: number description: Classifier result x-ballerina-name: categoryScores categories: type: object additionalProperties: type: boolean description: Classifier result thresholded CheckpointOut: title: CheckpointOut required: - created_at - metrics - step_number type: object properties: step_number: title: Step Number type: integer description: The step number that the checkpoint was created at. x-ballerina-name: stepNumber created_at: title: Created At type: integer description: The UNIX timestamp (in seconds) for when the checkpoint was created. x-ballerina-name: createdAt metrics: $ref: '#/components/schemas/MetricOut' securitySchemes: ApiKey: type: http scheme: bearer