Helicone Credits API

The Credits API from Helicone — 6 operation(s) for credits.

Documentation

📖
Documentation
https://raw.githubusercontent.com/api-evangelist/helicone/refs/heads/main/ https://www.helicone.ai/
📖
Documentation
https://docs.helicone.ai/
📖
GettingStarted
https://docs.helicone.ai/getting-started/quick-start
📖
APIReference
https://docs.helicone.ai/rest/request/post-v1requestquery
📖
Documentation
https://docs.helicone.ai/gateway/overview
📖
APIReference
https://docs.helicone.ai/rest/ai-gateway/post-v1-chat-completions
📖
Documentation
https://docs.helicone.ai/rest/request/post-v1requestquery
📖
Documentation
https://docs.helicone.ai/rest/prompts/post-v1prompt-2025
📖
Documentation
https://docs.helicone.ai/features/experiments
📖
APIReference
https://docs.helicone.ai/rest/experiment/post-v1experiment-evaluatorsrun
📖
Documentation
https://docs.helicone.ai/rest/evals/post-v1evals
📖
Documentation
https://docs.helicone.ai/features/sessions
📖
APIReference
https://docs.helicone.ai/rest/session/post-v1sessionquery
📖
Documentation
https://docs.helicone.ai/features/advanced-usage/user-metrics
📖
APIReference
https://docs.helicone.ai/rest/user/post-v1userquery
📖
Documentation
https://docs.helicone.ai/features/webhooks
📖
APIReference
https://docs.helicone.ai/rest/webhooks/get-v1webhooks
📖
Documentation
https://docs.helicone.ai/rest/models/get-v1public-model-registry-models
📖
Documentation
https://docs.helicone.ai/rest/trace/post-v1tracelog
📖
Documentation
https://docs.helicone.ai/rest/dashboard/post-v1dashboardscoresquery
📖
Documentation
https://docs.helicone.ai/features/advanced-usage/custom-properties
📖
APIReference
https://docs.helicone.ai/rest/property/post-v1propertyquery

Specifications

Other Resources

OpenAPI Specification

helicone-credits-api-openapi.yml Raw ↑
openapi: 3.0.0
info:
  title: helicone-api Agent Credits API
  version: 1.0.0
  license:
    name: MIT
  contact: {}
servers:
- url: https://api.helicone.ai/
- url: http://localhost:8585/
tags:
- name: Credits
paths:
  /v1/credits/balance:
    get:
      operationId: GetCreditsBalance
      responses:
        '200':
          description: Ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Result_CreditBalanceResponse.string_'
      tags:
      - Credits
      security:
      - api_key: []
      parameters: []
  /v1/credits/payments:
    get:
      operationId: ListTokenUsagePayments
      responses:
        '200':
          description: Ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Result_PaginatedPurchasedCredits.string_'
      tags:
      - Credits
      security:
      - api_key: []
      parameters:
      - in: query
        name: page
        required: false
        schema:
          format: double
          type: number
      - in: query
        name: pageSize
        required: false
        schema:
          format: double
          type: number
  /v1/credits/totalSpend:
    get:
      operationId: GetTotalSpend
      responses:
        '200':
          description: Ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Result__totalSpend-number_.string_'
      tags:
      - Credits
      security:
      - api_key: []
      parameters: []
  /v1/credits/spend/breakdown:
    get:
      operationId: GetSpendBreakdown
      responses:
        '200':
          description: Ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Result_SpendBreakdownResponse.string_'
      tags:
      - Credits
      security:
      - api_key: []
      parameters:
      - in: query
        name: timeRange
        required: false
        schema:
          type: string
          enum:
          - 7d
          - 30d
          - 90d
          - all
      - in: query
        name: startDate
        required: false
        schema:
          type: string
      - in: query
        name: endDate
        required: false
        schema:
          type: string
  /v1/credits/invoices:
    get:
      operationId: ListInvoices
      responses:
        '200':
          description: Ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Result_PTBInvoice-Array.string_'
      tags:
      - Credits
      security:
      - api_key: []
      parameters: []
  /v1/credits/discounts:
    get:
      operationId: GetDiscounts
      responses:
        '200':
          description: Ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Result_OrgDiscount-Array.string_'
      tags:
      - Credits
      security:
      - api_key: []
      parameters: []
