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

# POST /v1/oauth/device/code



## OpenAPI

````yaml /generated/openapi.json post /v1/oauth/device/code
openapi: 3.1.0
info:
  description: >-
    Forwarding, management, portal and OAuth APIs generated from Rust types.
    Input and output schemas preserve their respective Serde contracts.
    Streaming events and WebSocket messages are documented alongside HTTP
    payloads.
  title: GPROXY HTTP API
  version: 4.2.1
servers: []
security:
  - bearer: []
  - anthropicKey: []
  - googleKey: []
  - queryKey: []
paths:
  /v1/oauth/device/code:
    post:
      tags:
        - OAuth
      summary: POST /v1/oauth/device/code
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Input_DeviceCodeRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/Input_DeviceCodeRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Output_DeviceCodeResponse'
          description: Success
        default:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Output_OAuthErrorBody'
          description: OAuth error
      security: []
components:
  schemas:
    Input_DeviceCodeRequest:
      description: RFC 8628 §3.1.
      properties:
        client_id:
          default: ''
          type: string
        scope:
          default: ''
          type: string
      type: object
    Output_DeviceCodeResponse:
      description: RFC 8628 §3.2. `device_code` is plaintext and exists only here.
      properties:
        device_code:
          description: The secret the device polls with.
          type: string
        expires_in:
          description: Seconds.
          format: int64
          type: integer
        interval:
          description: The minimum seconds between polls.
          format: int64
          type: integer
        user_code:
          description: >-
            The short code the person types, in the grouped form they read off
            the

            screen. Lookups normalize it, so any spelling with the right
            characters

            resolves.
          type: string
        verification_uri:
          type: string
        verification_uri_complete:
          description: |-
            The same page with the code already filled in, for a device that can
            show a QR code (RFC 8628 §3.3.1).
          type: string
      required:
        - device_code
        - user_code
        - verification_uri
        - verification_uri_complete
        - expires_in
        - interval
      type: object
    Output_OAuthErrorBody:
      description: RFC 6749 §5.2's error body, which RFC 7009 and RFC 8628 reuse.
      properties:
        error:
          type: string
        error_description:
          type: string
      required:
        - error
        - error_description
      type: object
  securitySchemes:
    bearer:
      scheme: bearer
      type: http
    anthropicKey:
      in: header
      name: x-api-key
      type: apiKey
    googleKey:
      in: header
      name: x-goog-api-key
      type: apiKey
    queryKey:
      in: query
      name: key
      type: apiKey

````

## Related topics

- [POST /v1/oauth/token](https://gproxy.leenhawk.com/api-reference/oauth/post-v1oauthtoken.md)
- [POST /v1/oauth/authorize](https://gproxy.leenhawk.com/api-reference/oauth/post-v1oauthauthorize.md)
- [POST /portal/api/oauth/device](https://gproxy.leenhawk.com/api-reference/portal/post-portalapioauthdevice.md)
- [POST /v1/oauth/revoke](https://gproxy.leenhawk.com/api-reference/oauth/post-v1oauthrevoke.md)
- [GET /v1/oauth/metadata](https://gproxy.leenhawk.com/api-reference/oauth/get-v1oauthmetadata.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.