اصلي منځپانګې ته ورټوپ کړئ
د روزنې لارښود څپرکي ټول اسناد

د روزنې API مرجع

ثبت شوي پای‌ټکي، د غوښتنې منځپانګه، ځوابونه، د مالکیت حدود او د تېروتنو اداره.

په ټولو ژبو کې امرونه او کوډ په انګلیسي پاتې کېږي. غټ‌توري ځای‌نښې د خپل حساب او پیسې ورکړل شوې دندې له ارزښتونو سره بدلې کړئ؛ ریښتینې کیلي په شریکو notebook-ونو یا لاګونو کې مه نښلوئ.

د API سرچینې ژوندپړاو

بیه‌لیک، پیسې ورکړل شوې دنده او د روزنې ناسته جلا سرچینې دي.
  1. بیه‌لیک تنظیم او اوسنۍ بیه تایید کړئ
  2. دنده منل شوې تادیه جوړه او بشپړه کړئ
  3. ناسته اجرا چاپېریال او شامله مرجع وټاکئ
  4. چمتو کول تایید شوي د ډیټاسېټ manifest-ونه جوړ کړئ
  5. راپور د روزنې واقعي او د محصول metadata ثبت کړئ

بیه‌لیک: تنظیم او اوسنۍ بیه تایید کړئ. دنده: منل شوې تادیه جوړه او بشپړه کړئ. ناسته: اجرا چاپېریال او شامله مرجع وټاکئ. چمتو کول: تایید شوي د ډیټاسېټ manifest-ونه جوړ کړئ. راپور: د روزنې واقعي او د محصول metadata ثبت کړئ

تصدیق او د غوښتنې اصول

له HTTPS، Authorization: Bearer او د ai:training ساحې لرونکي حساب API key څخه کار واخلئ. Accept: application/json ولېږئ؛ د JSON منځپانګې لپاره Content-Type: application/json هم ورزیات کړئ. ټولې سرچینې د حساب ملکیت دي. د مسیر ډله په دقیقه کې 30 غوښتنو پورې محدودېږي او د تنظیم له مخې نور کنټرولونه هم شته. په بېلګو کې ID-ګانې ځای‌نښې دي، شریکې سرچینې نه دي.

  • د بیه‌لیک ID، د دندې UUID، د ناستې ID، د ماډل ID او د محصول ID بېلابېل پېژندونکي دي.
  • د شبکې له پرې کېدو وروسته د لیکنې تر تکرار مخکې اوسنی وضعیت ولولئ.
  • په API غوښتنو کې د عامو پاڼو ژبه یا د بیې query پارامېټرونه مه کاروئ.
بېلګه · bash
export TRAINING_API='https://fusionpointai.com/api/v1/training'
# Set the key securely as shown in Quickstart.
export JOB_UUID='REPLACE_WITH_YOUR_JOB_UUID'
export SESSION_ID='REPLACE_WITH_YOUR_SESSION_ID'
curl --fail-with-body --silent --show-error "$TRAINING_API/jobs" \
  -H "Authorization: Bearer $FUSIONPOINTAI_API_KEY" -H 'Accept: application/json'

غوښتنې، ځوابونه او حالت

له وړ تنظیم څخه بیه‌لیک جوړ کړئ، د هغه له UUID څخه اصلي دنده جوړه کړئ او د ناستې له پرانیستلو مخکې د تایید شوې تادیې بهیر بشپړ کړئ. د پروژې پای‌ټکي د پېرودل شوي مرجع موجود لاسرسی تاییدوي او د بل جوړولو یا د بیې بدلولو پرته د نصاب یا درس غوښتنه کوي. د ناستې ځوابونه تنظیم، ټاکل شوې مرجع، د ډیټاسېټ manifest-ونه، راپور شوی ګام او راپور رانغاړي. چمتو کول او راپورول جلا غوښتنې دي؛ دندې او ناستې جلا حالتونه لري.

  • د پروژې اجازه provider او reference_model_id غواړي؛ د ښوونکي غوښتنه action او objective هم غواړي.
  • د ښوونکي بېلګې یوازې منل شوي روزنیز مواد دي؛ د اعتبارسنجونې او وروستۍ ازموینې قطارونه محلي ساتل کېږي.
  • د بشپړېدو پخوانی راپور د محلي محصول حقیقت بیانوي او باید د بشپړتیا او ارزونې کتنې پوره کړي.
