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

# Credit grant

> Allocate credits to an account.



## OpenAPI

````yaml patch /users
openapi: 3.1.0
info:
  title: Agent First
  description: The missing services for agent-first development.
  version: 1.0.0
servers:
  - url: https://api.agentfirst.dev
security:
  - bearerAuth: []
paths:
  /users:
    patch:
      summary: Credit grant
      description: Allocate credits to an account.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                email:
                  description: >-
                    The (case-insensitive) email address of the user whose
                    account to grant credits.
                  type: string
                  format: email
                  example: user@example.com
                amount:
                  description: The number of additional API credits to grant the account.
                  type: integer
                  example: 1000
              required:
                - email
                - amount
        required: true
      responses:
        '200':
          description: The updated account credits.
          content:
            application/json:
              schema:
                type: object
                properties:
                  email:
                    description: The account email address.
                    type: string
                    format: email
                    example: user@example.com
                  credits:
                    description: >-
                      The number of updated API credits allocated to the
                      account.
                    type: integer
                    example: 1000
                required:
                  - email
                  - credits
        '400':
          $ref: '#/components/responses/malformedError'
        '401':
          $ref: '#/components/responses/authenticationError'
        '403':
          $ref: '#/components/responses/authorizationError'
        '404':
          $ref: '#/components/responses/unsupportedError'
        '422':
          $ref: '#/components/responses/paramsError'
        '429':
          $ref: '#/components/responses/throttlingError'
        '500':
          $ref: '#/components/responses/unknownError'
components:
  responses:
    malformedError:
      description: The request was malformed.
      content:
        text/plain:
          schema:
            type: string
            example: JSON was malformed
    authenticationError:
      description: The authorization header was missing.
      content:
        text/plain:
          schema:
            type: string
            example: Authorization header must be provided
    authorizationError:
      description: The API token was invalid.
      content:
        text/plain:
          schema:
            type: string
            example: Valid API token must be provided
    unsupportedError:
      description: One or more resources is nonexistant.
      content:
        text/plain:
          schema:
            type: string
            example: Domain is nonexistant
    paramsError:
      description: One or more parameters were invalid.
      content:
        text/plain:
          schema:
            type: string
            example: Character counts must be no more than 255
    throttlingError:
      description: The rate limit was exceeded.
      content:
        text/plain:
          schema:
            type: string
            example: Rate limit was exceeded; please retry in 180 seconds
    unknownError:
      description: An unknown error occurred.
      content:
        text/plain:
          schema:
            type: string
            example: Unknown error occurred
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````