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

# Create a billing account

> Starts `PENDING` with a card payment method and binds the caller as `roles/billing.admin` on the new account.



## OpenAPI

````yaml /openapi-public.json post /billing_accounts
openapi: 3.1.0
info:
  title: Akua API
  version: 1.0.0
  description: >-
    Manage installs and their asynchronous operations. Authenticate with a
    session bearer token and select a Workspace using Akua-Context.
  contact:
    name: Akua API support
    email: support@akua.dev
    url: https://docs.akua.dev/
servers:
  - url: https://api.akua.dev/v1
security: []
tags:
  - name: operations
  - name: installs
  - name: Organizations
  - name: Billing accounts
  - name: workspaces
  - name: regions
  - name: Dashboard Overview
  - name: products
  - name: offers
  - name: Order Drafts
  - name: packages
  - name: Auth
  - name: API Tokens
  - name: Quota adjustments
  - name: Workspace services
  - name: Vault connections
  - name: clusters
  - name: Node pools
  - name: Nodes
  - name: machines
  - name: Sandboxes
  - name: OpenCode Servers
  - name: vaults
  - name: vaultSecrets
paths:
  /billing_accounts:
    post:
      tags:
        - Billing accounts
      summary: Create a billing account
      description: >-
        Starts `PENDING` with a card payment method and binds the caller as
        `roles/billing.admin` on the new account.
      operationId: billingAccounts.create
      parameters:
        - name: idempotency-key
          in: header
          schema:
            type: string
            minLength: 1
            maxLength: 64
            description: >-
              Required caller-supplied idempotency key. Any non-empty key up to
              64 characters is accepted. Endpoint-specific documentation
              describes how the key is used.
            examples:
              - create-prod-2026-05-07
          required: true
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateBillingAccountRequest'
        required: true
      responses:
        '201':
          description: BillingAccount
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BillingAccount'
        '400':
          description: The request is malformed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiBadRequest'
        '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 idempotency key was already used for a different request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiIdempotencyConflict'
        '429':
          description: The caller is over its per-minute budget.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiTooManyRequests'
        '503':
          description: The service is temporarily unavailable.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiServiceUnavailable'
      security:
        - BearerAuth: []
