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

# Get workspace

> Get details for a single workspace including Creative Units balance.



## OpenAPI

````yaml /api-reference/openapi.json get /v1/workspaces/{workspace_id}
openapi: 3.1.0
info:
  title: Layer REST API
  description: >
    REST API for AI-powered game asset creation on the Layer platform.


    ## Authentication


    All endpoints require a Bearer token in the `Authorization` header:


    ```

    Authorization: Bearer <token>

    ```


    ### Personal Access Tokens (recommended)


    The simplest way to authenticate is with a Personal Access Token (PAT):


    1. Log in to [app.layer.ai](https://app.layer.ai)

    2. Go to **Settings > Personal Access Tokens**

    3. Click **Create Token**, give it a name, and copy the token value

    4. Pass it as `Authorization: Bearer <your-pat-token>`


    PATs are long-lived and ideal for scripts, CI pipelines, and partner
    integrations.


    ### OAuth2 (browser-based)


    For browser-based applications, use the Auth0 OAuth2 flow. Redirect users to

    the Layer login page, exchange the authorization code for a JWT access
    token,

    and use it as `Authorization: Bearer <jwt>`.


    ## Creative Units


    Generations consume Creative Units (CUs). Use the estimate endpoints to
    check

    cost before executing. Check workspace balance via `GET
    /v1/workspaces/{id}`.


    ## Pagination


    List endpoints support cursor-based pagination via `limit` and `cursor`
    query

    parameters. Responses include a `pagination` object with `next_cursor`,

    `has_more_results`, and `total_count`. Cursors are opaque — do not parse or

    construct them.


    ## Errors


    All errors return [RFC 7807 Problem
    Details](https://tools.ietf.org/html/rfc7807):


    ```json

    {
      "type": "https://api.layer.ai/errors/ERROR_CODE",
      "title": "Human-readable title",
      "status": 404,
      "detail": "Detailed description of what went wrong."
    }

    ```


    Common status codes: `401` (unauthenticated), `402` (insufficient balance),

    `403` (forbidden), `404` (not found), `422` (invalid input), `429` (rate
    limited).
  version: 1.0.0
servers:
  - url: https://api.app.layer.ai/api
    description: Production
  - url: /backend/rest
    description: Local development
security: []
paths:
  /v1/workspaces/{workspace_id}:
    get:
      tags:
        - Workspaces
      summary: Get workspace
      description: Get details for a single workspace including Creative Units balance.
      operationId: getWorkspace
      parameters:
        - name: workspace_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Workspace Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorkspaceInfo'
        '401':
          description: Unauthenticated — missing or invalid Bearer token.
          content:
            application/problem+json:
              schema:
                type: object
                properties:
                  type:
                    type: string
                    example: https://api.layer.ai/errors/ERROR_CODE
                  title:
                    type: string
                    example: Error Title
                  status:
                    type: integer
                    example: 400
                  detail:
                    type: string
                    example: Human-readable description.
                required:
                  - type
                  - title
                  - status
                  - detail
        '402':
          description: Insufficient Creative Units balance.
          content:
            application/problem+json:
              schema:
                type: object
                properties:
                  type:
                    type: string
                    example: https://api.layer.ai/errors/ERROR_CODE
                  title:
                    type: string
                    example: Error Title
                  status:
                    type: integer
                    example: 400
                  detail:
                    type: string
                    example: Human-readable description.
                required:
                  - type
                  - title
                  - status
                  - detail
        '403':
          description: Forbidden — insufficient permissions.
          content:
            application/problem+json:
              schema:
                type: object
                properties:
                  type:
                    type: string
                    example: https://api.layer.ai/errors/ERROR_CODE
                  title:
                    type: string
                    example: Error Title
                  status:
                    type: integer
                    example: 400
                  detail:
                    type: string
                    example: Human-readable description.
                required:
                  - type
                  - title
                  - status
                  - detail
        '404':
          description: Resource not found.
          content:
            application/problem+json:
              schema:
                type: object
                properties:
                  type:
                    type: string
                    example: https://api.layer.ai/errors/ERROR_CODE
                  title:
                    type: string
                    example: Error Title
                  status:
                    type: integer
                    example: 400
                  detail:
                    type: string
                    example: Human-readable description.
                required:
                  - type
                  - title
                  - status
                  - detail
        '422':
          description: Invalid input parameters.
          content:
            application/problem+json:
              schema:
                type: object
                properties:
                  type:
                    type: string
                    example: https://api.layer.ai/errors/ERROR_CODE
                  title:
                    type: string
                    example: Error Title
                  status:
                    type: integer
                    example: 400
                  detail:
                    type: string
                    example: Human-readable description.
                required:
                  - type
                  - title
                  - status
                  - detail
        '429':
          description: Rate limited — too many concurrent requests.
          content:
            application/problem+json:
              schema:
                type: object
                properties:
                  type:
                    type: string
                    example: https://api.layer.ai/errors/ERROR_CODE
                  title:
                    type: string
                    example: Error Title
                  status:
                    type: integer
                    example: 400
                  detail:
                    type: string
                    example: Human-readable description.
                required:
                  - type
                  - title
                  - status
                  - detail
        '500':
          description: Internal server error.
          content:
            application/problem+json:
              schema:
                type: object
                properties:
                  type:
                    type: string
                    example: https://api.layer.ai/errors/ERROR_CODE
                  title:
                    type: string
                    example: Error Title
                  status:
                    type: integer
                    example: 400
                  detail:
                    type: string
                    example: Human-readable description.
                required:
                  - type
                  - title
                  - status
                  - detail
      security:
        - HTTPBearer: []
components:
  schemas:
    WorkspaceInfo:
      properties:
        workspace_id:
          type: string
          format: uuid
          title: Workspace Id
          description: The workspace's unique identifier.
        slug:
          type: string
          title: Slug
          description: The workspace slug (its representation in the app URL).
        name:
          type: string
          title: Name
          description: The workspace display name.
        balance_creative_units:
          type: number
          title: Balance Creative Units
          description: Total Creative Units balance before reservations.
        reserved_creative_units:
          type: number
          title: Reserved Creative Units
          description: Creative Units reserved by in-progress generations.
        available_creative_units:
          type: number
          title: Available Creative Units
          description: Usable balance (balance minus reserved). Can be negative.
        last_active_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Last Active At
          description: When the current user was last active in this workspace.
      type: object
      required:
        - workspace_id
        - slug
        - name
        - balance_creative_units
        - reserved_creative_units
        - available_creative_units
        - last_active_at
      title: WorkspaceInfo
  securitySchemes:
    HTTPBearer:
      type: http
      description: >-
        Personal Access Token or OAuth2 JWT. Create a PAT at app.layer.ai →
        Settings → Personal Access Tokens.
      scheme: bearer

````