AthenaHQ Billing API

Billing and credits endpoints for managing usage

Operations 5

GET /api/v1/credits/website Get Website Credits #
GET /api/v1/credits/organization Get Organization Credits #
GET /api/v1/credits/group Get Group Credits #
GET /api/v1/subscriptions/website Get Website Subscription #
POST /api/v1/subscriptions/cancel Cancel Subscription #

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/athenahq-ai:athenahq-ai-billing-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

athenahq-ai-billing-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: AthenaHQ Billing API
  description: AthenaHQ API provides programmatic access to manage your websites and prompts for AI-powered content optimization.
  version: 1.0.0
  contact:
    email: support@athenahq.ai
servers:
- url: https://api.athenahq.ai
  description: Production server
security:
- apiKey: []
tags:
- name: Billing
  description: Billing and credits endpoints for managing usage
paths:
  /api/v1/credits/website:
    get:
      tags:
      - Billing
      summary: Get Website Credits
      description: Returns the current credit balance for a specific website.
      operationId: getWebsiteCredits
      security:
      - apiKey: []
      parameters:
      - name: website_id
        in: query
        description: The ID of the website to retrieve credits for
        required: true
        schema:
          type: string
          format: uuid
      responses:
        '200':
          description: Successful response with credit balance
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreditsResponse'
              example:
                credits:
                  total: 700
                  monthly:
                    balance: 700
                    next_reset_at: 1772227690021
                  one_off:
                    balance: 0
        '400':
          description: Bad request - Invalid parameters
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error: website_id is required
        '401':
          description: Unauthorized - Invalid or missing API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Forbidden - You don't have access to this website
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error: Unauthorized access to this website
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error: Failed to fetch credits
  /api/v1/credits/organization:
    get:
      tags:
      - Billing
      summary: Get Organization Credits
      description: Returns the current credit balance for your organization.
      operationId: getOrganizationCredits
      security:
      - apiKey: []
      responses:
        '200':
          description: Successful response with credit balance
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreditsResponse'
              example:
                credits:
                  total: 5000
                  monthly:
                    balance: 5000
                    next_reset_at: 1772227690021
                  one_off:
                    balance: 0
        '401':
          description: Unauthorized - Invalid or missing API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error: Failed to fetch credits
  /api/v1/credits/group:
    get:
      tags:
      - Billing
      summary: Get Group Credits
      description: Returns the current credit balance for a specific group. Requires a global API key.
      operationId: getGroupCredits
      security:
      - apiKey: []
      parameters:
      - name: group_id
        in: query
        description: The ID of the group to retrieve credits for
        required: true
        schema:
          type: string
          format: uuid
      responses:
        '200':
          description: Successful response with credit balance
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreditsResponse'
              example:
                credits:
                  total: 500
                  monthly:
                    balance: 300
                    next_reset_at: 1772227690021
                  one_off:
                    balance: 200
        '400':
          description: Bad request - Invalid parameters
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error: group_id is required
        '401':
          description: Unauthorized - Invalid or missing API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Forbidden - Global API key required
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error: 'Forbidden: global API key required'
        '404':
          description: Group not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error: Group not found
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error: Failed to fetch credits
  /api/v1/subscriptions/website:
    get:
      tags:
      - Billing
      summary: Get Website Subscription
      description: Returns the subscription products for a specific website, including their status and billing dates.
      operationId: getWebsiteSubscription
      security:
      - apiKey: []
      parameters:
      - name: website_id
        in: query
        description: The ID of the website to retrieve subscription information for
        required: true
        schema:
          type: string
          format: uuid
      responses:
        '200':
          description: Successful response with subscription products
          content:
            application/json:
              schema:
                type: object
                properties:
                  products:
                    type: array
                    items:
                      $ref: '#/components/schemas/SubscriptionProduct'
                required:
                - products
              example:
                products:
                - id: pro_monthly
                  name: Pro Plan
                  status: active
                  canceled_at: null
                  cancel_at: null
                  started_at: 1704067200000
                  ended_at: null
        '400':
          description: Bad request - Invalid parameters
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error: website_id is required
        '401':
          description: Unauthorized - Invalid or missing API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Forbidden - You don't have access to this website
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error: Unauthorized access to this website
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error: Failed to fetch subscription
  /api/v1/subscriptions/cancel:
    post:
      tags:
      - Billing
      summary: Cancel Subscription
      description: Cancels a subscription for a specific website. The subscription will remain active until the end of the current billing period.
      operationId: cancelSubscription
      security:
      - apiKey: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CancelSubscriptionRequest'
      responses:
        '200':
          description: Subscription cancelled successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    description: Whether the cancellation was successful
                required:
                - success
              example:
                success: true
        '400':
          description: Bad request - Invalid parameters
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                missing_website_id:
                  value:
                    error: website_id is required
                missing_product_id:
                  value:
                    error: product_id is required
        '401':
          description: Unauthorized - Invalid or missing API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Forbidden - You don't have access to this website
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error: Unauthorized access to this website
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error: Failed to cancel subscription
components:
  schemas:
    CreditsResponse:
      type: object
      description: Credit balance response
      required:
      - credits
      properties:
        credits:
          type: object
          required:
          - total
          - monthly
          - one_off
          properties:
            total:
              type: integer
              description: Total credit balance (monthly + one-off)
              example: 700
            monthly:
              type: object
              description: Monthly recurring credits
              required:
              - balance
              - next_reset_at
              properties:
                balance:
                  type: integer
                  description: Current monthly credit balance
                  example: 700
                next_reset_at:
                  type: integer
                  description: Timestamp in milliseconds when monthly credits will reset
                  example: 1772227690021
            one_off:
              type: object
              description: One-off purchased credits
              required:
              - balance
              properties:
                balance:
                  type: integer
                  description: Current one-off credit balance
                  example: 0
    Error:
      type: object
      description: Error response object
      required:
      - error
      properties:
        error:
          type: string
          description: Error message describing what went wrong
          example: Unauthorized
    CancelSubscriptionRequest:
      type: object
      description: Request body for canceling a subscription
      required:
      - website_id
      - product_id
      properties:
        website_id:
          type: string
          format: uuid
          description: The ID of the website to cancel the subscription for
          example: 123e4567-e89b-12d3-a456-426614174000
        product_id:
          type: string
          description: The ID of the product/subscription to cancel
          example: pro_monthly
    SubscriptionProduct:
      type: object
      description: A subscription product associated with a website
      required:
      - id
      - name
      - status
      properties:
        id:
          type: string
          description: Unique identifier for the product
          example: pro_monthly
        name:
          type: string
          description: Display name of the product
          example: Pro Plan
        status:
          type: string
          enum:
          - active
          - trialing
          - expired
          - canceled
          - past_due
          description: Current status of the subscription
          example: active
        canceled_at:
          type: integer
          nullable: true
          description: Timestamp in milliseconds when the subscription was canceled (null if not canceled)
          example: null
        cancel_at:
          type: integer
          nullable: true
          description: Timestamp in milliseconds when the subscription will be canceled (null if not scheduled for cancellation)
          example: null
        started_at:
          type: integer
          nullable: true
          description: Timestamp in milliseconds when the subscription started
          example: 1704067200000
        ended_at:
          type: integer
          nullable: true
          description: Timestamp in milliseconds when the subscription ended (null if still active)
          example: null
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: x-api-key
      description: API key for authentication. You can create one [here](https://app.athenahq.ai/organization?tab=api).