بېلګه · text
POST /api/v1/training/quotes
reference_model_id     required eligible integer model ID
training_plan_id       required public provider-plan integer ID
mode                   automatic | advanced
objective              required string, 10..4000 characters
language               required string, at most 120 characters
performance_criteria   required string, 10..2000 characters
student_release_slug   optional eligible slug, at most 190 characters
method                 optional eligible method, at most 80 characters
dataset_megabytes      optional integer, 1..1000000
gpu_count              optional integer, 1..128
delivery               optional: artifact | hosted
execution_target       optional: fusionpointai_hosting | customer_datacenter | colab

Availability and approved plan policies can impose narrower constraints.
Do not submit price, fixed_total, currency, price_version_id or model_training.
بېلګه · json
{
  "reference_model_id": 123,
  "training_plan_id": "<INTEGER_FROM_YOUR_PROVIDER_PLAN>",
  "mode": "advanced",
  "objective": "Train a German support-message classifier.",
  "language": "German",
  "performance_criteria": "Evaluate per-class precision and recall on held-out data.",
  "student_release_slug": "<ELIGIBLE_STUDENT_RELEASE_SLUG>",
  "method": "LoRA",
  "dataset_megabytes": 8,
  "gpu_count": 1,
  "delivery": "artifact"
}
بېلګه · bash
# Save the body as quote.json; replace ID placeholders with integers.
# Automatic mode omits student_release_slug and method.
curl --fail-with-body --silent --show-error "$TRAINING_API/quotes" \
  -H "Authorization: Bearer $FUSIONPOINTAI_API_KEY" \
  -H 'Accept: application/json' -H 'Content-Type: application/json' \
  --data-binary @quote.json
# Save {"quote":"YOUR_QUOTE_UUID"} as job.json.
# Creates a native job/invoice; this is not payment confirmation.
curl --fail-with-body --silent --show-error "$TRAINING_API/jobs" \
  -H "Authorization: Bearer $FUSIONPOINTAI_API_KEY" \
  -H 'Accept: application/json' -H 'Content-Type: application/json' \
  --data-binary @job.json
curl --fail-with-body --silent --show-error "$TRAINING_API/jobs/$JOB_UUID" \
  -H "Authorization: Bearer $FUSIONPOINTAI_API_KEY" -H 'Accept: application/json'
بېلګه · text
POST /api/v1/training/quotes: 201
{quote: UUID, currency: ISO_CODE, fixed_total: DECIMAL_STRING, expires_at: ISO_8601}

POST /api/v1/training/jobs: {"quote":"OWNED_QUOTE_UUID"}
201 for a newly created job; 200 when an accepted quote reuses its job.
Job fields:
id                job UUID
status            native job state, such as awaiting_payment
progress_percent  recorded progress, not an independent quality score
invoice_id        owned native invoice ID or null
created_at        ISO 8601 timestamp
completed_at      ISO 8601 timestamp or null
training_session  null or {id, status, step, delivery, verification}

GET /api/v1/training/jobs:
{data: JOB_ARRAY, current_page: INTEGER, last_page: INTEGER, per_page: 50, total: INTEGER}

This is a response-shape reference, not a fabricated live response.
بېلګه · bash
# Save as session.json, using your paid job UUID and optional reference ID:
# {"job":"YOUR_PAID_JOB_UUID","runtime":"customer_datacenter","reference_model_id":123}
curl --fail-with-body --silent --show-error "$TRAINING_API/sessions" \
  -H "Authorization: Bearer $FUSIONPOINTAI_API_KEY" \
  -H 'Accept: application/json' -H 'Content-Type: application/json' \
  --data-binary @session.json
curl --fail-with-body --silent --show-error "$TRAINING_API/sessions/$SESSION_ID" \
  -H "Authorization: Bearer $FUSIONPOINTAI_API_KEY" -H 'Accept: application/json'
# One preparation batch; inspect progress before another request.
curl --fail-with-body --silent --show-error "$TRAINING_API/sessions/$SESSION_ID/prepare" \
  -H "Authorization: Bearer $FUSIONPOINTAI_API_KEY" \
  -H 'Accept: application/json' -H 'Content-Type: application/json' --data '{}'
