civai-co Credits API

The credits API from civai-co — 9 operation(s) for credits.

Operations 9

GET /api/credits/balance Get Balance #
GET /api/credits/balance/{user_id} Get Balance For User #
GET /api/credits/history Get History #
GET /api/credits/history/{user_id} Get History For User #
GET /api/credits/action-types Get Action Types #
PUT /api/credits/action-types/{action_type} Update Action Type #
POST /api/credits/topup Topup Credits #
POST /api/credits/deduct Deduct Credits Admin #
GET /api/credits/users Get All Users #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/civai-co:civai-co-credits-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

civai-co-credits-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Civai Co Credits API
  version: 1.0.0
  description: 'Operations tagged credits across 2 of this provider''s published API definitions: audience-resolver-api.civai.co-openapi.json, audience-resolver-api.civai.co-openapi.json. Each path carries the servers of the definition it was published in.'
tags:
- name: Credits
paths:
  /api/credits/balance:
    get:
      tags:
      - Credits
      summary: Get Balance
      description: Get current credit balance for authenticated user.
      operationId: get_balance_api_credits_balance_get
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
  /api/credits/balance/{user_id}:
    get:
      tags:
      - Credits
      summary: Get Balance For User
      description: Get credit balance for specific user (admin only).
      operationId: get_balance_for_user_api_credits_balance__user_id__get
      parameters:
      - name: user_id
        in: path
        required: true
        schema:
          type: string
          title: User Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/credits/history:
    get:
      tags:
      - Credits
      summary: Get History
      description: Get credit transaction history for authenticated user.
      operationId: get_history_api_credits_history_get
      parameters:
      - name: limit
        in: query
        required: false
        schema:
          type: integer
          maximum: 100
          minimum: 1
          default: 50
          title: Limit
      - name: offset
        in: query
        required: false
        schema:
          type: integer
          minimum: 0
          default: 0
          title: Offset
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/credits/history/{user_id}:
    get:
      tags:
      - Credits
      summary: Get History For User
      description: Get credit transaction history for specific user (admin only).
      operationId: get_history_for_user_api_credits_history__user_id__get
      parameters:
      - name: user_id
        in: path
        required: true
        schema:
          type: string
          title: User Id
      - name: limit
        in: query
        required: false
        schema:
          type: integer
          maximum: 100
          minimum: 1
          default: 50
          title: Limit
      - name: offset
        in: query
        required: false
        schema:
          type: integer
          minimum: 0
          default: 0
          title: Offset
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/credits/action-types:
    get:
      tags:
      - Credits
      summary: Get Action Types
      description: Get all credit action types and their costs.
      operationId: get_action_types_api_credits_action_types_get
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
  /api/credits/action-types/{action_type}:
    put:
      tags:
      - Credits
      summary: Update Action Type
      description: Update credit amount for an action type (admin only).
      operationId: update_action_type_api_credits_action_types__action_type__put
      parameters:
      - name: action_type
        in: path
        required: true
        schema:
          type: string
          title: Action Type
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateActionTypeRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/credits/topup:
    post:
      tags:
      - Credits
      summary: Topup Credits
      description: Add credits to a user (admin only).
      operationId: topup_credits_api_credits_topup_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TopUpRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/credits/deduct:
    post:
      tags:
      - Credits
      summary: Deduct Credits Admin
      description: Remove credits from a user (admin only). No email notification.
      operationId: deduct_credits_admin_api_credits_deduct_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DeductRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/credits/users:
    get:
      tags:
      - Credits
      summary: Get All Users
      description: List all users with their credit balances (admin only).
      operationId: get_all_users_api_credits_users_get
      parameters:
      - name: limit
        in: query
        required: false
        schema:
          type: integer
          maximum: 100
          minimum: 1
          default: 50
          title: Limit
      - name: offset
        in: query
        required: false
        schema:
          type: integer
          minimum: 0
          default: 0
          title: Offset
      - name: search
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: Search
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    TopUpRequest:
      properties:
        user_id:
          type: string
          title: User Id
        amount:
          type: integer
          title: Amount
        description:
          anyOf:
          - type: string
          - type: 'null'
          title: Description
      type: object
      required:
      - user_id
      - amount
      title: TopUpRequest
    DeductRequest:
      properties:
        user_id:
          type: string
          title: User Id
        amount:
          type: integer
          title: Amount
        description:
          anyOf:
          - type: string
          - type: 'null'
          title: Description
      type: object
      required:
      - user_id
      - amount
      title: DeductRequest
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
            - type: string
            - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
      - loc
      - msg
      - type
      title: ValidationError
    UpdateActionTypeRequest:
      properties:
        credit_amount:
          type: integer
          title: Credit Amount
      type: object
      required:
      - credit_amount
      title: UpdateActionTypeRequest
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
x-refined-from:
- audience-resolver-api.civai.co-openapi.json
- audience-resolver-api.civai.co-openapi.json