---
title: "Request a device authorization code"
method: POST
path: "/device/code"
tags: ["Device Auth"]
---

# Request a device authorization code

`POST /device/code`

## Request

- Base URL: `https://nanostudiopro.com/api`
- URL: `https://nanostudiopro.com/api/device/code`
- Auth: none required

Step 1 of the device flow: the CLI calls this to get an opaque `device_code` (used for polling) and a short human-friendly `user_code` (e.g. `BCDF-GHJK`). The CLI then displays the `user_code` and `verification_uri_complete` to the user, who pastes the code into a browser at the verification URL. Rate-limited to 10/min/IP. **No authentication required** — this is the only unauthenticated endpoint in the device flow.

## Request body

- object

## Response `200`

Code issued

- DeviceCodeResponse
  - `device_code` string, required: Opaque secret. The CLI uses this to poll `/device/token`.
  - `user_code` string, required: Short human-friendly code the user types in the browser. Alphabet excludes vowels and visually-ambiguous characters (no 0/O/1/I/L).
  - `verification_uri` string, uri, required: Base URL where the user enters the code.
  - `verification_uri_complete` string, uri, required: Verification URL with the `user_code` prefilled in the query string. Open this directly in the browser to skip a manual paste.
  - `expires_in` integer, required: Seconds until the code expires.
  - `interval` integer, required: Minimum seconds between polls of `/device/token`.

## Other responses

- `429`: Too many code requests

---

[API](https://skmtc.dev/nanostudiopro/apis/nano-studio-pro-api.md) · [All operations](https://skmtc.dev/nanostudiopro/apis/nano-studio-pro-api/llms.txt) · [OpenAPI document](https://skmtc.dev/nanostudiopro/apis/nano-studio-pro-api/revisions/7f7d4a72b17c?raw)
