> ## Documentation Index
> Fetch the complete documentation index at: https://docs.akua.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# List OpenCode Servers

> Lists the workspace's OpenCode Servers, oldest first, deleted servers excluded. The default server is created on first use.



## OpenAPI

````yaml /openapi-public.json get /opencodes
openapi: 3.1.0
info:
  title: Akua API
  version: 1.0.0
  description: >-
    Public API for managing Akua workspaces, clusters, products, and installs.


    Authenticate with a workspace API token via the `Authorization: Bearer
    sk_akua_...` header.


    A workspace-owned token implies its workspace. Broad tokens select the
    active workspace via the optional `Akua-Context` header.
  contact:
    name: Akua API support
    email: support@akua.dev
    url: https://akua.dev/docs
servers:
  - url: https://api.akua.dev/v1
    description: Production
security: []
tags:
  - name: Auth
    description: Authentication and token management.
  - name: Custom domains
    description: Workspace custom domains and routing targets.
  - name: Cloudflare
    description: Cloudflare account credentials and gateway control.
  - name: Clusters
    description: Kubernetes clusters and cluster access operations.
  - name: ComputeConfigs
    description: Workspace compute provider configurations.
  - name: Entitlements
    description: Effective workspace capabilities and limits.
  - name: Dashboards
    description: Dashboard and widget resources.
  - name: Installs
    description: Installation and render operations.
  - name: Machines
    description: Compute machines and lifecycle events.
  - name: Notifications
    description: User notification state.
  - name: Offer Channels
    description: Private offer channels and policy versions.
  - name: Offers
    description: Marketplace offers and redemption tracking.
  - name: Operations
    description: Long-running operation status and controls.
  - name: Order Drafts
    description: Draft checkout orders and checkout sessions.
  - name: Organizations
    description: Organizations, memberships, and managed workspaces.
  - name: Packages
    description: Software packages, versions, and input schemas.
  - name: Products
    description: Marketplace product catalog resources.
  - name: Preview hostnames
    description: Install preview hostnames and routing state.
  - name: Quotas
    description: Workspace quota limits and usage.
  - name: Regions
    description: Available deployment regions.
  - name: Registry
    description: Container registry credentials and repositories.
  - name: Repository change requests
    description: Fork-backed repository change reviews and lifecycle actions.
  - name: Repositories
    description: Source repositories available to the workspace.
  - name: Secrets
    description: Workspace secrets and secret versions.
  - name: Snippets
    description: Reusable snippets and snippet runs.
  - name: Workspace subdomains
    description: Workspace subdomain identity.
  - name: Workspaces
    description: Workspace resources, members, and billing state.
paths:
  /opencodes:
    get:
      tags:
        - OpenCode Servers
      summary: List OpenCode Servers
      description: >-
        Lists the workspace's OpenCode Servers, oldest first, deleted servers
        excluded. The default server is created on first use.
      operationId: opencodes.list
      parameters:
        - name: akua-context
          in: header
          schema:
            type: string
            minLength: 1
            maxLength: 53
            description: >-
              Optional workspace/scope context for the request. Carries a single
              workspace wire id (`ws_…`) today. Only needed for broad tokens - a
              workspace-owned token implies its workspace.
            examples:
              - ws_j572abc123def456
          required: false
        - name: cursor
          in: query
          schema:
            type: string
            description: Pagination cursor from a previous response's `next_cursor`.
          required: false
        - name: limit
          in: query
          schema:
            type: integer
            description: Items per page (1-100, default 50)
            default: 50
            examples:
              - 50
            minimum: 1
            maximum: 100
          required: false
      responses:
        '200':
          description: OpenCode Server list
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OpenCodeServerList'
        '400':
          description: The request is malformed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiBadRequest'
        '401':
          description: Missing, invalid or expired credential.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiUnauthorized'
        '403':
          description: The credential may not act in this workspace.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiForbidden'
        '404':
          description: The resource was not found in this workspace.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiNotFound'
        '409':
          description: >-
            The request conflicts with existing resource state or immutable
            intent. | The resource changed since the etag the client sent; the
            current etag is in the metadata. | The idempotency key was already
            used for a different request.
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/ApiConflict'
                  - $ref: '#/components/schemas/ApiPreconditionFailed'
                  - $ref: '#/components/schemas/ApiIdempotencyConflict'
        '503':
          description: The service is temporarily unavailable.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiServiceUnavailable'
      security:
        - BearerAuth: []