بېلګه · text
Session response fields (shape reference, not a fabricated live result):
id                  session UUID
job                 owned job UUID
status              preparing | ready | running | evaluating | completed | failed | cancelled
configuration       approved method, student_checkpoint, sdk_training and selected reference
reference_model_id  selected integer reference ID
expires_at          ISO 8601 access expiry
step                last reported integer step
datasets[]          {split, rows, bytes, sha256}
report              current report object; event metrics live under report.last_event.metrics
delivery            runtime_local
verification        runtime_reported
بېلګه · bash
curl --fail-with-body --silent --show-error \
  "$TRAINING_API/sessions/$SESSION_ID/datasets/train" \
  -H "Authorization: Bearer $FUSIONPOINTAI_API_KEY" \
  -H 'Accept: application/x-ndjson' --output train.jsonl
# Use /datasets/validation for the other supported split.
sha256sum train.jsonl
# Compare bytes, rows and SHA-256 with the session manifest.
# For published server-side artifacts only, not the local SDK ZIP:
# GET /api/v1/training/jobs/{job}/artifacts/{file}
بېلګه · text
POST /api/v1/training/sessions/{session}/events
Content-Type: application/json

state         required: running | evaluating | failed
step          required integer: 0..2000
total_steps   required integer: 1..2000
metrics       optional; only loss and eval_loss, each 0..1000000
error_code    optional: training_failed | evaluation_failed | runtime_unavailable |
              dataset_invalid | report_failed

Send actual trainer observations, never sample or invented metrics.
بېلګه · bash
# Build the body from a REAL SDK report; requires jq.
jq '{artifact_name:"model-package.zip",report:.completion_report}' \
  customer-model-run-001/training-report.json > completion.json
curl --fail-with-body --silent --show-error "$TRAINING_API/sessions/$SESSION_ID/complete" \
  -H "Authorization: Bearer $FUSIONPOINTAI_API_KEY" \
  -H 'Accept: application/json' -H 'Content-Type: application/json' \
  --data-binary @completion.json
# Cancel eligible service state, not the operating-system process:
curl --fail-with-body --silent --show-error "$TRAINING_API/sessions/$SESSION_ID/cancel" \
  -H "Authorization: Bearer $FUSIONPOINTAI_API_KEY" \
  -H 'Accept: application/json' -H 'Content-Type: application/json' --data '{}'
بېلګه · bash
curl --fail-with-body --silent --show-error \
  'https://fusionpointai.com/api/v1/training/projects/authorize' \
  -H "Authorization: Bearer $FUSIONPOINTAI_API_KEY" \
  -H 'Accept: application/json' -H 'Content-Type: application/json' \
  --data '{"provider":"openai","reference_model_id":123}'
# The response identifies the owned paid job/grant and access expiry.
بېلګه · bash
curl --fail-with-body --silent --show-error \
  'https://fusionpointai.com/api/v1/training/projects/teacher' \
  -H "Authorization: Bearer $FUSIONPOINTAI_API_KEY" \
  -H 'Accept: application/json' -H 'Content-Type: application/json' \
  --data '{"provider":"openai","reference_model_id":123,"action":"lessons","objective":"Classify support messages into agreed categories.","topic":"ambiguous_requests","count":2,"approved_examples":["A reviewed support training example."]}'
# Send only explicitly approved training examples. Never send held-out rows.
# Curriculum action returns topics; lessons action returns text/topic examples.
بېلګه · python
import os
from fusionpointai_training import TrainingClient

client = TrainingClient(api_key=os.environ["FUSIONPOINTAI_API_KEY"])
session = client.get_session(os.environ["FUSIONPOINTAI_SESSION_ID"])
print("Session:", session["id"])
print("Status:", session["status"])
print("Last reported step:", session["step"])
# Inspection is read-only; status and step are server-reported state.
بېلګه · python
import os
from fusionpointai_training import TrainingClient

client = TrainingClient(api_key=os.environ["FUSIONPOINTAI_API_KEY"])
session = client.get_session(os.environ["FUSIONPOINTAI_SESSION_ID"])
for manifest in session["datasets"]:
    print(
        manifest["split"],
        "rows:", manifest["rows"],
        "bytes:", manifest["bytes"],
        "sha256:", manifest["sha256"],
    )
