Upload Dataset from File

Create a new dataset by uploading a local file.

Upload Dataset from File

Create a new dataset by uploading a file from your local machine. The file is uploaded and processed in the background, automatically detecting columns and data types.

POST https://api.futureagi.com/model-hub/develops/create-dataset-from-local-file/

Authentication

X-Api-Key API Key Required

Your Future AGI API key used to authenticate requests. You can find and manage your API keys in the Dashboard under Settings.

X-Secret-Key Secret Key Required

Your Future AGI secret key, used alongside the API key for request authentication. This is generated when you create an API key in the Dashboard.

Request Body

This endpoint accepts multipart/form-data.

file file Required

The file to upload. Supported formats: .csv, .xls, .xlsx, .json, .jsonl. Maximum file size is 10 MB.

new_dataset_name string Optional

Name for the dataset. Must be unique within your organization. If not provided, the original filename is used as the dataset name.

Response

Returns the created dataset details. The file is processed asynchronously in the background.

message string
Confirmation message. Example: Dataset creation started successfully. Processing in background.
dataset_id string
UUID of the newly created dataset.
dataset_name string
Name of the created dataset.
processing_status string
Current processing status. Initially queued.
estimated_rows integer
Estimated number of rows detected in the file.
estimated_columns integer
Estimated number of columns detected in the file.

Example Response

{
  "message": "Dataset creation started successfully. Processing in background.",
  "dataset_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "dataset_name": "My Uploaded Dataset",
  "processing_status": "queued",
  "estimated_rows": 150,
  "estimated_columns": 5
}

Responses

200

Dataset creation started successfully. The file has been uploaded and is being processed in the background.

400

Bad request. Possible reasons:

  • No file uploaded - The file field is required.
  • File too large - File size exceeds the 10 MB limit.
  • Unsupported file format - Only .csv, .xls, .xlsx, .json, and .jsonl files are supported.
  • Duplicate name - A dataset with this name already exists in your organization.
  • File processing error - The file could not be parsed.

401

Authentication credentials were not provided or are invalid.

429

Resource limit reached. Your organization has exceeded the dataset creation or row addition quota.

500

Internal server error. Failed to create the dataset from the uploaded file.

Code Examples

import requests

url = "https://api.futureagi.com/model-hub/develops/create-dataset-from-local-file/"
headers = {
    "X-Api-Key": "YOUR_API_KEY",
    "X-Secret-Key": "YOUR_SECRET_KEY"
}
files = {
    "file": ("data.csv", open("data.csv", "rb"), "text/csv")
}
data = {
    "new_dataset_name": "My Uploaded Dataset"
}

response = requests.post(url, headers=headers, files=files, data=data)
print(response.json())
const formData = new FormData();
formData.append("file", fileInput.files[0]);
formData.append("new_dataset_name", "My Uploaded Dataset");

const response = await fetch(
  "https://api.futureagi.com/model-hub/develops/create-dataset-from-local-file/",
  {
    method: "POST",
    headers: {
      "X-Api-Key": "YOUR_API_KEY",
      "X-Secret-Key": "YOUR_SECRET_KEY"
    },
    body: formData
  }
);

const data = await response.json();
console.log(data);
curl -X POST "https://api.futureagi.com/model-hub/develops/create-dataset-from-local-file/" \
  -H "X-Api-Key: YOUR_API_KEY" \
  -H "X-Secret-Key: YOUR_SECRET_KEY" \
  -F "file=@data.csv" \
  -F "new_dataset_name=My Uploaded Dataset"
GET /
Authentication
REQUEST
 
RESPONSE