Explorium V2 Credits API
Credit balance and consumption aggregation on the v2 (beta) surface.
Credit balance and consumption aggregation on the v2 (beta) surface.
openapi: 3.2.0
info:
title: Partner Service V2 Credits API
version: 0.3.19
servers:
- url: https://api.explorium.ai
description: AgentSource Server
tags:
- name: V2Credits
paths:
/v2/credits:
get:
tags:
- V2Credits
summary: Get Active Credits Summary
operationId: v2_credits_get
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/ActiveCreditSummaryWithAccountTypeResponse'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
security:
- APIKeyHeader: []
- APIKeyHeader: []
/v2/credits/aggregation:
post:
tags:
- V2Credits
summary: Get Credit Aggregation
operationId: v2_credits_aggregation
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/CreditAggregationRequest'
required: true
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/CreditAggregationResponse'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
security:
- APIKeyHeader: []
- APIKeyHeader: []
components:
schemas:
HTTPValidationError:
properties:
detail:
items:
$ref: '#/components/schemas/ValidationError'
type: array
title: Detail
type: object
title: HTTPValidationError
CreditAggregationResponse:
properties:
response_context:
$ref: '#/components/schemas/ResponseContext'
from_date:
type: string
title: From Date
description: ISO 8601 datetime string for start date
to_date:
type: string
title: To Date
description: ISO 8601 datetime string for end date
mode:
type: string
title: Mode
description: Aggregation mode
resolution:
type: string
enum:
- hour
- day
- month
title: Resolution
description: Aggregation resolution (not applicable for endpoints mode)
timezone:
type: string
title: Timezone
description: Timezone used for aggregation
total_credits:
type: integer
title: Total Credits
description: Total credits consumed in the period
aggregations:
items:
type: object
type: array
title: Aggregations
description: Array of aggregation data points
type: object
required:
- response_context
- from_date
- to_date
- mode
- timezone
- total_credits
- aggregations
title: CreditAggregationResponse
description: This is base response model for all responses in partner service.
RequestStatus:
type: string
enum:
- success
- miss
- failure
title: RequestStatus
description: "The `RequestStatus` class is an enumeration that defines the possible statuses of a request.\n\nThis enum is used to indicate whether a request was successful, missed, or failed. It ensures\nconsistent handling of request statuses across the application.\n\nAttributes:\n SUCCESS: Indicates that the request was successfully processed.\n MISS: Indicates that the request did not find any matching data.\n FAILURE: Indicates that the request encountered an error or failure."
CreditAggregationRequest:
properties:
request_context:
type: object
title: Request Context
marked_for_null_replacement: true
nullable: true
from_date:
type: string
title: From Date
description: ISO 8601 datetime string for start date
to_date:
type: string
title: To Date
description: ISO 8601 datetime string for end date
mode:
type: string
enum:
- timely
- endpoints
title: Mode
description: Aggregation mode
resolution:
type: string
enum:
- hour
- day
- month
title: Resolution
description: Aggregation resolution (required for timely mode, optional for endpoints mode)
timezone:
type: string
title: Timezone
description: Timezone for aggregation, defaults to UTC
default: UTC
key_name:
type: string
title: Key Name
description: Optional API key name to scope aggregation results
additionalProperties: false
type: object
required:
- from_date
- to_date
- mode
title: CreditAggregationRequest
ActiveCreditSummaryWithAccountTypeResponse:
properties:
response_context:
$ref: '#/components/schemas/ResponseContext'
allocated_credits:
type: integer
title: Allocated Credits
description: Number of allocated credits
remaining_credits:
type: integer
title: Remaining Credits
description: Number of remaining credits
account_type:
allOf:
- $ref: '#/components/schemas/AccountType'
description: Type of the last package assigned to the account. trial means no purchase was made; paid means the user purchased a package.
type: object
required:
- response_context
- allocated_credits
- remaining_credits
title: ActiveCreditSummaryWithAccountTypeResponse
description: This is base response model for all responses in partner service.
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
AccountType:
type: string
enum:
- trial
- paid
title: AccountType
description: An enumeration.
ResponseContext:
properties:
correlation_id:
type: string
title: Correlation Id
request_status:
$ref: '#/components/schemas/RequestStatus'
time_took_in_seconds:
type: number
title: Time Took In Seconds
type: object
required:
- correlation_id
- request_status
- time_took_in_seconds
title: ResponseContext
securitySchemes:
APIKeyHeader:
type: apiKey
in: header
name: api_key