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

# Add a connection: OpenAI API key

> Stores a new openai_api_key connection under its name, leaving every other connection in place. Refused with 409 connection_name_taken when you already use the name for a OpenAI API key.



## OpenAPI

````yaml api-reference/openapi.account.json POST /connections/openai-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/openai-api-key:
    post:
      tags:
        - connections
      summary: 'Add a connection: OpenAI API key'
      description: >-
        Stores a new openai_api_key connection under its name, leaving every
        other connection in place. Refused with 409 connection_name_taken when
        you already use the name for a OpenAI API key.
      operationId: addOpenaiApiKeyConnection
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AddOpenAIAPIKeyConnectionRequest'
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Connection'
          description: Created
        '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
        '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:
    AddOpenAIAPIKeyConnectionRequest:
      additionalProperties: false
      properties:
        api_key:
          minLength: 4
          pattern: ^\s*sk-\S+\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
      required:
        - name
        - 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.