components:
  schemas:
    CreateBillingAccountRequest:
      type: object
      properties:
        organization:
          type: string
          minLength: 3
          maxLength: 54
        display_name:
          type: string
          minLength: 1
          maxLength: 100
      required:
        - organization
        - display_name
      additionalProperties: false
    BillingAccount:
      type: object
      properties:
        id:
          type: string
          minLength: 3
          maxLength: 54
        name:
          $ref: '#/components/schemas/BillingAccountName'
        organization_id:
          type: string
          minLength: 3
          maxLength: 54
        display_name:
          type: string
          minLength: 1
          maxLength: 100
        state:
          type: string
          enum:
            - PENDING
            - ACTIVE
            - CLOSED
        payment_method:
          $ref: '#/components/schemas/BillingPaymentMethod'
        currency_code:
          type: string
          enum:
            - EUR
        conditions:
          type: array
          items:
            $ref: '#/components/schemas/Condition'
          maxItems: 32
          description: >-
            Problems and notable facts that hold now, beside `state`; empty when
            there are none. See each reason in the resource description.
        created_at:
          type: integer
          minimum: 0
          maximum: 9007199254740991
          description: Unix timestamp (seconds)
        updated_at:
          type: integer
          minimum: 0
          maximum: 9007199254740991
          description: Unix timestamp (seconds)
        closed_at:
          anyOf:
            - type: integer
              minimum: 0
              maximum: 9007199254740991
              description: Unix timestamp (seconds)
            - type: 'null'
        etag:
          type: string
          maxLength: 64
      required:
        - id
        - name
        - organization_id
        - display_name
        - state
        - payment_method
        - currency_code
        - conditions
        - created_at
        - updated_at
        - closed_at
        - etag
      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
    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
    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
    ApiTooManyRequests:
      type: object
      properties:
        _tag:
          type: string
          enum:
            - TooManyRequests
        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
    BillingAccountName:
      type: string
      pattern: ^billingAccounts\/bac_[A-Za-z0-9]+$
      title: BillingAccountName
      examples:
        - billingAccounts/bac_4kQ9mXr2Tz7Lw1
    BillingPaymentMethod:
      anyOf:
        - type: object
          properties:
            type:
              type: string
              enum:
                - card
            card:
              anyOf:
                - $ref: '#/components/schemas/PaymentCard'
                - type: 'null'
          required:
            - type
            - card
          additionalProperties: false
        - type: object
          properties:
            type:
              type: string
              enum:
                - invoice
            invoice_email:
              type: string
              maxLength: 254
          required:
            - type
            - invoice_email
          additionalProperties: false
    Condition:
      type: object
      properties:
        reason:
          type: string
          maxLength: 64
          pattern: ^[a-z0-9]+(?:-[a-z0-9]+)*$
          description: Kebab-case reason; the resource documents the reasons it reports.
          examples:
            - agent-offline
        severity:
          type: string
          enum:
            - error
            - warning
            - info
          description: >-
            `error`: the resource failed; the condition says why. `warning`: it
            is limited or held until the person acts or it recovers. `info`:
            worth knowing, nothing to do.
        message:
          type: string
          maxLength: 512
          description: Safe to show the person as is.
        remedy:
          anyOf:
            - $ref: '#/components/schemas/FailureRemedy'
            - type: 'null'
          description: What the person can do; null when nothing they do helps.
        last_transition_at:
          type: integer
          minimum: 0
          description: Unix timestamp (seconds) when this condition last changed.
      required:
        - reason
        - severity
        - message
        - remedy
        - last_transition_at
      additionalProperties: false
    ApiErrorEntry:
      type: object
      properties:
        code:
          type: integer
          minimum: -9007199254740991
          maximum: 9007199254740991
          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
    PaymentCard:
      type: object
      properties:
        brand:
          type: string
          maxLength: 32
          examples:
            - visa
        last4:
          type: string
          pattern: ^[0-9]{4}$
        exp_month:
          type: integer
          minimum: 1
          maximum: 12
        exp_year:
          type: integer
          minimum: 2000
          maximum: 2199
        verified_at:
          type: integer
          minimum: 0
          maximum: 9007199254740991
          description: Unix timestamp (seconds)
      required:
        - brand
        - last4
        - exp_month
        - exp_year
        - verified_at
      additionalProperties: false
    FailureRemedy:
      anyOf:
        - type: object
          properties:
            kind:
              type: string
              enum:
                - free-capacity
            metric:
              type: string
              enum:
                - kaas/clusters
                - compute/machines
                - compute/cpu
                - compute/memory
                - compute/machines_concurrency
                - compute/managed_vm_trial
                - agents/turns_concurrency
                - agents/sandboxes
                - agents/sandboxes_running
                - agents/retained_filesystem_lifetime
                - codemode/executions
                - api/secrets_access
                - api/secrets_write
                - domain_routing/preview_hostnames
                - domain_routing/custom_domains
                - source_control/repositories
            limit:
              type: integer
            usage:
              type: integer
            hint:
              type: string
              maxLength: 256
          required:
            - kind
            - metric
            - limit
            - usage
            - hint
          additionalProperties: false
        - type: object
          properties:
            kind:
              type: string
              enum:
                - upgrade-plan
            metric:
              type: string
              enum:
                - kaas/clusters
                - compute/machines
                - compute/cpu
                - compute/memory
                - compute/machines_concurrency
                - compute/managed_vm_trial
                - agents/turns_concurrency
                - agents/sandboxes
                - agents/sandboxes_running
                - agents/retained_filesystem_lifetime
                - codemode/executions
                - api/secrets_access
                - api/secrets_write
                - domain_routing/preview_hostnames
                - domain_routing/custom_domains
                - source_control/repositories
          required:
            - kind
            - metric
          additionalProperties: false
        - type: object
          properties:
            kind:
              type: string
              enum:
                - grant-access
            namespace:
              anyOf:
                - type: string
                  maxLength: 63
                - type: 'null'
            permissions:
              type: array
              prefixItems:
                - type: string
                  maxLength: 256
              minItems: 1
              items:
                type: string
                maxLength: 256
              maxItems: 64
          required:
            - kind
            - namespace
            - permissions
          additionalProperties: false
        - type: object
          properties:
            kind:
              type: string
              enum:
                - reconnect
            what:
              type: string
              enum:
                - cluster-agent
                - connection
          required:
            - kind
            - what
          additionalProperties: false
        - type: object
          properties:
            kind:
              type: string
              enum:
                - add-machine
          required:
            - kind
          additionalProperties: false
        - type: object
          properties:
            kind:
              type: string
              enum:
                - add-billing
          required:
            - kind
          additionalProperties: false
        - type: object
          properties:
            kind:
              type: string
              enum:
                - change-input
            path:
              type: array
              items:
                type: string
                maxLength: 128
              maxItems: 32
          required:
            - kind
            - path
          additionalProperties: false
        - type: object
          properties:
            kind:
              type: string
              enum:
                - retry
            after_seconds:
              anyOf:
                - type: integer
                - type: 'null'
          required:
            - kind
            - after_seconds
          additionalProperties: false
        - type: object
          properties:
            kind:
              type: string
              enum:
                - run-agent-install
              description: >-
                Run the command from `POST /v1/clusters/{id}/connector_install`
                again; it re-applies the ClusterConnector and its updater at one
                release.
          required:
            - kind
          additionalProperties: false
        - type: object
          properties:
            kind:
              type: string
              enum:
                - customer-upgrade
              description: >-
                The change needs rights the agent was not granted. Run `command`
                (a `helm upgrade`, no secret) with an identity that holds
                `permissions`, or grant them to the agent.
            permissions:
              type: array
              prefixItems:
                - type: string
                  maxLength: 256
              minItems: 1
              items:
                type: string
                maxLength: 256
              maxItems: 64
            command:
              type: string
              minLength: 1
              maxLength: 8192
          required:
            - kind
            - permissions
            - command
          additionalProperties: false
  securitySchemes:
    BearerAuth:
      description: Bearer token for the authenticated caller.
      type: http
      scheme: bearer

````

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