Skip to main content
Everything the SDK and CLI do goes through this API; use it directly from any language. The SDK calls are in Python SDK and CLI; the meaning of each setting is in Training (SFT and LoRA), Data, Images and videos, Reinforcement fine-tuning (GRPO), Preference training (DPO), Serverless RL and Inference.

Basics

  • Base URL: https://nexcloud.physionlabs.ai. Every path below starts with /v1.
  • Authentication: Authorization: Bearer nk_live_... (an API key from the console’s API keys page; a key belongs to one organisation).
  • Requests and responses are JSON. Money is in US cents, times are Unix seconds, sizes are bytes.
  • Errors: a 4xx or 5xx status with a JSON body whose detail says what to change; most also have a short error code ({"error": "invalid_api_key", "detail": ...}). 401 a missing or wrong key, 402 not enough balance, 403 not open to your organisation, 404 not found (or not yours), 409 the resource is busy (a dataset in use, a checkpoint still uploading), 410 gone (expired), 422 a request the server refuses (bad value, a setting the model does not take; the message names it), 429 a limit (10 open jobs, 50 datasets) or too many requests in a minute.
  • Retries: reads, POST /v1/training/jobs with an Idempotency-Key header, and cancels are safe to retry on connection errors and 429 / 502 / 503 / 504. The same Idempotency-Key with the same body returns the same job; once that job has failed, the key starts a new one (held and charged like any job).

Account

GET /v1/models returns, per model: id, name, maker, params, active_params, architecture, input (text, and image / video where they are open to your organisation), tools (whether it trains on tool calls), batch_size (whether params.batch_size is taken), validation_set, layouts ({id: {gpus, tokens_per_s_per_gpu, available, queued}}) and methods:

Datasets

The file format is in Data, images and videos in Images and videos. Limits: 50 datasets, 10 GB a file, 20 GB a bundle.

Training jobs

POST /v1/training/estimate and POST /v1/training/plan take the same body as POST /v1/training/jobs and start nothing: estimate returns the price (tokens, price_per_mtok, credits held, balance, enough, metered, params, steps, truncated_samples, warnings, video); plan returns the checks only (params, steps, truncated_samples, warnings). For a request jobs would refuse, plan answers 422 and estimate answers 200 with valid: false and the reason in error (a sentence, or a list naming each wrong field); the SDK raises APIError 422 for both. POST /v1/training/jobs (header Idempotency-Key optional):

params

All optional. “Model’s” means the model’s template: GET /v1/models shows it under methods[...].defaults. A step trains gpus x tokens_per_gpu x gradient_accumulation_steps tokens (rows are packed with whole samples, so a little less), or batch_size samples. A setting a method does not take, or a value the model does not allow, is refused with the reason.

Reading a job

Serverless RL runs

Inference runs

Support requests

status is open (NexCloud’s turn), answered (yours) or closed. NexCloud’s replies also go by email to whoever opened the request (for an API key, the person who made it).

API keys

For a signed-in console session only: an API key gets 403 (api_key_not_allowed).