curl --request POST \
--url https://omnimux.ai/api/user/device/code \
--header 'Content-Type: application/json' \
--data '{"client_name":"my-cli"}'
curl --request POST \
--url https://omnimux.ai/api/user/device/token \
--header 'Content-Type: application/json' \
--data '{"device_code":"<device_code>","grant_type":"urn:ietf:params:oauth:grant-type:device_code"}'
{
"success": true,
"data": {
"device_code": "...",
"user_code": "ABCD-EFGH",
"verification_uri": "https://omnimux.ai/cli/login",
"verification_uri_complete": "https://omnimux.ai/cli/login?user_code=ABCD-EFGH",
"expires_in": 900,
"interval": 5
}
}
{
"success": false,
"code": "authorization_pending",
"message": "authorization pending",
"interval": 5
}
{
"success": true,
"data": {
"access_token": "...",
"token_type": "Bearer",
"user_id": 1,
"username": "alice"
}
}
{
"success": false,
"code": "access_denied",
"message": "authorization denied"
}
curl --request POST \
--url https://omnimux.ai/api/user/device/code \
--header 'Content-Type: application/json' \
--data '{"client_name":"my-cli"}'
curl --request POST \
--url https://omnimux.ai/api/user/device/token \
--header 'Content-Type: application/json' \
--data '{"device_code":"<device_code>","grant_type":"urn:ietf:params:oauth:grant-type:device_code"}'
{
"success": true,
"data": {
"device_code": "...",
"user_code": "ABCD-EFGH",
"verification_uri": "https://omnimux.ai/cli/login",
"verification_uri_complete": "https://omnimux.ai/cli/login?user_code=ABCD-EFGH",
"expires_in": 900,
"interval": 5
}
}
{
"success": false,
"code": "authorization_pending",
"message": "authorization pending",
"interval": 5
}
{
"success": true,
"data": {
"access_token": "...",
"token_type": "Bearer",
"user_id": 1,
"username": "alice"
}
}
{
"success": false,
"code": "access_denied",
"message": "authorization denied"
}
Authentication
Device Code Login
RFC 8628-style device login: request device_code → browser approve → poll for access_token
curl --request POST \
--url https://omnimux.ai/api/user/device/code \
--header 'Content-Type: application/json' \
--data '{"client_name":"my-cli"}'
curl --request POST \
--url https://omnimux.ai/api/user/device/token \
--header 'Content-Type: application/json' \
--data '{"device_code":"<device_code>","grant_type":"urn:ietf:params:oauth:grant-type:device_code"}'
{
"success": true,
"data": {
"device_code": "...",
"user_code": "ABCD-EFGH",
"verification_uri": "https://omnimux.ai/cli/login",
"verification_uri_complete": "https://omnimux.ai/cli/login?user_code=ABCD-EFGH",
"expires_in": 900,
"interval": 5
}
}
{
"success": false,
"code": "authorization_pending",
"message": "authorization pending",
"interval": 5
}
{
"success": true,
"data": {
"access_token": "...",
"token_type": "Bearer",
"user_id": 1,
"username": "alice"
}
}
{
"success": false,
"code": "access_denied",
"message": "authorization denied"
}
POST
/
api
/
user
/
device
/
code
curl --request POST \
--url https://omnimux.ai/api/user/device/code \
--header 'Content-Type: application/json' \
--data '{"client_name":"my-cli"}'
curl --request POST \
--url https://omnimux.ai/api/user/device/token \
--header 'Content-Type: application/json' \
--data '{"device_code":"<device_code>","grant_type":"urn:ietf:params:oauth:grant-type:device_code"}'
{
"success": true,
"data": {
"device_code": "...",
"user_code": "ABCD-EFGH",
"verification_uri": "https://omnimux.ai/cli/login",
"verification_uri_complete": "https://omnimux.ai/cli/login?user_code=ABCD-EFGH",
"expires_in": 900,
"interval": 5
}
}
{
"success": false,
"code": "authorization_pending",
"message": "authorization pending",
"interval": 5
}
{
"success": true,
"data": {
"access_token": "...",
"token_type": "Bearer",
"user_id": 1,
"username": "alice"
}
}
{
"success": false,
"code": "access_denied",
"message": "authorization denied"
}
- Account management user API (CLI / headless login)
- Code request and token poll need no auth; approve/deny need a logged-in browser session
- The returned
access_tokenis forhttps://omnimux.aiuser APIs, not a replacement for sk- relay keys; explicitly authorized character/video user APIs can consume account allowance
Identity
| Field | Value |
|---|---|
| Series | Account |
| Capability | Device login |
Endpoints
| Step | Method | Path | Auth |
|---|---|---|---|
| 1. Request device code | POST | /api/user/device/code | None |
| 2. Browser approval | Open verification_uri | Console / CLI login page | Browser session |
| 3. Poll for token | POST | /api/user/device/token | None |
| 4. Approve / deny (optional, logged-in) | POST | /api/user/device/approve · /api/user/device/deny | User session |
https://omnimux.ai
Authorization
| Step | Requirement |
|---|---|
device/code · device/token | No Authorization / New-Api-User |
device/approve · device/deny | Logged-in browser session; body includes user_code. Approval additionally sends the exact-device verification proof in X-Security-Proof; denial does not require a proof |
| After token issued | Allowed user APIs: Authorization: Bearer <access_token>; New-Api-User is optional compatibility metadata and does not participate in authentication |
sk- tokens on https://api.omnimux.ai — a different credential surface. See Connection & usage.
Scoped device approval
The browser must confirm the exact device code and complete security verification forcli.device.approve. This operation is separate from manual token creation. The verification context binds device_flow_id, normalized user_code, the granted scopes, and the token’s absolute expires_at. Use the metadata returned by the server unchanged; do not calculate a new deadline or broaden permissions in the client. A proof for another device, account, session, permission set, or expiry cannot approve this request. Both approval and denial are browser-session-only; personal tokens cannot approve other devices.
The new device token expires 30 days from device-flow creation. It grants personal business permissions only, even when an administrator signs in: profile lookup; gateway-key management and full-key access; social publishing; hosted channels; inspiration queries/sharing; file uploads; and explicitly approved character/video creation. The exact grant is api_key:read, api_key:reveal, api_key:write, files:read, files:write, hosted:read, hosted:write, influencer_creation:read, influencer_creation:write, inspiration:read, inspiration:write, profile:read, social:read, and social:write. It does not grant usage:read, influencer:read, administrator/system permissions, wallet writes, profile writes, account-security changes, or playground generation. See the permission guide. Existing ownership, role, and billing checks still apply.
A successful new device login replaces only that user’s device-token slot and clears the old single-token credential. It preserves independently created manual personal tokens. Replacing the device slot invalidates the prior device token, so other devices using it must sign in again. Expiry or revocation also requires another device login; no permanent credential is silently issued.
The existing CLI response fields access_token, user_id, username, and token_type remain unchanged. Existing clients can store the new nap_ string without a client-format bump; this does not promise that every external client’s business flow has been verified. The secret is issued once and cannot later be revealed from the token list. Legacy clients still holding a single-token credential must sign in again by November 3, 2026 at 13:52:36 UTC (2026-11-03T13:52:36Z).
Character and video creation approval
New device approvals includeinfluencer_creation:read and influencer_creation:write and disclose creation, owned-history access and consumption of account credits/subscription allowance. Existing tokens are never expanded automatically; sign in again and approve the new grant. Pending older device flows must restart. These scopes cover only the new creation API, not all account usage or browser-only playground generation. An already accepted task continues after token revocation, while new protected requests are denied.
Body / parameters
POST /api/user/device/code
| Field | Type | Required | Description |
|---|---|---|---|
client_name | string | no | Client label (e.g. my-cli); omitting user_code requests a new device flow |
user_code | string | no | look up an existing pending flow’s public verification metadata; does not create another flow or return its device secret |
POST /api/user/device/token
| Field | Type | Required | Description |
|---|---|---|---|
device_code | string | yes | device_code from step 1 |
grant_type | string | no | If set, must be urn:ietf:params:oauth:grant-type:device_code |
interval (default ~5s); polling faster returns slow_down.
Response
Step 1 · 200 (code issued)
| Field | Description |
|---|---|
data.device_code | Secret for the device (poll with this) |
data.user_code | Short code the user types in the browser |
data.verification_uri | Approval page URL |
data.verification_uri_complete | URL with prefilled user_code |
data.expires_in | Lifetime in seconds (default 900) |
data.interval | Recommended poll interval (seconds) |
data.verification_scope | cli.device.approve |
data.verification_context | exact device-flow ID, normalized user code, selected permissions, and absolute token expiry; pass unchanged to security verification |
Step 3 · success (approved)
| Field | Description |
|---|---|
data.access_token | Scoped personal access token beginning with nap_; store the returned secret privately |
data.token_type | Bearer |
data.user_id | Signed-in user ID; existing clients may keep it without using it as authentication |
data.username | Username |
Step 3 · pending / errors (often HTTP 200 with success: false)
code | Meaning |
|---|---|
authorization_pending | User has not approved yet |
slow_down | Polling too fast |
access_denied | User denied |
expired_token / invalid_grant | Expired or invalid |