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

# Allocate credits to a client

> Allocates credits from the workspace to a specific client. Requires client ownership verification.



## OpenAPI

````yaml https://api.lindo.ai/openapi.json post /v1/ai/credits/client/allocate
openapi: 3.1.0
info:
  title: Lindo Unified API
  version: 1.0.0
  description: >-
    Unified API for Lindo.ai - Includes workspace management, websites, pages,
    blogs, workflows, credits, and analytics
servers:
  - url: https://api.lindo.ai
    description: Lindo API Server
security:
  - bearerAuth: []
tags:
  - name: Client Management
    description: Manage workspace clients
  - name: Website Management
    description: Manage websites
  - name: Page Management
    description: Manage website pages
  - name: Blog Management
    description: Manage website blogs
  - name: Workspace Management
    description: Workspace settings and team management
  - name: Workflows
    description: AI workflow management
  - name: Credits
    description: Credit balance and usage
  - name: Analytics
    description: Website and workspace analytics
paths:
  /v1/ai/credits/client/allocate:
    post:
      tags:
        - Credits
      summary: Allocate credits to a client
      description: >-
        Allocates credits from the workspace to a specific client. Requires
        client ownership verification.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AllocateClientCreditsRequest'
      responses:
        '200':
          description: Credits allocated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AllocateClientCreditsResponse'
        '400':
          description: Invalid request - missing fields or invalid values
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized - invalid or missing API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden - client does not belong to workspace
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    AllocateClientCreditsRequest:
      type: object
      properties:
        client_id:
          type: string
          description: The ID of the client to allocate credits to
          example: client_abc123
        credit_type:
          type: string
          enum:
            - monthly
            - purchased
            - daily
          description: Type of credits to allocate
          example: purchased
        amount:
          type: number
          minimum: 1
          description: Number of credits to allocate (must be positive)
          example: 100
        source:
          type: string
          description: Source of the allocation (e.g. bonus, purchase)
          example: bonus
        notes:
          type: string
          description: Optional notes for the allocation
          example: Monthly credit top-up
      required:
        - client_id
        - credit_type
        - amount
    AllocateClientCreditsResponse:
      type: object
      properties:
        success:
          type: boolean
          enum:
            - true
        result:
          type: object
          properties:
            allocation:
              type: object
              properties:
                id:
                  type: string
                client_id:
                  type: string
                credit_type:
                  type: string
                amount:
                  type: number
                remaining:
                  type: number
                source:
                  type: string
                status:
                  type: string
                created_at:
                  type: string
              required:
                - id
                - client_id
                - credit_type
                - amount
                - remaining
                - source
                - status
                - created_at
            message:
              type: string
            balance:
              type: object
              nullable: true
              properties:
                monthly:
                  type: number
                purchased:
                  type: number
                daily:
                  type: number
                total:
                  type: number
              required:
                - monthly
                - purchased
                - daily
                - total
          required:
            - balance
      required:
        - success
        - result
    ErrorResponse:
      type: object
      properties:
        success:
          type: boolean
          enum:
            - false
        error:
          type: string
      required:
        - success
        - error
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: Enter your API key (starts with lindo_sk_)

````

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