Start training
curl --request POST \
--url https://api.mathfi.ai/api/v1/training/datasets/{datasetKey} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"scalingFactor": 19,
"performanceThreshold": 0.85
}
'import requests
url = "https://api.mathfi.ai/api/v1/training/datasets/{datasetKey}"
payload = {
"scalingFactor": 19,
"performanceThreshold": 0.85
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({scalingFactor: 19, performanceThreshold: 0.85})
};
fetch('https://api.mathfi.ai/api/v1/training/datasets/{datasetKey}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.mathfi.ai/api/v1/training/datasets/{datasetKey}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'scalingFactor' => 19,
'performanceThreshold' => 0.85
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.mathfi.ai/api/v1/training/datasets/{datasetKey}"
payload := strings.NewReader("{\n \"scalingFactor\": 19,\n \"performanceThreshold\": 0.85\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.mathfi.ai/api/v1/training/datasets/{datasetKey}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"scalingFactor\": 19,\n \"performanceThreshold\": 0.85\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mathfi.ai/api/v1/training/datasets/{datasetKey}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"scalingFactor\": 19,\n \"performanceThreshold\": 0.85\n}"
response = http.request(request)
puts response.read_body{
"trainingJobKey": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"datasetKey": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "PENDING",
"trainingJobProgressUrl": "<string>"
}Training
Start training
Creates a new training job for a dataset in COMPLETED status.
Training requires two hyperparameters:
| Parameter | Range | Description |
|---|---|---|
scalingFactor | 0–499 | Controls the internal learning rate. Start with a value between 10 and 50 and tune from there. |
performanceThreshold | 0.0–1.0 | Target balanced-class accuracy. Training stops when any algorithm reaches this value. Lower values complete faster. |
Multiple proprietary algorithms run in parallel and compete to reach performanceThreshold.
The winner algorithm produces the champion model.
Monitor progress via GET /api/v1/training/{trainingJobKey}/progress.
POST
/
api
/
v1
/
training
/
datasets
/
{datasetKey}
Start training
curl --request POST \
--url https://api.mathfi.ai/api/v1/training/datasets/{datasetKey} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"scalingFactor": 19,
"performanceThreshold": 0.85
}
'import requests
url = "https://api.mathfi.ai/api/v1/training/datasets/{datasetKey}"
payload = {
"scalingFactor": 19,
"performanceThreshold": 0.85
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({scalingFactor: 19, performanceThreshold: 0.85})
};
fetch('https://api.mathfi.ai/api/v1/training/datasets/{datasetKey}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.mathfi.ai/api/v1/training/datasets/{datasetKey}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'scalingFactor' => 19,
'performanceThreshold' => 0.85
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.mathfi.ai/api/v1/training/datasets/{datasetKey}"
payload := strings.NewReader("{\n \"scalingFactor\": 19,\n \"performanceThreshold\": 0.85\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.mathfi.ai/api/v1/training/datasets/{datasetKey}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"scalingFactor\": 19,\n \"performanceThreshold\": 0.85\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mathfi.ai/api/v1/training/datasets/{datasetKey}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"scalingFactor\": 19,\n \"performanceThreshold\": 0.85\n}"
response = http.request(request)
puts response.read_body{
"trainingJobKey": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"datasetKey": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "PENDING",
"trainingJobProgressUrl": "<string>"
}Authorizations
Obtain a token from POST /api/login. Valid for 1 hour.
Path Parameters
Body
application/json
Controls the internal learning rate. A starting value of 10–50 works for most datasets. Adjust based on training performance progression.
Required range:
0 <= x <= 499Example:
19
Target balanced-class accuracy (0–1). Training stops when any algorithm reaches this value. Lower values complete faster. Typical starting point: 0.80.
Required range:
0 <= x <= 1Example:
0.85
Response
Training job created successfully
Status of a training job:
| Status | Description |
|---|---|
PENDING | Queued, not yet started |
RUNNING | Algorithms competing in parallel |
COMPLETED | Target performance reached. Champion model created. |
TIMED_OUT | Did not reach target performance within the time limit |
NOT_COMPLETED | Stalled — no progress detected for a sustained period |
CANCELLED | Cancelled by the user |
FAILED | Failed due to an internal error |
Available options:
PENDING, RUNNING, COMPLETED, TIMED_OUT, NOT_COMPLETED, CANCELLED, FAILED URL to poll for training progress