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

# Reconnect a Claude Code connection

> Replaces the connection's credential: a setup token for a Claude plan, an API key for an Anthropic API key. Your agent restarts when it runs on the connection and the credential changed. Refused with 400 connection_kind_mismatch for a credential of another kind than the connection's, and 404 connection_not_found for a connection you do not hold.



## OpenAPI

````yaml api-reference/openapi.account.json PUT /claude-code/auth/{id}
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:
  /claude-code/auth/{id}:
    put:
      tags:
        - claude-code-auth
      summary: Reconnect a Claude Code connection
      description: >-
        Replaces the connection's credential: a setup token for a Claude plan,
        an API key for an Anthropic API key. Your agent restarts when it runs on
        the connection and the credential changed. Refused with 400
        connection_kind_mismatch for a credential of another kind than the
        connection's, and 404 connection_not_found for a connection you do not
        hold.
      operationId: reconnectClaudeCodeAuth
      parameters:
        - description: The connection's id.
          in: path
          name: id
          required: true
          schema:
            description: The connection's id.
            format: uuid
            type: string
      requestBody:
        content:
          application/json:
            schema:
              oneOf:
                - $ref: '#/components/schemas/ClaudeCodeSetupToken'
                - $ref: '#/components/schemas/ClaudeCodeAPIKey'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentConnection'
          description: OK
        '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
components:
  schemas:
    ClaudeCodeSetupToken:
      additionalProperties: false
      properties:
        token:
          minLength: 20
          pattern: ^\s*sk-ant-oat\S{10,}\s*$
          type: string
      required:
        - token
      type: object
    ClaudeCodeAPIKey:
      additionalProperties: false
      properties:
        api_key:
          minLength: 20
          pattern: ^\s*sk-ant-api\S{10,}\s*$
          type: string
      required:
        - api_key
      type: object
    AgentConnection:
      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
        kind:
          description: >-
            Which of the provider's credentials the connection holds: plan, a
            Claude plan's setup token or a ChatGPT plan's tokens; api_key, an
            Anthropic or OpenAI API key; host_plan, the ChatGPT login your agent
            did on its own host; auth_file, an OpenCode auth file; tokens, a
            Cursor token pair.
          enum:
            - plan
            - api_key
            - host_plan
            - auth_file
            - tokens
          type: string
        name:
          description: >-
            The name you gave the connection, unique among your connections of
            its provider and kind.
          minLength: 1
          type: string
        needs_reauth:
          type: boolean
        providers:
          description: The model providers an OpenCode auth file signs in to.
          items:
            type: string
          type:
            - array
            - 'null'
        reauth_reason:
          type: string
      required:
        - id
        - kind
        - name
        - needs_reauth
      type: object
    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
    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.