# These are server-provided manifest values, not a local integrity pass.
بېلګه · python
import os
from fusionpointai_training import TrainingClient

client = TrainingClient(api_key=os.environ["FUSIONPOINTAI_API_KEY"])
session = client.get_session(os.environ["FUSIONPOINTAI_SESSION_ID"])
server_report = session.get("report")
runtime_report = server_report.get("runtime") if isinstance(server_report, dict) else None
if (
    session.get("status") == "completed"
    and isinstance(runtime_report, dict)
    and runtime_report.get("artifact_sha256") == os.environ["LOCAL_ARTIFACT_SHA256"]
    and server_report.get("delivery") == "runtime_local"
    and server_report.get("verification") == "runtime_reported"
):
    print("Server report matches the local artifact digest.")
else:
    print("Completion is not confirmed for this local artifact.")
# Reconcile by reading state; do not repeat training or invent a result.

تېروتنې او خوندي ادغام

د HTTP وضعیت او راګرځېدلي تاییدي جزئیات وکاروئ؛ دا مه ګڼئ چې هره تېروتنه لنډمهاله ده. 401 د نه‌تصدیق، 403 د رد شوي لاسرسي، 404 د ورکې یا د بل حساب د سرچینې، 409 د ناساز حالت، 422 د ناسم ننوت او 429 د غوښتنو محدودولو لپاره تمه کړئ. د چمتوکوونکي یا اجرا چاپېریال نورې تېروتنې هم راتلای شي. SDK د پټو معلوماتو لرونکی خام پورته‌کچې ځواب نه ورکوي؛ APIError وړاندې کوي.

  • پېښې running، evaluating یا failed مني؛ د سنجش کیلي loss او eval_loss دي.
  • step او total_steps تر 2000 پورې محدود دي؛ total_steps باید مثبت وي.
  • بشپړ بدني راپور artifact_name او د بېلګې ټولې راپوریزې برخې غواړي.
بېلګه · text
401  Authentication missing or invalid
403  Account/key scope or access denied
404  Resource missing, non-owned or intentionally hidden
409  Invalid session transition, runtime, paid-access or model configuration
410  Writable session expired
422  Invalid request fields or completion criteria not met
429  Request rate limited
502  Upstream reference data malformed or preparation failed

Do not retry a write blindly. Read session state and inspect the response.
Keep error_code distinct from the HTTP status. Never log authorization.
بېلګه · text
POST /api/v1/training/sessions/{session}/complete
artifact_name                 safe filename ending in .zip, max 160 characters
report.training_steps         integer 1..2000
report.weights_before_sha256  lowercase SHA-256 of actual pre-training weights
report.weights_after_sha256   lowercase SHA-256 of actual changed weights
report.artifact_sha256        lowercase SHA-256 of the real local ZIP
report.artifact_bytes         integer 1..107374182400
report.eval_loss_before       finite number >0 and <=1000000
report.eval_loss_after        finite number >=0 and <=1000000
report.base_repository        pinned student repository, max 255 characters
report.base_revision          lowercase immutable 40-character revision
report.method                 SFT | LoRA | QLoRA

Values must match the approved session and actual local training.
Additional report keys are rejected. This body does not upload the ZIP.
بېلګه · python
import os
from fusionpointai_training import TrainingClient
from fusionpointai_training.errors import APIError

client = TrainingClient(
    api_key=os.environ["FUSIONPOINTAI_API_KEY"],
    timeout=30.0,
    max_get_retries=2,
)
try:
    session = client.get_session(os.environ["FUSIONPOINTAI_SESSION_ID"])
except APIError:
    # GET retries are bounded. Do not blindly retry a write after an error.
    print("Session inspection failed; check access and current server state.")
else:
    print("Status:", session["status"])
# Never print the API key, authorization headers, or response secrets.

د API مرجع

