> ## 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.

# Start a ChatGPT plan device sign-in

> Starts a device sign-in to a ChatGPT plan and returns its id with the code the caller enters at verification_url.

Use this tool when you need to:
- Connect a ChatGPT plan so the caller's Codex tasks can run on it, by signing in to ChatGPT with a one-time code
- Sign a ChatGPT plan connection in again when it needs re-authentication, keeping its id

Examples:
- POST /connections/chatgpt-plan/device-auths {"mode": "add", "name": "Personal ChatGPT plan"}
- POST /connections/chatgpt-plan/device-auths {"mode": "reconnect", "connection_id": "6f1c2a9e-3b7d-4c55-9a2e-0d8b1f4e7c21"}

Hints:
- mode is required: add with name (1 to 100 characters on one line, with no space, tab, form feed or carriage return at either end), or reconnect with connection_id, the uuid of a ChatGPT plan connection the caller holds; the schema answers 422 for any other shape.
- Answers 201 with id, user_code, verification_url and interval: the caller signs in to ChatGPT at verification_url and enters user_code, and getChatgptPlanDeviceAuth reads the sign-in by its id every interval seconds until it is complete.
- No connection is written yet: once a read finds the caller signed in, mode add stores the plan as a new connection under name and mode reconnect stores it in the ChatGPT plan connection connection_id names. The name is checked only then, so a name already taken is refused by that read, not here.
- Use addOpenaiApiKeyConnection instead to connect an OpenAI API key; reconnectConnection takes no ChatGPT plan, so a ChatGPT plan reconnects here.
- Any signed-in user may call it for themselves, an agent host's grant included (the Aether CLI in the agent's box calls it for its owner); through a platform API key pinned to an org where the caller is a viewer or billing member it is refused with 403 org_role_insufficient.
- Refused with 404 connection_not_found for a connection_id the caller does not hold (or one the schema admits that is not a canonical lowercase uuid), 409 connection_option_mismatch for a connection of another option than a ChatGPT plan, and 502 when ChatGPT does not start the sign-in.



## OpenAPI

````yaml api-reference/openapi.json POST /connections/chatgpt-plan/device-auths
openapi: 3.1.0
info:
  title: Aether API
  version: 0.1.0
servers:
  - url: https://api.runaether.dev
security:
  - bearerAuth: []
