Skip to main content
POST

Overview

Initiates the device authorization flow for CLI tools and AI agents that cannot open a browser directly. Returns a user code that must be entered at the verification URL to authorize the device. Flow:
  1. Agent calls this endpoint to get a device_code and user_code
  2. User opens verification_url in their browser and enters the user_code
  3. Agent polls Poll Device Token with the device_code
  4. Once authorized, the poll returns an API key
No authentication required.

Body Parameters

client_name
string
default:"Unknown Client"
Name of the client requesting authorization (shown to user during approval)

Response

device_code
string
Opaque code for the agent to use when polling for the token
user_code
string
Human-readable code in XXXX-XXXX format for the user to enter
verification_url
string
URL where the user should enter the code
expires_in
integer
Seconds until the device code expires (600 = 10 minutes)
interval
integer
Minimum seconds between poll requests (5)

Example

Device Auth Flow