پای‌ټکیموخه او چلند
POST /api/v1/training/quotes Authorization: Bearer ai:training وړ مرجع، پلان او تنظیم تایید کړئ؛ د بیه‌لیک UUID، پیسه، fixed_total او expires_at بېرته واخلئ. منل شوی پلان او د زده‌کوونکي وړ تنظیمات وکاروئ، د مراجع خپل‌سري بیې نه.
GET /api/v1/training/jobs Authorization: Bearer ai:training د تصدیق شوي پېرودونکي دندې لېست کړئ. راګرځېدلې ټولګه او د سرچینو ID-ګانې وګورئ، عددي پېژندونکي په اټکل مه ټاکئ.
POST /api/v1/training/jobs Authorization: Bearer ai:training له سم بیه‌لیک UUID څخه د حساب ملکیت دنده جوړه کړئ. ځواب د دندې ID، وضعیت، د بل ID او وختونه لري؛ د دندې جوړول د تادیې ثبوت نه دی.
GET /api/v1/training/jobs/{job} Authorization: Bearer ai:training د دندې UUID په کارولو خپله دنده ولولئ، د ژوندۍ پرمختګ او سپارلو وضعیت په ګډون.
GET /api/v1/training/jobs/{job}/artifacts/{file} Authorization: Bearer ai:training د همدې ملکیت دندې خپور شوی فایل ښکته کړئ. محلي SDK ZIP په اتومات ډول نه پورته کېږي او د دې مسیر له لارې شتون نه لري.
POST /api/v1/training/sessions Authorization: Bearer ai:training بدن: دندې UUID، runtime او اختیاري مثبت reference_model_id. نوې یا بیاکارول شوې ناسته بېرته اخلي؛ مرجع یوازې د چمتو کولو له پیلېدو مخکې بدلېدای شي.
GET /api/v1/training/sessions/{session} Authorization: Bearer ai:training خپله ناسته او د هغې تنظیم، ډیټاسېټونه، راپور او حالت ولولئ. د حالت لوستل روزنه نه پیلوي.
POST /api/v1/training/sessions/{session}/prepare Authorization: Bearer ai:training تش JSON څیز ولېږئ، څو د چمتو کولو محدوده بسته وغواړئ. د غوښتنو د بودجې په دننه کې، د پرمختګ پر مهال تر چمتو کېدو یې تکرار کړئ.
GET /api/v1/training/sessions/{session}/datasets/{split} Authorization: Bearer ai:training train یا validation د application/x-ndjson په بڼه ښکته کړئ. بایټونه، SHA-256 او قطارونه د همدې ناستې له manifest سره پرتله کړئ.
POST /api/v1/training/sessions/{session}/events Authorization: Bearer ai:training واقعي حالت، step، total_steps او اختیاري loss/eval_loss سنجشونه راپور کړئ. یوازې ملاتړ شوي حالت او د تېروتنې کوډونه وکاروئ.
POST /api/v1/training/sessions/{session}/complete Authorization: Bearer ai:training artifact_name او د روزنې بشپړ واقعي راپور وسپارئ. خدمت طریقه، د بنسټ revision، د وزنونو بدلون، د محصول digest او د ارزونې معیارونه ګوري.
POST /api/v1/training/sessions/{session}/cancel Authorization: Bearer ai:training تش JSON څیز ولېږئ څو د خدمت وړ حالت لغوه کړئ. د اړتیا پر مهال جلا GPU پروسه خپله ودروئ؛ دا pause/resume نه دی.
POST /api/v1/training/projects/authorize Authorization: Bearer ai:training POST /api/v1/training/projects/authorize ته provider او مثبت reference_model_id واستوئ. د ننوتلي حساب د پیسې ورکړل شوي روزنیز مرجع لاسرسی بیا تاییدوي او خپله دنده، grant، چمتوکوونکی، مرجع ماډل او پای‌مهال بېرته ورکوي. بل نه جوړوي او تادیه نه بدلوي.
POST /api/v1/training/projects/teacher Authorization: Bearer ai:training POST /api/v1/training/projects/teacher ته provider، reference_model_id، action (curriculum یا lessons)، objective، اختیاري topic، count (1–4) او تر اتو approved_examples (هر یو تر 2,000 کرکټرونو) واستوئ. موضوعات یا د درس متن/موضوع قطارونه بېرته ورکوي. یوازې منل شوي روزنیز مواد واستوئ، د اعتبارسنجونې یا وروستۍ ازموینې معلومات هېڅکله مه لېږئ.