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-codeDevice 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
- Create device code —
POST /v1/auth/device-code - Show code to user — Display
XXXX-XXXXcode and verification URL - User enters email — At the verification URL in their browser
- Magic link sent — User clicks the link in their email
- Poll for result —
POST /v1/auth/device-code/polluntilstatus: "approved" - Receive API key — Returned in the poll response
device_codestringrequiredbodyAn 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
Try it/v1/auth/device-codeRequest Body
Enter your API key above to send requests