> ## 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: OpenRouter API key

> Replaces a openrouter_api_key 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.account.json PUT /connections/{id}/openrouter-api-key
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/{id}/openrouter-api-key:
    put:
      tags:
        - connections
      summary: 'Reconnect a connection: OpenRouter API key'
      description: >-
        Replaces a openrouter_api_key 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: reconnectOpenrouterApiKeyConnection
      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:
              $ref: '#/components/schemas/OpenRouterAPIKeyCredential'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Connection'
          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:
    OpenRouterAPIKeyCredential:
      additionalProperties: false
      properties:
        api_key:
          minLength: 7
          pattern: ^\s*sk-or-\S+\s*$
          type: string
      required:
        - api_key
      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
    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.