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

> ## Agent Instructions
> Use Stable documentation by default. Honor an explicit Beta request or a URL under /docs/beta/. If the requested version conflicts with the installed CLI package or API origin, clarify the target before writing integration code.
> Pages under /docs/beta/ document Beta; other product pages document Stable. Keep the CLI package, commands, API origin, and credentials within the selected version. State the documentation version in your answer.
> For MCP search, always pass version: Stable or version: Beta. Unfiltered search mixes both versions. For filesystem reads, keep Beta queries under /beta/ and exclude /beta/ from Stable queries; discover paths before reading them.
> The public docs base is https://photon.codes/docs. Convert MCP page paths to public URLs under that base, preserving /beta/ when present. Read https://photon.codes/docs/skill.md for version selection and https://photon.codes/docs/llms.txt for the version indexes.

# Device

> The Device resource in the TypeScript, Python and Rust clients.

## Methods

<Tabs>
  <Tab title="TypeScript">
    **[Start device authorization](/docs/beta/api-client/sdk/auth/device/authorize)**

    ```typescript TypeScript theme={null}
    photon.auth.device.authorize(input?: DeviceAuthorizeInput, options?: RequestOptions): Promise<DeviceAuthorizeOutput>
    ```

    `POST /v1/auth/device/code`

    **[Exchange device code or refresh token](/docs/beta/api-client/sdk/auth/device/token)**

    ```typescript TypeScript theme={null}
    photon.auth.device.token(input: DeviceTokenInput, options?: RequestOptions): Promise<DeviceTokenOutput>
    ```

    `POST /v1/auth/device/token`
  </Tab>

  <Tab title="Python">
    **[Start device authorization](/docs/beta/api-client/sdk/auth/device/authorize)**

    ```python Python theme={null}
    photon.auth.device.authorize(input: DeviceAuthorizeInput | None = None) -> models.DeviceAuthorizeResponse
    ```

    `POST /v1/auth/device/code`

    **[Exchange device code or refresh token](/docs/beta/api-client/sdk/auth/device/token)**

    ```python Python theme={null}
    photon.auth.device.token(input: DeviceTokenInput) -> models.DeviceTokenResponse
    ```

    `POST /v1/auth/device/token`
  </Tab>

  <Tab title="Rust">
    **[Start device authorization](/docs/beta/api-client/sdk/auth/device/authorize)**

    ```rust Rust theme={null}
    client.device_authorize().await -> Result<ResponseValue<types::DeviceAuthorizeResponse>, Error<DeviceAuthorizeError>>
    ```

    `POST /v1/auth/device/code`

    **[Exchange device code or refresh token](/docs/beta/api-client/sdk/auth/device/token)**

    ```rust Rust theme={null}
    client.device_token(body: &types::DeviceTokenRequest).await -> Result<ResponseValue<types::DeviceTokenResponse>, Error<DeviceTokenError>>
    ```

    `POST /v1/auth/device/token`
  </Tab>
</Tabs>

## Models

### DeviceAuthorizeResponse

<ResponseField name="device_code" type={"string"} required>
  Opaque device code to exchange at POST /v1/auth/device/token while waiting for the user to authorize.
</ResponseField>

<ResponseField name="expires_in" type={"number"} required>
  Lifetime of the device code and user code, in seconds.
</ResponseField>

<ResponseField name="interval" type={"number"} required>
  Minimum number of seconds to wait between token polling requests.
</ResponseField>

<ResponseField name="user_code" type={"string"} required>
  Code the user enters at verification\_uri to authorize this device.
</ResponseField>

<ResponseField name="verification_uri" type={"string"} required>
  Browser URL where the user enters user\_code and authorizes the device.
</ResponseField>

<ResponseField name="verification_uri_complete" type={"string"} required>
  Browser URL with user\_code included, ready to open or encode as a QR code.
</ResponseField>

### DeviceTokenResponse

<ResponseField name="access_token" type={"string"} required>
  Bearer access token for authenticated Photon API requests.
</ResponseField>

<ResponseField name="authentication_method" type={"string"}>
  Authentication method used for the device login, when returned. Omitted for refresh grants.
</ResponseField>

<ResponseField name="expires_in" type={"number"} required>
  Access-token validity in seconds, derived from its expiry and issue times; defaults to 300 when unavailable.
</ResponseField>

<ResponseField name="refresh_token" type={"string"} required>
  Refresh token for the next refresh grant. Tokens rotate on every grant; replace the stored value with this one.
</ResponseField>

<ResponseField name="user" type={"DeviceTokenResponseUser"} required>
  Profile of the authenticated user.
</ResponseField>


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