Device Auth

Request a device authorization code

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.

post/device/code

Request

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

Request body

object required

Response

Code issued

device_codestring required

Opaque secret. The CLI uses this to poll /device/token.

user_codestring 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_uristring uri required

Base URL where the user enters the code.

verification_uri_completestring 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_ininteger required

Seconds until the code expires.

intervalinteger required

Minimum seconds between polls of /device/token.

Example response

{
  "device_code": "9p4xN-uw...",
  "user_code": "BCDF-GHJK",
  "verification_uri": "https://nanostudiopro.com/device",
  "verification_uri_complete": "https://nanostudiopro.com/device?code=BCDF-GHJK",
  "expires_in": 900,
  "interval": 5
}

Changes

No recorded changes to this operation across all 2 revisions of this API.