FineTuneMyAI REST API
Integrate, control, and orchestrate private on-device LLMs, 18 autonomous software agents, in-browser execution sandboxes, and dataset quality audits programmatically.
1. Authentication
FineTuneMyAI supports multiple authentication mechanisms depending on client context:
- Web Browser Clients: Automatic session cookies (
auth_token) set asHttpOnly; Secure; SameSite=Laxon login. - REST / API Clients: Pass the bearer token in the HTTP header:
Authorization: Bearer <session_token>. - Paired Device Nodes: Local runner daemons authenticate with their cryptographic 256-bit bearer token and HMAC-signed timestamps issued during pairing.
{
"email": "developer@company.com",
"password": "your_secure_password"
}{
"success": true,
"user": {
"id": "usr_94b1a8",
"email": "developer@company.com",
"name": "Operator",
"role": "USER"
}
}2. Autonomous Multi-Agents & Execution Sandbox
Orchestrate the 18-agent software engineering company, query running agent statuses, trigger test generations with per-call model overrides, and control the isolated live application sandbox.
| Method | Path | Description |
|---|---|---|
| GET | /api/v1/system/llm | Retrieve active agent model, provider configuration, and resident models |
| POST | /api/v1/system/llm/test | Execute on-device test generation with optional per-call model override |
| GET | /api/v1/multi-agent/projects | List active multi-agent projects and repository workspaces |
| POST | /api/v1/projects/{id}/preview/start | Launch live in-browser application sandbox on port 5005 |
| POST | /api/v1/projects/{id}/preview/stop | Terminate live application sandbox process on port 5005 |
| GET | /api/v1/projects/{id}/preview/status | Query sandbox process state, PID, port, and auto-detected stack runner |
| GET | /api/v1/projects/{id}/preview/logs | Fetch recent stdout/stderr lines from circular execution log buffer |
curl -X POST "https://finetunemyai.com/api/v1/system/llm/test" \
-H "Content-Type: application/json" \
-d '{
"prompt": "Write a TypeScript function to validate semver strings.",
"system_instruction": "You are Marcus, Senior Frontend Agent.",
"model": "qwen2.5-coder:7b-instruct"
}'3. On-Device Inference & Streaming
Stream real tokens directly from your local hardware (Apple Silicon Metal GPU or NVIDIA CUDA) with real-time tokens-per-second and latency telemetry.
{
"model_id": "mlx-community/Qwen2.5-0.5B-Instruct-4bit",
"adapter_id": "test_adapter_v1",
"prompt": "Explain gradient accumulation in distributed training.",
"max_tokens": 512,
"temperature": 0.7,
"stream": true
}data: {"token": "Gradient", "done": false}
data: {"token": " accumulation", "done": false}
data: {"token": " calculates", "done": false}
...
data: {"token": "", "done": true, "tokens_per_sec": 42.8, "latency_ms": 118}4. Compute Nodes & Agent Sync Protocol
Daemon instances on physical workstations poll the control plane, report hardware metrics, and receive training/inference execution orders.
| Method | Path | Description |
|---|---|---|
| GET | /api/v1/devices | List all registered nodes, platform architectures, and online states |
| POST | /api/v1/pairing/start | Generate a 6-digit one-time pairing code (valid for 10 minutes) |
| POST | /api/v1/pairing/claim | Node daemon claims 6-digit code in exchange for HMAC device secrets |
| POST | /api/v1/agent/sync | Node daemon heartbeat reporting VRAM/MPS status and polling commands |
5. Corpora & Quality Auditor
Datasets are audited on-device for duplicate records, length distributions, and syntax hygiene before training.
| Method | Path | Description |
|---|---|---|
| GET | /api/v1/corpora | List registered datasets with token counts and quality scores |
| POST | /api/v1/corpora/analyze | Run heuristic Section 11 quality evaluation on sample text |
| POST | /api/v1/corpora/upload | Parse multipart local file (.jsonl, .csv, .txt) and score on-device |
6. SDK & Code Samples
const res = await fetch('https://finetunemyai.com/api/v1/inference/generate', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer ' + process.env.API_KEY,
},
body: JSON.stringify({
prompt: 'Implement a binary search tree.',
max_tokens: 256,
}),
});
const data = await res.json();
console.log(data.text);import requests
url = "https://finetunemyai.com/api/v1/system/llm/test"
payload = {
"prompt": "Optimize this SQL query for MariaDB.",
"model": "qwen2.5-coder:7b-instruct"
}
headers = {"Authorization": "Bearer your_token_here"}
res = requests.post(url, json=payload, headers=headers)
print(res.json()["response"])