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

# Get User Credit Information

> This endpoint allows users to query their remaining credits and billing period information. It requires a valid API key and returns comprehensive credit usage information.

<Warning>
  **🚧 Coming Soon**: This endpoint is currently in development and will be available soon. Stay tuned for updates!
</Warning>

<Note>
  **Credit Cost**: This endpoint costs **0 credits** to query your credit information. It's free to check your remaining credits and billing status.
</Note>

<Note>
  **Rate Limit**: This endpoint has a default rate limit of **10 requests/second** per account. Need higher limits? [Contact our support team](https://cal.com/rivin-ai/30min) - we can accommodate any rate limit requirements on request.
</Note>

<RequestExample>
  ```bash Example request theme={null}
  curl -X GET "https://rivin.ai/api/user/credits" \
    -H "Content-Type: application/json" \
    -H "x-api-key: (YOUR_API_KEY_HERE)"
  ```
</RequestExample>

<ResponseExample>
  ```json API Response theme={null}
  {
    "user_email": "user@example.com",
    "credits": {
      "total": 300000,
      "used_this_month": 114500,
      "remaining": 185500,
      "usage_percentage": 38
    },
    "billing_period": {
      "current_period_start": "2024-01-01T00:00:00Z",
      "next_refresh_date": "2024-02-01T00:00:00Z",
      "days_until_refresh": 12
    },
    "account_info": {
      "created_at": "2023-12-15T10:30:00Z",
      "last_updated": "2024-01-15T14:22:00Z"
    }
  }
  ```
</ResponseExample>

<Note>
  **Credit Refresh**: Credits refresh monthly based on your billing cycle. The exact refresh date depends on when your account was created or when you last upgraded your plan.
</Note>


## OpenAPI

````yaml GET /user/credits
openapi: 3.1.0
info:
  title: Rivin.ai Walmart API
  description: >-
    API for retrieving Walmart product information, price history, and managing
    oversight tracking
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://rivin.ai/api
    description: Production API server
security: []
paths:
  /user/credits:
    get:
      tags:
        - User Endpoints
      summary: Get User Credit Information
      description: >-
        This endpoint allows users to query their remaining credits and billing
        period information. It requires a valid API key and returns
        comprehensive credit usage information.
      operationId: getUserCredits
      parameters:
        - name: x-api-key
          in: header
          description: >-
            Your unique API key for authentication. This key is required in the
            header of all API requests, to authenticate your account and access
            Rivin.ai's services. Get your API key through the
            [Settings](https://rivin.ai/settings) page.
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserCredits'
        '401':
          description: Unauthorized - Invalid or missing API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: User not found or credit information not available
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    UserCredits:
      type: object
      properties:
        user_email:
          description: The email address of the user
          type: string
          format: email
        credits:
          description: Credit usage information
          type: object
          properties:
            total:
              description: Total monthly credit allocation
              type: integer
            used_this_month:
              description: Number of credits consumed in the current billing period
              type: integer
            remaining:
              description: Credits remaining for the current billing period
              type: integer
            usage_percentage:
              description: Percentage of credits used (0-100)
              type: integer
              minimum: 0
              maximum: 100
        billing_period:
          description: Billing period information
          type: object
          properties:
            current_period_start:
              description: Start date of the current billing period
              type: string
              format: date-time
            next_refresh_date:
              description: When credits will refresh (next billing cycle)
              type: string
              format: date-time
            days_until_refresh:
              description: Number of days until the next credit refresh
              type: integer
              minimum: 0
        account_info:
          description: Account information
          type: object
          properties:
            created_at:
              description: When the account was created
              type: string
              format: date-time
            last_updated:
              type: string
              format: date-time
              description: When the data was last updated
    Error:
      required:
        - error
        - message
      type: object
      properties:
        error:
          type: integer
          format: int32
        message:
          type: string

````