> ## Documentation Index
> Fetch the complete documentation index at: https://bkey.id/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Device Authorization

> RFC 8628 device authorization request. Returns a user_code and verification_uri that the user visits on another device to approve. Poll POST /oauth/token with grant_type urn:ietf:params:oauth:grant-type:device_code to retrieve the token.



## OpenAPI

````yaml post /oauth/device/code
openapi: 3.1.0
info:
  title: BKey API
  description: Biometric approval infrastructure for AI agents — OAuth 2.1 + CIBA
  version: 1.0.0
  contact:
    name: BKey
    url: https://bkey.id
    email: dev@bkey.id
  license:
    name: Apache-2.0
    url: https://www.apache.org/licenses/LICENSE-2.0
servers:
  - url: https://api.bkey.id
    description: Production
security:
  - bearerAuth: []
tags:
  - name: OAuth
    description: OAuth 2.1 token, device auth, CIBA, revocation
  - name: Checkout
    description: Agent-initiated checkout with biometric approval
  - name: Vault
    description: Encrypted secret storage with biometric access
  - name: Payments
    description: Payment methods and shared payment tokens
  - name: Identity
    description: DID and identity management
paths:
  /oauth/device/code:
    post:
      tags:
        - OAuth
      summary: Device Authorization
      description: >-
        RFC 8628 device authorization request. Returns a user_code and
        verification_uri that the user visits on another device to approve. Poll
        POST /oauth/token with grant_type
        urn:ietf:params:oauth:grant-type:device_code to retrieve the token.
      responses:
        '200':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  device_code:
                    type: string
                  user_code:
                    type: string
                  verification_uri:
                    type: string
                    format: uri
                  verification_uri_complete:
                    type: string
                    format: uri
                  expires_in:
                    type: integer
                    description: Device code lifetime in seconds
                  interval:
                    type: integer
                    description: Minimum polling interval in seconds
                required:
                  - device_code
                  - user_code
                  - verification_uri
                  - expires_in
                  - interval
                additionalProperties: false
        '400':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: Error code (e.g., invalid_grant, unauthorized_client)
                  error_description:
                    type: string
                  error_uri:
                    type: string
                    format: uri
                required:
                  - error
                additionalProperties: false
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: EdDSA-signed JWT obtained via OAuth 2.1 client_credentials or CIBA

````