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

# Mint your agent a read-only token for a repository

> Your personal agent's host, by its own grant alone, mints a GitHub token that reads one repository's contents and metadata for an hour, to clone and search it. The repository is the one a live project of an organization you hold a product role in links by GitHub id, authorized live against your GitHub connection by that id, and named as GitHub names it now. Refused (403 not_an_agent_host) to any caller but the host's grant, (409 agent_host_not_ready) unless the host is running or waking, (404 repository_not_connected) when none of your projects names the repository, (409 repository_linked_by_name) when they link it by name only (re-import the project), (409 repository_links_diverge) when they link different GitHub repositories under the name, (403 repository_out_of_scope) when your GitHub account no longer reaches it, (409 github_reconnect_required) when your GitHub connection must be renewed, and (503 github_auth_check_unavailable) when GitHub could not answer.



## OpenAPI

````yaml api-reference/openapi.account.json POST /agent-host/repo-tokens
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:
  /agent-host/repo-tokens:
    post:
      tags:
        - agent
      summary: Mint your agent a read-only token for a repository
      description: >-
        Your personal agent's host, by its own grant alone, mints a GitHub token
        that reads one repository's contents and metadata for an hour, to clone
        and search it. The repository is the one a live project of an
        organization you hold a product role in links by GitHub id, authorized
        live against your GitHub connection by that id, and named as GitHub
        names it now. Refused (403 not_an_agent_host) to any caller but the
        host's grant, (409 agent_host_not_ready) unless the host is running or
        waking, (404 repository_not_connected) when none of your projects names
        the repository, (409 repository_linked_by_name) when they link it by
        name only (re-import the project), (409 repository_links_diverge) when
        they link different GitHub repositories under the name, (403
        repository_out_of_scope) when your GitHub account no longer reaches it,
        (409 github_reconnect_required) when your GitHub connection must be
        renewed, and (503 github_auth_check_unavailable) when GitHub could not
        answer.
      operationId: createAgentHostRepoToken
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateAgentHostRepoTokenRequest'
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentHostRepoToken'
          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:
                anyOf:
                  - $ref: '#/components/schemas/ErrorResponse'
                  - $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
        '503':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Service Unavailable
components:
  schemas:
    CreateAgentHostRepoTokenRequest:
      additionalProperties: false
      properties:
        name:
          description: The repository's name, as one of your projects names it.
          maxLength: 100
          minLength: 1
          type: string
        owner:
          description: The repository's owner, as one of your projects names it.
          maxLength: 39
          minLength: 1
          type: string
      required:
        - owner
        - name
      type: object
    AgentHostRepoToken:
      additionalProperties: false
      properties:
        expires_at:
          description: When GitHub expires the token, an hour after it was minted.
          format: date-time
          type: string
        full_name:
          description: >-
            The repository's current owner/name on GitHub, which differs from
            the name asked for once it was renamed.
          type: string
        repository_id:
          description: The repository's GitHub id.
          format: int64
          type: integer
        token:
          description: >-
            A GitHub App installation token that reads this repository's
            contents and metadata, and nothing else.
          type: string
      required:
        - token
        - expires_at
        - repository_id
        - full_name
      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.