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

# API versioning

> Dated API versions, the version header, and how to pin the version your app uses

The REST API uses dated versions. A version is a date such as `2026-07-14`. You pin a
version so your integration keeps behaving the same way as the API evolves.

## The version header

Send the version you built against in the `Nemu-Api-Version` header.

```bash theme={null}
curl 'https://platform.nemu.cc/api/v1/workspaces' \
  -H 'Authorization: Bearer eyJhbGciOi...' \
  -H 'Nemu-Api-Version: 2026-07-14'
```

If you omit the header, the request uses the latest version. Every response echoes the
version it was served with in the same `Nemu-Api-Version` header.

<Warning>
  Relying on the latest version means your app can change behavior when a new version ships.
  Pin a version in production.
</Warning>

## Discover the latest version

`GET /api/version` is public and needs no token. It reports the current major version, the
header name, the latest dated version, and every supported version.

```bash theme={null}
curl 'https://platform.nemu.cc/api/version'
```

```json theme={null}
{
  "major": "v1",
  "header": "Nemu-Api-Version",
  "latest": "2026-07-14",
  "supported": ["2026-07-14"]
}
```

## Unsupported versions

If you send a version that is not in the supported list, the API rejects the request with
`400` and returns the versions it accepts.

```json theme={null}
{
  "error": "Unsupported API version: 1999-01-01",
  "supported": ["2026-07-14"]
}
```

## Pin the version in the SDK

The SDK sends the latest version it knows about by default. Pass `api_version` to pin a
specific version, and read the versions from the exported `ApiVersion` enum.

```ts theme={null}
import { Nemu, ApiVersion, LATEST_API_VERSION } from "@nemu-ai/sdk";

const nemu = new Nemu({
  client_id: process.env.nemu_client_id!,
  client_secret: process.env.nemu_client_secret!,
  api_version: ApiVersion.V2026_07_14,
});

console.log(LATEST_API_VERSION);
console.log(await nemu.version());
```

The SDK also exports an `ENDPOINTS` map that describes every endpoint, the methods it
accepts, and the version it was introduced in.

```ts theme={null}
import { ENDPOINTS, Endpoint } from "@nemu-ai/sdk";

console.log(ENDPOINTS[Endpoint.User]);
```

```json theme={null}
{
  "path": "/user",
  "methods": ["GET"],
  "since": "2026-07-14",
  "versioned": true
}
```

## What is versioned

The `major` version lives in the path as `/api/v1`. The dated version selects behavior
within that major version. The authorization endpoints, the token endpoint, and the version
endpoint are unversioned and do not take the header.
