> ## Documentation Index
> Fetch the complete documentation index at: https://docs.physionlabs.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# API overview

> Base URL, authentication, the first call, errors, limits and retries.

Everything the SDK and the command line do goes through this HTTP API, so you can use it from any language.

| | |
| - | - |
| Base URL | `https://nexcloud.physionlabs.ai` (every path starts with `/v1`) |
| Authentication | `Authorization: Bearer nk_live_...` |
| Bodies | JSON in, JSON out |
| Money | US cents (called credits: 100 credits are one dollar) |
| Times | Unix seconds |
| Sizes | bytes |

## Authentication

Create an API key in the [console](https://nexcloud.physionlabs.ai) on the **API keys** page. Only an owner of the
organisation can create one, and a key belongs to one organisation. The secret is shown once.

```bash theme={null}
export NEXTRON_API_KEY="nk_live_..."
```

Send it as a bearer token on every request. Keep it in a secret store; never commit it or put it in browser code.
Revoke a leaked key on the same page and create another.

## First call

```bash curl theme={null}
curl https://nexcloud.physionlabs.ai/v1/me \
  -H "Authorization: Bearer $NEXTRON_API_KEY"
```

```python Python theme={null}
from nextron_cloud import NexTron

client = NexTron()   # reads NEXTRON_API_KEY
print(client.me())
```

```bash CLI theme={null}
nextron-cloud me
```

```json theme={null}
{
  "org": { "id": "org_1a2b3c4d5e6f7a8b", "name": "Acme Research", "role": "owner", "credits": 4520, "suspended": false },
  "orgs": [{ "id": "org_1a2b3c4d5e6f7a8b", "name": "Acme Research", "role": "owner" }],
  "billing": {
    "checkout": true,
    "min_cents": 500,
    "max_cents": 1000000,
    "prices": { "qwen3.5-4b": { "full": 20, "lora": 20 } }
  }
}
```

`org.credits` is the balance: 4520 is \$45.20. `billing.prices` has every model and method; one is shown here.

## Errors

A failed request has a 4xx or 5xx status and a JSON body with a `detail` that says what to change. Most also carry a
short `error` code.

```json theme={null}
{ "error": "invalid_api_key", "detail": "invalid_api_key" }
```

| Status | Meaning | What to do |
| - | - | - |
| 401 | the key is missing or wrong | check the `Authorization` header |
| 402 | the balance does not cover the request | add credit on the console's Billing page |
| 403 | not open to your organisation, or not allowed with an API key ([API keys](https://docs.physionlabs.ai/nexcloud/api/support-and-keys.md#api-keys) and billing are console-only) | |
| 404 | not found, or not yours | check the id |
| 409 | the resource is busy: a dataset in use, a checkpoint still uploading | wait and retry |
| 410 | gone: a checkpoint is kept 30 days | |
| 422 | a value the server refuses, or a setting the model does not take; `detail` names it | fix that field |
| 429 | a limit was reached (below) | wait, or delete old datasets |
| 5xx | service trouble | retry later |

## Limits

* 300 requests a minute.
* 10 jobs queued or running at a time.
* 50 datasets; 10 GB a file, 20 GB a bundle with images or videos.
* 10 support requests a day.

## Retries

These are safe to send again after a connection error or a 429, 502, 503 or 504:

* every `GET`;
* `POST /v1/training/jobs` with an `Idempotency-Key` header: the same key with the same body returns the same job. Once
  that job has failed, the key starts a new one;
* cancels.

The SDK does this for you (three retries by default).

## Polling

Nothing is pushed to you: poll. A job every 30 seconds or slower is enough.
[Events](https://docs.physionlabs.ai/nexcloud/api/training-jobs.md#events) and [logs](https://docs.physionlabs.ai/nexcloud/api/training-jobs.md#logs) take a cursor, so each
poll returns only what is new.

## SDK and command line

Each page of this reference shows the HTTP request with the matching Python and command-line call. Install both with:

```bash theme={null}
uv venv && uv pip install --prerelease=allow nextron-cloud
```

The full list of calls is in [Python SDK and CLI](https://docs.physionlabs.ai/nexcloud/sdk/reference.md); every endpoint and training setting on
one page is in [All endpoints](https://docs.physionlabs.ai/nexcloud/api/endpoints.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.