Note: This API is OpenAI-compatible. You can use the official OpenAI SDK (Python or JavaScript) by pointingbase_url/baseURLtohttps://api.4minds.ai/v1and providing your 4MINDS API key.
Base URL
Models
OpenAI-compatible models API. List, retrieve, and delete your fine-tuned models.List All Available Models
GET/v1/models
List all available models (OpenAI-compatible).
Get Model Details
GET/v1/models/{model_id}
Get details about a specific model (OpenAI-compatible).
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| model_id | string | Yes | The unique identifier of the model |
Delete a Model
DELETE/v1/models/{model_id}
Delete a fine-tuned model (OpenAI-compatible).
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| model_id | string | Yes | The unique identifier of the model to delete |
Chat Completions
OpenAI-compatible chat completions with 4minds Constellations extensions. Supports streaming, agent status events, multi-hop planning, and RAG context retrieval. Stored completions can be listed, retrieved, updated, and deleted.Create a Chat Completion
POST/v1/chat/completions
Create a chat completion (OpenAI-compatible with 4minds extensions).
List Stored Chat Completions
GET/v1/chat/completions
List stored chat completions with optional filtering by model.
Get a Stored Chat Completion
GET/v1/chat/completions/{completion_id}
Retrieve a stored chat completion by ID.
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| completion_id | string | Yes | The unique identifier of the stored completion |
Update a Stored Chat Completion
POST/v1/chat/completions/{completion_id}
Update a stored chat completion (e.g. rename or set metadata).
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| completion_id | string | Yes | The unique identifier of the stored completion |
Delete a Stored Chat Completion
DELETE/v1/chat/completions/{completion_id}
Delete a stored chat completion.
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| completion_id | string | Yes | The unique identifier of the stored completion |
List Messages from a Stored Chat Completion
GET/v1/chat/completions/{completion_id}/messages
List messages from a stored chat completion.
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| completion_id | string | Yes | The unique identifier of the stored completion |
Files
OpenAI-compatible file management API. Upload, list, retrieve, and delete files for fine-tuning. 4minds extends OpenAI’s single-file upload with multi-file datasets — upload multiple files to a single dataset for training.Upload a File
POST/v1/files
Upload a file for fine-tuning (OpenAI-compatible with multi-file extension).
The response includes a dataset_id — use it to upload more files to the same dataset.
Optional 4minds form field (JSON string):
| Field | Type | Description |
|---|---|---|
| dataset_name | string | Custom name for the new dataset |
| dataset_id | integer | Upload to an existing dataset |
| training_type | string | "graph" (default), "rl", or "sft" |
| model_params | object | Custom hyperparameters, e.g. {"learning_rate": 0.001} |
| Scenario | Result |
|---|---|
Omit 4minds entirely | New dataset with auto-generated name |
dataset_name only | New dataset with your custom name |
dataset_id only | Upload to existing dataset |
dataset_id + dataset_name | dataset_id takes priority |
Note: If the dataset already has a model, training is triggered automatically on upload.
List All Uploaded Files
GET/v1/files
List all uploaded files with optional purpose filter (OpenAI-compatible).
Get File Details
GET/v1/files/{file_id}
Retrieve details about a specific file (OpenAI-compatible).
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| file_id | string | Yes | The unique identifier of the file |
Delete a File
DELETE/v1/files/{file_id}
Delete a file (OpenAI-compatible).
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| file_id | string | Yes | The unique identifier of the file to delete |
Fine-Tuning
OpenAI-compatible fine-tuning API. Create, monitor, and manage fine-tuning jobs to customize models with your training data.Note: Training processes ALL files in the dataset, not just the file referenced bytraining_file. Useexternal_model_idto deploy to an external model registered viaGET /v1/external-models.
Create a Fine-Tuning Job
POST/v1/fine_tuning/jobs
Create a fine-tuning job to train a model (OpenAI-compatible). Optionally pass external_model_id to target an external model from a connected integration.
Request Body
| Parameter | Type | Required | Description |
|---|---|---|---|
| model | string | Yes | The base model name to fine-tune (e.g. "Gemma-12B AWQ") |
| training_file | string | Yes | The file ID to use for training |
| suffix | string | No | Custom suffix for the fine-tuned model name |
| external_model_id | integer | No | ID of an external model from a connected integration |
List All Fine-Tuning Jobs
GET/v1/fine_tuning/jobs
List all fine-tuning jobs (OpenAI-compatible).
Get Fine-Tuning Job Details
GET/v1/fine_tuning/jobs/{job_id}
Get fine-tuning job details (OpenAI-compatible).
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| job_id | string | Yes | The unique identifier of the fine-tuning job |
List Fine-Tune Categories
GET/v1/fine-tune-categories
List available fine-tune categories for domain-specific prompting (4minds extension).
Cancel a Fine-Tuning Job
POST/v1/fine_tuning/jobs/{job_id}/cancel
Cancel a running fine-tuning job (OpenAI-compatible).
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| job_id | string | Yes | The unique identifier of the fine-tuning job to cancel |
Datasets (OpenAI-Compatible Extension)
OpenAI-compatible datasets API. Create, list, retrieve, delete, and import datasets. Datasets group training files together for fine-tuning jobs. You can also import datasets directly from connected integrations.List All Datasets
GET/v1/datasets
List all datasets with their file counts and status.
Create a New Dataset
POST/v1/datasets
Create a new empty dataset to group training files.
Import a Dataset
POST/v1/datasets/import
Import a dataset directly from a connected integration (e.g. Databricks, S3, Azure Blob).
Get Dataset Details
GET/v1/datasets/{id}
Get details of a specific dataset including its files.
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | The unique identifier of the dataset |
Delete a Dataset
DELETE/v1/datasets/{id}
Delete a dataset and optionally its associated files.
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | The unique identifier of the dataset |
Authentication
All API requests require authentication using a Bearer token in the Authorization header:OpenAI SDK Quick Setup
Since this API is OpenAI-compatible, you can use the official OpenAI SDK by setting thebase_url to https://api.4minds.ai/v1:
Python
JavaScript / Node.js

