> ## 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 connection: OpenCode auth file

> Replaces a opencode_auth_file connection's credential, keeping its id. Your agent restarts when it runs on the connection and the credential changed. Refused with 409 connection_option_mismatch for a connection of another option, and 404 connection_not_found for a connection you do not hold.



## OpenAPI

````yaml api-reference/openapi.json PUT /connections/{connectionID}/opencode-auth-file
openapi: 3.1.0
info:
  title: Aether API
  version: 0.1.0
servers:
  - url: https://api.runaether.dev
security:
  - bearerAuth: []
paths:
  /connections/{connectionID}/opencode-auth-file:
    put:
      tags:
        - connections
      summary: 'Reconnect a connection: OpenCode auth file'
      description: >-
        Replaces a opencode_auth_file connection's credential, keeping its id.
        Your agent restarts when it runs on the connection and the credential
        changed. Refused with 409 connection_option_mismatch for a connection of
        another option, and 404 connection_not_found for a connection you do not
        hold.
      operationId: reconnectOpencodeAuthFileConnection
      parameters:
        - description: The connection's id.
          in: path
          name: connectionID
          required: true
          schema:
            description: The connection's id.
            format: uuid
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OpencodeAuthFileCredential'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Connection'
          description: OK
        '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
        '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
components:
  schemas:
    OpencodeAuthFileCredential:
      additionalProperties: false
      properties:
        contents:
          description: Your ~/.local/share/opencode/auth.json, verbatim.
          minLength: 1
          type: string
      required:
        - contents
      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
        profiles:
          description: The agent profiles that run on the connection.
          items:
            $ref: '#/components/schemas/ConnectionProfile'
          type:
            - array
            - 'null'
        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
    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
            - 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
            - 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
          type: string
        error:
          minLength: 1
          type: string
      required:
        - error
        - code
      type: object
    ConnectionProfile:
      additionalProperties: false
      properties:
        id:
          format: uuid
          type: string
        name:
          minLength: 1
          type: string
        org:
          description: The name of the organization the profile belongs to.
          minLength: 1
          type: string
      required:
        - id
        - name
        - org
      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.