components:
  schemas:
    ResultSuccess_SpendBreakdownResponse_:
      properties:
        data:
          $ref: '#/components/schemas/SpendBreakdownResponse'
        error:
          type: number
          enum:
          - null
          nullable: true
      required:
      - data
      - error
      type: object
      additionalProperties: false
    Result_PaginatedPurchasedCredits.string_:
      anyOf:
      - $ref: '#/components/schemas/ResultSuccess_PaginatedPurchasedCredits_'
      - $ref: '#/components/schemas/ResultError_string_'
    ResultSuccess_OrgDiscount-Array_:
      properties:
        data:
          items:
            $ref: '#/components/schemas/OrgDiscount'
          type: array
        error:
          type: number
          enum:
          - null
          nullable: true
      required:
      - data
      - error
      type: object
      additionalProperties: false
    CreditBalanceResponse:
      properties:
        totalCreditsPurchased:
          type: number
          format: double
        balance:
          type: number
          format: double
      required:
      - totalCreditsPurchased
      - balance
      type: object
      additionalProperties: false
    Result_OrgDiscount-Array.string_:
      anyOf:
      - $ref: '#/components/schemas/ResultSuccess_OrgDiscount-Array_'
      - $ref: '#/components/schemas/ResultError_string_'
    PurchasedCredits:
      properties:
        id:
          type: string
        createdAt:
          type: number
          format: double
        credits:
          type: number
          format: double
        referenceId:
          type: string
      required:
      - id
      - createdAt
      - credits
      - referenceId
      type: object
      additionalProperties: false
    Result__totalSpend-number_.string_:
      anyOf:
      - $ref: '#/components/schemas/ResultSuccess__totalSpend-number__'
      - $ref: '#/components/schemas/ResultError_string_'
    ModelSpend:
      properties:
        model:
          type: string
        provider:
          type: string
        promptTokens:
          type: number
          format: double
        completionTokens:
          type: number
          format: double
        cacheReadTokens:
          type: number
          format: double
        cacheWriteTokens:
          type: number
          format: double
        pricing:
          properties:
            cacheWritePer1M:
              type: number
              format: double
            cacheReadPer1M:
              type: number
              format: double
            outputPer1M:
              type: number
              format: double
            inputPer1M:
              type: number
              format: double
          required:
          - outputPer1M
          - inputPer1M
          type: object
          nullable: true
        subtotal:
          type: number
          format: double
        discountPercent:
          type: number
          format: double
        total:
          type: number
          format: double
        cacheAdjustment:
          type: number
          format: double
      required:
      - model
      - provider
      - promptTokens
      - completionTokens
      - cacheReadTokens
      - cacheWriteTokens
      - pricing
      - subtotal
      - discountPercent
      - total
      type: object
      additionalProperties: false
    OrgDiscount:
      properties:
        provider:
          type: string
          nullable: true
        model:
          type: string
          nullable: true
        percent:
          type: number
          format: double
      required:
      - provider
      - model
      - percent
      type: object
      additionalProperties: false
    PaginatedPurchasedCredits:
      properties:
        purchases:
          items:
            $ref: '#/components/schemas/PurchasedCredits'
          type: array
        total:
          type: number
          format: double
        page:
          type: number
          format: double
        pageSize:
          type: number
          format: double
      required:
      - purchases
      - total
      - page
      - pageSize
      type: object
      additionalProperties: false
    SpendBreakdownResponse:
      properties:
        models:
          items:
            $ref: '#/components/schemas/ModelSpend'
          type: array
        totalCost:
          type: number
          format: double
        timeRange:
          properties:
            end:
              type: string
            start:
              type: string
          required:
          - end
          - start
          type: object
      required:
      - models
      - totalCost
      - timeRange
      type: object
      additionalProperties: false
    ResultSuccess__totalSpend-number__:
      properties:
        data:
          properties:
            totalSpend:
              type: number
              format: double
          required:
          - totalSpend
          type: object
        error:
          type: number
          enum:
          - null
          nullable: true
      required:
      - data
      - error
      type: object
      additionalProperties: false
    Result_CreditBalanceResponse.string_:
      anyOf:
      - $ref: '#/components/schemas/ResultSuccess_CreditBalanceResponse_'
      - $ref: '#/components/schemas/ResultError_string_'
    PTBInvoice:
      properties:
        id:
          type: string
        organizationId:
          type: string
        stripeInvoiceId:
          type: string
          nullable: true
        hostedInvoiceUrl:
          type: string
          nullable: true
        startDate:
          type: string
        endDate:
          type: string
        amountCents:
          type: number
          format: double
        subtotalCents:
          type: number
          format: double
          nullable: true
        notes:
          type: string
          nullable: true
        createdAt:
          type: string
      required:
      - id
      - organizationId
      - stripeInvoiceId
      - hostedInvoiceUrl
      - startDate
      - endDate
      - amountCents
      - subtotalCents
      - notes
      - createdAt
      type: object
      additionalProperties: false
    Result_PTBInvoice-Array.string_:
      anyOf:
      - $ref: '#/components/schemas/ResultSuccess_PTBInvoice-Array_'
      - $ref: '#/components/schemas/ResultError_string_'
    ResultSuccess_PTBInvoice-Array_:
      properties:
        data:
          items:
            $ref: '#/components/schemas/PTBInvoice'
          type: array
        error:
          type: number
          enum:
          - null
          nullable: true
      required:
      - data
      - error
      type: object
      additionalProperties: false
    ResultSuccess_PaginatedPurchasedCredits_:
      properties:
        data:
          $ref: '#/components/schemas/PaginatedPurchasedCredits'
        error:
          type: number
          enum:
          - null
          nullable: true
      required:
      - data
      - error
      type: object
      additionalProperties: false
    ResultSuccess_CreditBalanceResponse_:
      properties:
        data:
          $ref: '#/components/schemas/CreditBalanceResponse'
        error:
          type: number
          enum:
          - null
          nullable: true
      required:
      - data
      - error
      type: object
      additionalProperties: false
    Result_SpendBreakdownResponse.string_:
      anyOf:
      - $ref: '#/components/schemas/ResultSuccess_SpendBreakdownResponse_'
      - $ref: '#/components/schemas/ResultError_string_'
    ResultError_string_:
      properties:
        data:
          type: number
          enum:
          - null
          nullable: true
        error:
          type: string
      required:
      - data
      - error
      type: object
      additionalProperties: false
  securitySchemes:
    api_key:
      type: apiKey
      name: Authorization
      in: header
      description: 'Bearer token authentication. Format: ''Bearer YOUR_API_KEY'''