Skip to main content
Note: This API is OpenAI-compatible. You can use the official OpenAI SDK (Python or JavaScript) by pointing base_url / baseURL to https://api.4minds.ai/v1 and 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


Delete a Model

DELETE /v1/models/{model_id} Delete a fine-tuned model (OpenAI-compatible).

Parameters


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


Update a Stored Chat Completion

POST /v1/chat/completions/{completion_id} Update a stored chat completion (e.g. rename or set metadata).

Path Parameters


Delete a Stored Chat Completion

DELETE /v1/chat/completions/{completion_id} Delete a stored chat completion.

Path Parameters


List Messages from a Stored Chat Completion

GET /v1/chat/completions/{completion_id}/messages List messages from a stored chat completion.

Path Parameters


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): Behavior:
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


Delete a File

DELETE /v1/files/{file_id} Delete a file (OpenAI-compatible).

Path Parameters


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 by training_file. Use external_model_id to deploy to an external model registered via GET /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


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


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


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


Delete a Dataset

DELETE /v1/datasets/{id} Delete a dataset and optionally its associated files.

Path Parameters


Authentication

All API requests require authentication using a Bearer token in the Authorization header:
You can obtain your API key from your 4MINDS dashboard.

OpenAI SDK Quick Setup

Since this API is OpenAI-compatible, you can use the official OpenAI SDK by setting the base_url to https://api.4minds.ai/v1:
Python
JavaScript / Node.js

Response Format

All responses are returned in JSON format and follow OpenAI-compatible response structures.

Success Response

Error Response