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

# Poll the ChatGPT plan device flow

> Polls the device flow the start request began: 202 while you have not signed in, then 200 with the ChatGPT plan connection your plan is stored in, a new one under name, or the one connection_id names. Refused with 409 connection_name_taken when you already use the name for a ChatGPT plan, 409 connection_account_held when the ChatGPT account is already another connection, 409 connection_option_mismatch when connection_id names a connection of another option, and 404 connection_not_found for a connection you do not hold.



## OpenAPI

````yaml api-reference/openapi.account.json POST /connections/chatgpt-plan/device-auth/poll
openapi: 3.1.0
info:
  title: Aether Account & Integrations API
  version: 0.1.0
  description: >-
    Account, billing, and integration-management endpoints used by the Aether
    web app and CLI. Root-mounted; NOT part of the versioned /v1 contract.
servers:
  - url: https://api.runaether.dev
security:
  - bearerAuth: []
paths:
  /connections/chatgpt-plan/device-auth/poll:
    post:
      tags:
        - connections
      summary: Poll the ChatGPT plan device flow
      description: >-
        Polls the device flow the start request began: 202 while you have not
        signed in, then 200 with the ChatGPT plan connection your plan is stored
        in, a new one under name, or the one connection_id names. Refused with
        409 connection_name_taken when you already use the name for a ChatGPT
        plan, 409 connection_account_held when the ChatGPT account is already
        another connection, 409 connection_option_mismatch when connection_id
        names a connection of another option, and 404 connection_not_found for a
        connection you do not hold.
      operationId: pollChatgptPlanDeviceAuth
      requestBody:
        content:
          application/json:
            schema:
              oneOf:
                - $ref: '#/components/schemas/CodexDeviceAuthAdd'
                - $ref: '#/components/schemas/CodexDeviceAuthReconnect'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PollCodexDeviceAuthResponse'
          description: OK
        '202':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PollCodexDeviceAuthResponse'
          description: Accepted
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Bad Request
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Unauthorized
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrgAuthorizationErrorResponse'
          description: Forbidden
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Not Found
        '409':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Conflict
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Unprocessable Entity
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Internal Server Error
        '502':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Bad Gateway
components:
  schemas:
    CodexDeviceAuthAdd:
      additionalProperties: false
      properties:
        device_auth_id:
          minLength: 1
          pattern: \S
          type: string
        name:
          description: >-
            The connection's name: unique among your connections of its option,
            without leading or trailing spaces.
          maxLength: 100
          minLength: 1
          pattern: ^\S(.*\S)?$
          type: string
        user_code:
          minLength: 1
          pattern: \S
          type: string
      required:
        - name
        - device_auth_id
        - user_code
      type: object
    CodexDeviceAuthReconnect:
      additionalProperties: false
      properties:
        connection_id:
          format: uuid
          type: string
        device_auth_id:
          minLength: 1
          pattern: \S
          type: string
        user_code:
          minLength: 1
          pattern: \S
          type: string
      required:
        - connection_id
        - device_auth_id
        - user_code
      type: object
    PollCodexDeviceAuthResponse:
      discriminator:
        mapping:
          complete: '#/components/schemas/PollCodexDeviceAuthCompleteResponse'
          pending: '#/components/schemas/PollCodexDeviceAuthPendingResponse'
        propertyName: status
      oneOf:
        - $ref: '#/components/schemas/PollCodexDeviceAuthPendingResponse'
        - $ref: '#/components/schemas/PollCodexDeviceAuthCompleteResponse'
    ErrorResponse:
      additionalProperties: false
      properties:
        code:
          type: string
        error:
          minLength: 1
          type: string
        errors:
          items:
            $ref: '#/components/schemas/ErrorDetail'
          type: array
      required:
        - error
      type: object
    OrgAuthorizationErrorResponse:
      additionalProperties: false
      properties:
        code:
          enum:
            - org_membership_required
            - org_role_insufficient
            - org_suspended
            - account_deleting
          type: string
        error:
          minLength: 1
          type: string
      required:
        - error
        - code
      type: object
    PollCodexDeviceAuthCompleteResponse:
      additionalProperties: false
      properties:
        connection:
          $ref: '#/components/schemas/Connection'
        status:
          enum:
            - complete
          type: string
      required:
        - status
        - connection
      type: object
    PollCodexDeviceAuthPendingResponse:
      additionalProperties: false
      properties:
        status:
          enum:
            - pending
          type: string
      required:
        - status
      type: object
    ErrorDetail:
      additionalProperties: false
      properties:
        location:
          description: >-
            Where the error occurred, e.g. 'body.items[3].tags' or
            'path.thing-id'
          type: string
        message:
          description: Error message text
          type: string
        value:
          description: The value at the given location
      type: object
    Connection:
      additionalProperties: false
      properties:
        email:
          description: A ChatGPT plan's account email, when its token names one.
          minLength: 1
          type: string
        id:
          format: uuid
          type: string
        key_suffix:
          description: An API key's last four characters, for a key of at least eight.
          minLength: 1
          type: string
        name:
          description: >-
            The name you gave the connection, unique among your connections of
            its option.
          minLength: 1
          type: string
        needs_reauth:
          type: boolean
        option:
          description: >-
            Which credential the connection holds, qualified by its vendor:
            claude_plan, a Claude plan's setup token; anthropic_api_key, an
            Anthropic API key; chatgpt_plan, a ChatGPT plan's tokens;
            chatgpt_host_plan, the ChatGPT login your agent did on its own host;
            openai_api_key, an OpenAI API key; openrouter_api_key, an OpenRouter
            API key; opencode_auth_file, an OpenCode auth file.
          enum:
            - claude_plan
            - anthropic_api_key
            - chatgpt_plan
            - chatgpt_host_plan
            - openai_api_key
            - openrouter_api_key
            - opencode_auth_file
          type: string
        providers:
          description: The model providers an OpenCode auth file signs in to.
          items:
            type: string
          type:
            - array
            - 'null'
        reauth_reason:
          type: string
        works_with:
          description: The harnesses that run on the connection, which its option decides.
          items:
            enum:
              - claude-code
              - codex
              - opencode
            type: string
          minItems: 1
          type: array
      required:
        - id
        - option
        - works_with
        - name
        - needs_reauth
      type: object
  securitySchemes:
    bearerAuth:
      bearerFormat: JWT
      scheme: bearer
      type: http

````

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