Mangii Billing API

The billing API from Mangii — 4 operation(s) for billing.

GitHub OpenAPI

Operations 4

GET /v1/credits Get credits #
GET /v1/usage Get usage #
POST /v1/checkout/credits Checkout credits #
POST /v1/checkout/subscription Checkout 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/mangii-ai:mangii-ai-billing-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

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. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

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

OpenAPI Specification

mangii-ai-billing-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Mangii Headless Billing API
  version: 1.0.0
  description: 'Agent-consumable creation API. Auth is Authorization Bearer mangii_sk_. Generation POSTs default to async 202 + job_id. Debit is useApiCredit: apiPackCredits first, then purchase-backed packCredits. weeklyCredits never.'
servers:
- url: https://api.mangii.ai
  description: Generation host (Functions custom domain or Cloud Run)
security:
- mangiiKey: []
tags:
- name: Billing
paths:
  /v1/credits:
    get:
      operationId: getCredits
      tags:
      - Billing
      responses:
        '200':
          description: Balances. weeklyCredits is display-only. spendableCredits is apiPackCredits plus current packCredits after the account has ever purchased. Later ad/referral grants on that pack pool also spend.
          headers:
            X-RateLimit-Limit:
              $ref: '#/components/headers/XRateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/XRateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/XRateLimitReset'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Credits'
        '429':
          $ref: '#/components/responses/RateLimited'
      summary: Get credits
      x-summary-source: derived
  /v1/usage:
    get:
      operationId: getUsage
      tags:
      - Billing
      responses:
        '200':
          description: Per-day usage
          headers:
            X-RateLimit-Limit:
              $ref: '#/components/headers/XRateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/XRateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/XRateLimitReset'
        '429':
          $ref: '#/components/responses/RateLimited'
      summary: Get usage
      x-summary-source: derived
  /v1/checkout/credits:
    post:
      operationId: checkoutCredits
      tags:
      - Billing
      description: Requires billing:write scope or dashboard session. Not on generate-scoped keys.
      parameters:
      - $ref: '#/components/parameters/IdempotencyKey'
      responses:
        '200':
          description: Stripe Checkout URL for a human
          headers:
            X-RateLimit-Limit:
              $ref: '#/components/headers/XRateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/XRateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/XRateLimitReset'
        '429':
          $ref: '#/components/responses/RateLimited'
      summary: Checkout credits
      x-summary-source: derived
  /v1/checkout/subscription:
    post:
      operationId: checkoutSubscription
      tags:
      - Billing
      description: Requires billing:write scope or dashboard session.
      parameters:
      - $ref: '#/components/parameters/IdempotencyKey'
      responses:
        '200':
          description: Stripe Checkout URL for a human
          headers:
            X-RateLimit-Limit:
              $ref: '#/components/headers/XRateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/XRateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/XRateLimitReset'
        '429':
          $ref: '#/components/responses/RateLimited'
      summary: Checkout subscription
      x-summary-source: derived
components:
  parameters:
    IdempotencyKey:
      name: Idempotency-Key
      in: header
      required: true
      schema:
        type: string
  schemas:
    Error:
      type: object
      required:
      - error
      properties:
        error:
          type: object
          required:
          - type
          - code
          - message
          - request_id
          properties:
            type:
              type: string
            code:
              type: string
              enum:
              - invalid_key
              - insufficient_credits
              - budget_exceeded
              - content_blocked
              - gone
              - idempotency_conflict
              - idempotency_in_progress
            message:
              type: string
            request_id:
              type: string
            buy_url:
              type: string
    Credits:
      type: object
      required:
      - weeklyCredits
      - packCredits
      - apiPackCredits
      properties:
        weeklyCredits:
          type: integer
        packCredits:
          type: integer
        apiPackCredits:
          type: integer
        spendableCredits:
          type: integer
          description: apiPackCredits plus current packCredits when hasEverPurchasedCredits is true. Later ad/referral grants on that pack pool also spend. Same pools useApiCredit spends.
        notes:
          type: string
          description: weeklyCredits is display-only and never spends on API/MCP. spendableCredits is apiPackCredits plus the current packCredits balance when hasEverPurchasedCredits is true. After a purchase, later grants into packCredits (including ad/referral) share that spendable pool. Never-purchased accounts cannot spend packCredits.
  responses:
    RateLimited:
      description: 'Per-key rate limit exceeded for the current minute bucket. Every /v1 operation shares one per-key limiter, so any of them can return this.

        '
      headers:
        X-RateLimit-Limit:
          $ref: '#/components/headers/XRateLimitLimit'
        X-RateLimit-Remaining:
          $ref: '#/components/headers/XRateLimitRemaining'
        X-RateLimit-Reset:
          $ref: '#/components/headers/XRateLimitReset'
        Retry-After:
          $ref: '#/components/headers/RetryAfter'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  headers:
    XRateLimitLimit:
      description: Requests this key may make in the current minute bucket.
      schema:
        type: integer
      example: 60
    XRateLimitReset:
      description: Unix seconds at the start of the next minute bucket, when the allowance rolls over.
      schema:
        type: integer
      example: 1755600120
    RetryAfter:
      description: Seconds to wait before retrying. Always the full bucket width.
      schema:
        type: integer
      example: 60
    XRateLimitRemaining:
      description: Requests left in the current minute bucket. Floored at 0, so a 429 always reports 0.
      schema:
        type: integer
      example: 59
  securitySchemes:
    mangiiKey:
      type: http
      scheme: bearer
      bearerFormat: mangii_sk_
      description: API key mangii_sk_<32 bytes base62>