paths:
  /connections/chatgpt-plan/device-auths:
    post:
      tags:
        - connections
      summary: Start a ChatGPT plan device sign-in
      description: >-
        Starts a device sign-in to a ChatGPT plan and returns its id with the
        code the caller enters at verification_url.


        Use this tool when you need to:

        - Connect a ChatGPT plan so the caller's Codex tasks can run on it, by
        signing in to ChatGPT with a one-time code

        - Sign a ChatGPT plan connection in again when it needs
        re-authentication, keeping its id


        Examples:

        - POST /connections/chatgpt-plan/device-auths {"mode": "add", "name":
        "Personal ChatGPT plan"}

        - POST /connections/chatgpt-plan/device-auths {"mode": "reconnect",
        "connection_id": "6f1c2a9e-3b7d-4c55-9a2e-0d8b1f4e7c21"}


        Hints:

        - mode is required: add with name (1 to 100 characters on one line, with
        no space, tab, form feed or carriage return at either end), or reconnect
        with connection_id, the uuid of a ChatGPT plan connection the caller
        holds; the schema answers 422 for any other shape.

        - Answers 201 with id, user_code, verification_url and interval: the
        caller signs in to ChatGPT at verification_url and enters user_code, and
        getChatgptPlanDeviceAuth reads the sign-in by its id every interval
        seconds until it is complete.

        - No connection is written yet: once a read finds the caller signed in,
        mode add stores the plan as a new connection under name and mode
        reconnect stores it in the ChatGPT plan connection connection_id names.
        The name is checked only then, so a name already taken is refused by
        that read, not here.

        - Use addOpenaiApiKeyConnection instead to connect an OpenAI API key;
        reconnectConnection takes no ChatGPT plan, so a ChatGPT plan reconnects
        here.

        - Any signed-in user may call it for themselves, an agent host's grant
        included (the Aether CLI in the agent's box calls it for its owner);
        through a platform API key pinned to an org where the caller is a viewer
        or billing member it is refused with 403 org_role_insufficient.

        - Refused with 404 connection_not_found for a connection_id the caller
        does not hold (or one the schema admits that is not a canonical
        lowercase uuid), 409 connection_option_mismatch for a connection of
        another option than a ChatGPT plan, and 502 when ChatGPT does not start
        the sign-in.
      operationId: createChatgptPlanDeviceAuth
      requestBody:
        content:
          application/json:
            schema:
              discriminator:
                mapping:
                  add: '#/components/schemas/ChatgptPlanDeviceAuthAdd'
                  reconnect: '#/components/schemas/ChatgptPlanDeviceAuthReconnect'
                propertyName: mode
              oneOf:
                - $ref: '#/components/schemas/ChatgptPlanDeviceAuthAdd'
                - $ref: '#/components/schemas/ChatgptPlanDeviceAuthReconnect'
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChatgptPlanDeviceAuth'
          description: Created
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConnectionsErrorResponse'
          description: Bad Request
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConnectionsErrorResponse'
          description: Unauthorized
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrgAuthorizationErrorResponse'
          description: Forbidden
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConnectionsErrorResponse'
          description: Not Found
        '409':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConnectionsErrorResponse'
          description: Conflict
        '410':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConnectionsErrorResponse'
          description: Gone
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConnectionsErrorResponse'
          description: Unprocessable Entity
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConnectionsErrorResponse'
          description: Internal Server Error
        '502':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConnectionsErrorResponse'
          description: Bad Gateway
components:
  schemas:
    ChatgptPlanDeviceAuthAdd:
      additionalProperties: false
      properties:
        mode:
          enum:
            - add
          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
      required:
        - mode
        - name
      type: object
    ChatgptPlanDeviceAuthReconnect:
      additionalProperties: false
      properties:
        connection_id:
          description: The ChatGPT plan connection the sign-in stores the plan in.
          format: uuid
          type: string
        mode:
          enum:
            - reconnect
          type: string
      required:
        - mode
        - connection_id
      type: object
    ChatgptPlanDeviceAuth:
      additionalProperties: false
      properties:
        id:
          description: The sign-in's id, which its read takes.
          format: uuid
          type: string
        interval:
          description: How many seconds to wait between reads of the sign-in.
          format: int64
          minimum: 0
          type: integer
        user_code:
          description: The code you enter at verification_url.
          minLength: 1
          type: string
        verification_url:
          description: Where you sign in to ChatGPT and enter user_code.
          minLength: 1
          type: string
      required:
        - id
        - user_code
        - verification_url
        - interval
      type: object
    ConnectionsErrorResponse:
      additionalProperties: false
      properties:
        code:
          enum:
            - aether_inference_unavailable
            - aether_inference_unserved
            - agent_credential_unreadable
            - agent_host_account_deleting
            - agent_host_command_not_found
            - agent_host_creation_disabled
            - agent_host_exists
            - agent_host_illegal_transition
            - agent_host_not_allowlisted
            - agent_host_not_found
            - agent_host_other_provider_app
            - agent_host_project_not_eligible
            - agent_host_provisioning_failed
            - agent_host_state_changed
            - agent_host_wake_failed
            - agent_line_unavailable
            - bad_gateway
            - bad_request
            - cli_upgrade_required
            - client_outdated
            - conflict
            - connection_account_held
            - connection_agent_only
            - connection_harness_mismatch
            - connection_is_default
            - connection_name_taken
            - connection_not_found
            - connection_option_mismatch
            - connection_runs_agent
            - connection_runs_profiles
            - device_auth_not_found
            - fallback_is_own_connection
            - forbidden
            - gateway_timeout
            - gone
            - internal_error
            - line_exists
            - line_not_found
            - line_not_imessage
            - method_not_allowed
            - no_default_connection
            - not_acceptable
            - not_found
            - not_implemented
            - payment_required
            - precondition_failed
            - rate_limited
            - request_canceled
            - request_timeout
            - request_too_large
            - service_unavailable
            - unauthenticated
            - unsupported_media_type
            - validation_failed
            - whatsapp_not_enabled
          minLength: 1
          type: string
        error:
          minLength: 1
          type: string
        errors:
          items:
            $ref: '#/components/schemas/ErrorDetail'
          type: array
      required:
        - error
        - code
      type: object
    OrgAuthorizationErrorResponse:
      additionalProperties: false
      properties:
        code:
          enum:
            - org_membership_required
            - org_role_insufficient
            - org_suspended
            - account_deleting
            - agent_host_route_not_allowed
            - credential_kind_not_admitted
            - grant_scope_insufficient
          type: string
        error:
          minLength: 1
          type: string
      required:
        - error
        - code
      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
  securitySchemes:
    bearerAuth:
      bearerFormat: JWT
      scheme: bearer
      type: http

````

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