All requests below will use this key. Your API key is sent directly to api.cueapi.ai and never stored by the docs site.

POST/v1/auth/device-code

Device Code Flow

Create a device code for CLI/device authentication.

The device code flow allows CLI tools and devices to authenticate without handling credentials directly.

Flow

  1. Create device codePOST /v1/auth/device-code
  2. Show code to user — Display XXXX-XXXX code and verification URL
  3. User enters email — At the verification URL in their browser
  4. Magic link sent — User clicks the link in their email
  5. Poll for resultPOST /v1/auth/device-code/poll until status: "approved"
  6. Receive API key — Returned in the poll response
device_codestringrequiredbody

An 8-character alphanumeric code (displayed to user as XXXX-XXXX).

Request

bash
curl -X POST https://api.cueapi.ai/v1/auth/device-code \
  -H "Content-Type: application/json" \
  -d '{"device_code": "ABCD1234"}'
bash
curl -X POST https://api.cueapi.ai/v1/auth/device-code/poll \
  -H "Content-Type: application/json" \
  -d '{"device_code": "ABCD1234"}'
bash
curl -X POST https://api.cueapi.ai/v1/auth/device-code/submit-email \
  -H "Content-Type: application/json" \
  -d '{"device_code": "ABCD1234", "email": "you@example.com"}'

Response

json
{
  "device_code": "ABCD1234",
  "verification_url": "https://api.cueapi.ai/auth/device?code=ABCD1234",
  "expires_in": 600
}
json
{
  "status": "pending"
}
json
{
  "status": "approved",
  "api_key": "cue_sk_a1b2c3d4..."
}
json
{
  "status": "expired"
}
POST/v1/auth/device-code
Try it
Request Body
Enter your API key above to send requests