components:
  schemas:
    OpenCodeServerList:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/OpenCodeServer'
        has_more:
          type: boolean
          description: True if more items exist after this page.
        next_cursor:
          anyOf:
            - type: string
            - type: 'null'
          description: Opaque cursor for the next page, or null if no more pages.
      required:
        - data
        - has_more
        - next_cursor
      additionalProperties: false
    ApiBadRequest:
      type: object
      properties:
        _tag:
          type: string
          enum:
            - Validation
        success:
          type: boolean
          enum:
            - false
        errors:
          type: array
          prefixItems:
            - $ref: '#/components/schemas/ApiErrorEntry'
          minItems: 1
          items:
            $ref: '#/components/schemas/ApiErrorEntry'
        result:
          type: object
          additionalProperties: false
      required:
        - _tag
        - success
        - errors
        - result
      additionalProperties: false
    ApiUnauthorized:
      type: object
      properties:
        _tag:
          type: string
          enum:
            - Unauthorized
        success:
          type: boolean
          enum:
            - false
        errors:
          type: array
          prefixItems:
            - $ref: '#/components/schemas/ApiErrorEntry'
          minItems: 1
          items:
            $ref: '#/components/schemas/ApiErrorEntry'
        result:
          type: object
          additionalProperties: false
      required:
        - _tag
        - success
        - errors
        - result
      additionalProperties: false
    ApiForbidden:
      type: object
      properties:
        _tag:
          type: string
          enum:
            - Forbidden
        success:
          type: boolean
          enum:
            - false
        errors:
          type: array
          prefixItems:
            - $ref: '#/components/schemas/ApiErrorEntry'
          minItems: 1
          items:
            $ref: '#/components/schemas/ApiErrorEntry'
        result:
          type: object
          additionalProperties: false
      required:
        - _tag
        - success
        - errors
        - result
      additionalProperties: false
    ApiNotFound:
      type: object
      properties:
        _tag:
          type: string
          enum:
            - NotFound
        success:
          type: boolean
          enum:
            - false
        errors:
          type: array
          prefixItems:
            - $ref: '#/components/schemas/ApiErrorEntry'
          minItems: 1
          items:
            $ref: '#/components/schemas/ApiErrorEntry'
        result:
          type: object
          additionalProperties: false
      required:
        - _tag
        - success
        - errors
        - result
      additionalProperties: false
    ApiConflict:
      type: object
      properties:
        _tag:
          type: string
          enum:
            - Conflict
        success:
          type: boolean
          enum:
            - false
        errors:
          type: array
          prefixItems:
            - $ref: '#/components/schemas/ApiErrorEntry'
          minItems: 1
          items:
            $ref: '#/components/schemas/ApiErrorEntry'
        result:
          type: object
          additionalProperties: false
      required:
        - _tag
        - success
        - errors
        - result
      additionalProperties: false
    ApiPreconditionFailed:
      type: object
      properties:
        _tag:
          type: string
          enum:
            - PreconditionFailed
        success:
          type: boolean
          enum:
            - false
        errors:
          type: array
          prefixItems:
            - type: object
              properties:
                code:
                  type: number
                  enum:
                    - 7006
                message:
                  type: string
                metadata:
                  type: object
                  properties:
                    current_etag:
                      type: string
                  required:
                    - current_etag
                  allOf:
                    - type: object
                      additionalProperties:
                        type: string
              required:
                - code
                - message
                - metadata
              additionalProperties: false
          maxItems: 1
          minItems: 1
        result:
          type: object
          additionalProperties: false
      required:
        - _tag
        - success
        - errors
        - result
      additionalProperties: false
    ApiIdempotencyConflict:
      type: object
      properties:
        _tag:
          type: string
          enum:
            - IdempotencyConflict
        success:
          type: boolean
          enum:
            - false
        errors:
          type: array
          prefixItems:
            - $ref: '#/components/schemas/ApiErrorEntry'
          minItems: 1
          items:
            $ref: '#/components/schemas/ApiErrorEntry'
        result:
          type: object
          additionalProperties: false
      required:
        - _tag
        - success
        - errors
        - result
      additionalProperties: false
    ApiServiceUnavailable:
      type: object
      properties:
        _tag:
          type: string
          enum:
            - ServiceUnavailable
        success:
          type: boolean
          enum:
            - false
        errors:
          type: array
          prefixItems:
            - $ref: '#/components/schemas/ApiErrorEntry'
          minItems: 1
          items:
            $ref: '#/components/schemas/ApiErrorEntry'
        result:
          type: object
          additionalProperties: false
      required:
        - _tag
        - success
        - errors
        - result
      additionalProperties: false
    OpenCodeServer:
      type: object
      properties:
        id:
          $ref: '#/components/schemas/OpenCodeServerId'
        workspace_id:
          type: string
          minLength: 1
          maxLength: 53
        name:
          type: string
          minLength: 1
          maxLength: 100
          description: Display name.
        hostname:
          type: string
          pattern: ^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$
          description: >-
            DNS label chosen for the server's browser UI; unique across the
            platform. Created from the name plus a short random suffix when not
            given. The UI is served at `web_url` until chosen hostnames are
            routed.
          examples:
            - acme-agents
        labels:
          type: object
          propertyNames:
            type: string
            minLength: 1
            maxLength: 63
          additionalProperties:
            type: string
            maxLength: 63
          maxProperties: 32
          description: 'Free-form string labels: up to 32 keys of up to 63 characters.'
        state:
          $ref: '#/components/schemas/OpenCodeServerState'
        default:
          type: boolean
          description: >-
            True for the Workspace's default server, which exists as soon as the
            Workspace uses OpenCode and cannot be deleted.
        budget:
          $ref: '#/components/schemas/OpenCodeBudget'
        model_credential_source:
          $ref: '#/components/schemas/ModelCredentialSource'
        features:
          $ref: '#/components/schemas/OpenCodeFeatures'
        usage:
          $ref: '#/components/schemas/OpenCodeUsage'
        web_url:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            Where people open the server's web UI: `https://oc-<key>.akua.run/`,
            a browser origin of its own, derived from the server id. `null` when
            this deployment hosts no OpenCode Servers.
        server_url:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            The long form of the server's address, `https://<api
            host>/v1/opencodes/{id}/`: OpenCode's protocol under `api/`, its web
            UI at the base. `null` when this deployment hosts no OpenCode
            Servers.
        short_url:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            The short form, `https://<site host>/{id}/`: protocol requests only,
            always with an explicit token. `null` when this deployment has none.
        created_at:
          type: integer
          description: Unix timestamp (seconds)
          minimum: 0
        updated_at:
          type: integer
          description: Unix timestamp (seconds)
          minimum: 0
        etag:
          type: string
          description: Send as `If-Match` on `PATCH`.
      required:
        - id
        - workspace_id
        - name
        - hostname
        - labels
        - state
        - default
        - budget
        - model_credential_source
        - features
        - usage
        - web_url
        - server_url
        - short_url
        - created_at
        - updated_at
        - etag
      additionalProperties: false
    ApiErrorEntry:
      type: object
      properties:
        code:
          type: integer
          description: Machine-readable error code
          examples:
            - 7002
        message:
          type: string
          description: Human-readable error message
          examples:
            - Resource not found
        path:
          type: array
          items:
            type: string
          description: Field path that caused the error, when applicable
          examples:
            - - body
              - name
        metadata:
          type: object
          additionalProperties:
            type: string
      required:
        - code
        - message
      additionalProperties: false
    OpenCodeServerId:
      type: string
      pattern: ^oc_[a-z0-9]{1,64}$
      title: OpenCode Server id
      description: OpenCode Server id (`oc_...`).
      examples:
        - oc_j572abc123def456
    OpenCodeServerState:
      type: string
      enum:
        - ACTIVE
        - SUSPENDING
        - SUSPENDED
        - RESUMING
        - DELETING
        - DELETED
      description: >-
        `ACTIVE`: serves OpenCode protocol traffic. `SUSPENDED`: the gateway
        refuses protocol traffic until it is resumed. `DELETED`: terminal; the
        id stays reserved. `SUSPENDING`, `RESUMING` and `DELETING`: a requested
        change is in progress; its Operation finishes when the server reached
        the new state. A deletion always finishes.
    OpenCodeBudget:
      type: object
      properties:
        monthly_limit:
          anyOf:
            - type: integer
              minimum: 0
              description: >-
                Monthly limit in metered usage units. The unit and its pricing
                are not defined yet; the value is stored and returned, not
                enforced. `null`: no limit.
            - type: 'null'
      required:
        - monthly_limit
      additionalProperties: false
    ModelCredentialSource:
      oneOf:
        - type: object
          properties:
            type:
              type: string
              enum:
                - platform
              description: Models are paid through the platform's own provider access.
          required:
            - type
          additionalProperties: false
        - type: object
          properties:
            type:
              type: string
              enum:
                - own
              description: Models use the workspace's own provider connection.
            connection_id:
              type: string
              description: The workspace connection that holds the provider credential.
              minLength: 1
              maxLength: 64
          required:
            - type
            - connection_id
          additionalProperties: false
      description: >-
        Whose provider access pays for the models this server uses. Always
        explicit; there is no default.
    OpenCodeFeatures:
      type: object
      properties:
        worktrees:
          type: boolean
          description: OpenCode worktree creation in the web UI.
        terminal:
          type: boolean
          description: OpenCode terminals in the web UI.
      required:
        - worktrees
        - terminal
      additionalProperties: false
      description: Web UI feature toggles. Everything else in OpenCode's UI stays on.
    OpenCodeUsage:
      type: object
      properties:
        active_seconds:
          type: integer
          minimum: 0
          description: Seconds the server has been awake and serving, summed over its life.
        requests:
          type: integer
          minimum: 0
          description: Protocol requests served over its life.
      required:
        - active_seconds
        - requests
      additionalProperties: false
      description: Raw usage counters for later pricing. They carry no prices.
  securitySchemes:
    BearerAuth:
      description: >-
        workspace API token (sk_akua_...) or OAuth2 JWT. Create tokens at
        https://akua.dev/developers/api-tokens
      type: http
      scheme: bearer

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.