Skip to content
OpenRelay is in early access, and the /v1 API is stable. New capabilities ship in the changelog.
API ReferenceAccount and accessAccount

Start a CLI device login (no auth)

Starts the orl auth login device flow: returns a device code for the CLI to poll and a 6-digit user code for a signed-in person to confirm. No API key or session is required: this is how an unauthenticated CLI starts the flow that gets it one. The code expires in 10 minutes. deviceName is the requesting host's best-effort hostname, shown on the approval page so the signed-in user can recognize their own terminal before confirming the code.

Required permission

Requires no authentication.

POST
/v1/cli-auth/device

Request Body

application/json
  1. body
deviceName?string
Lengthlength <= 128

Response Body

A fresh device/user code pair

application/json
  1. response
deviceCode*string

Opaque; the CLI polls POST /v1/cli-auth/token with this.

userCode*string

The 6 digits the CLI prints for a human to enter.

Match^[0-9]{6}$
verificationUri*string
Formaturi
verificationUriComplete*string

verificationUri with ?code= pre-filled; the approval page still requires the user to confirm it matches their terminal.

Formaturi
expiresIn*integer

Seconds until the code expires (600).

interval*integer

Minimum seconds between polls; a faster poll gets slow_down.

Example Request
curl -X POST 'https://api.openrelay.inc/v1/cli-auth/device' \  -H 'Content-Type: application/json' \  -d '{}'
Example Response
{  "deviceCode": "string",  "userCode": "string",  "verificationUri": "http://example.com",  "verificationUriComplete": "http://example.com",  "expiresIn": 0,  "interval": 0}