API.Market
Go to API.market
  • Welcome to API.market
  • What are API Products?
  • How to subscribe to a SaaS API Product?
  • Managing Subscriptions
  • Analytics & Logs
  • How can I cancel my Subscription?
  • How do I add payment details?
  • How does API.market charges me?
  • Error Codes
  • API.market Usage API Documentation
  • Seller Docs
    • API Seller Console
    • What is an API Product?
    • What is a Pricing Plan
    • Importing an API Source
    • Creating a Product using the Wizard
    • Testing Your APIs & Products
    • Analytics & Logs
    • Custom Usage
    • Overriding Custom Usage on Result Retrieval
  • FUNDAMENTALS
    • Convert Postman Collection to OpenAPI Yaml
    • Create OpenAPI spec using ChatGPT
  • About Us
  • API Product Docs
    • MagicAPI
      • Screenshot API
      • Domain Availability Checker API
      • WhoIS API
      • PDF Conversion API
      • Image Upscale API
      • DNS Checker API
      • Ageify API
      • Image Restoration API
      • Toon Me API
      • Coding Assistant
      • 🎭 FaceSwap API: Instantaneous replaces face with one another
      • 🏞️ Image Upload API
      • Deblurer API
      • Hair Changer API
      • 🤳🏻🤖AI Qr Code Generator API
      • Whisper API
      • Image Colorizer API
      • OpenJourney API
      • Object Remover API
      • Image Captioner API
      • Object Detector API
      • NSFW API
      • Crunchbase API
      • Pipfeed's Extract API Developer Documentation
      • Migrating from Capix FaceSwap API to magicapi/faceswap-capix API
    • BridgeML
      • Meta-Llama-3-8B-Instruct
      • Meta-Llama-3-70B-Instruct
      • Mistral-7B-Instruct-v0.1
      • Mixtral-8x22B-Instruct-v0.1
      • Meta-Llama-2-7b
      • Meta-Llama-2-13b
      • Meta-Llama-2-70b
      • Gemma-7b-it
      • NeuralHermes-2.5-Mistral-7B
      • BAAI/bge-large-en-v1.5
      • CodeLlama-70b-Instruct-hf
      • 🤖🧗Text-to-Image API
      • 📝🎧 Text to Audio API
    • Capix AI
      • FaceSwap Image and Video Face Swap API
      • MakeUp
      • Photolab.me
      • AI Picture Colorizer
      • AI Picture Upscaler
      • AI Background Remover
      • Object Remover
      • TTS Universal
      • Home GPT
      • AI & Plagiarism Checker
      • AI Story Generator
      • AI Essay Generator
      • Book Title Generator
    • Trueway
      • ⛕ 🗺️ Trueway Routing API
      • 🌐📍Trueway Geocoding API: Forward and Reverse Geocoding
      • 🛤️ ⏱️Trueway Matrix API: Travel Distance and Time
      • 🏛️ Trueway Places API
    • AILabTools
      • Cartoon-Yourself
    • SharpAPI
      • 📄 AI-Powered Resume/CV Parsing API
      • 🛩️ Airports Database & Flight Duration API
    • Text to Speech
      • Turn your text into Magical-sounding Audio
Powered by GitBook
On this page
  • Endpoint 1 – Usage for a Single Subscription
  • Endpoint 2 – Usage for All Active Subscriptions
  • Error Handling
  • Best Practices & Tips

API.market Usage API Documentation

PreviousError CodesNextAPI Seller Console

Last updated 16 days ago

API .market already shows usage analytics in the dashboard, but many teams prefer to pull the same numbers into their own scripts and observability pipelines. The Usage API gives every subscriber a simple, read-only REST endpoint that returns quota, calls made, and renewal dates for each active plan. Because usage metering is part of the core platform, the same pattern works for any product listed on API .market—from a 3D asset generator to FaceSwap V2. (, )

Base URL

https://prod.api.market/api/v1

All paths below are appended to this base.

Authentication

Pass your personal or workspace API key in the custom x-magicapi-key request header. This keyed-header scheme follows the same convention used by AWS API Gateway and other major providers. (, )

x-magicapi-key: YOUR_API_MARKET_KEY

Keep keys secret. They grant full metered access to every subscription under the issuing account.

Standard Headers

Header
Value
Purpose

Accept

application/json

Content-Type*

application/x-www-form-urlencoded

Kept for historical parity; payload-less GETs ignore it

*Sent for completeness, although GET bodies are ignored per HTTP spec.


Endpoint 1 – Usage for a Single Subscription

Method

GET

Path

/user/usage/{storeSlug}/{apiProduct}/

Auth Required

Yes – x-magicapi-key

Rate Limit

30 requests / minute (burst up to 60)

Success Code

200 OK

Error Codes

401 (invalid key) · 404 (unknown subscription) · 429 (rate-limited)

Path Parameters

Name
Example
Description

storeSlug

magicapi

The marketplace “store” that owns the product

apiProduct

faceswap-v2

Example Request (cURL)

curl -X GET \
  'https://prod.api.market/api/v1/user/usage/magicapi/faceswap-v2/' \
  -H 'x-magicapi-key: YOUR_API_MARKET_KEY' \
  -H 'accept: application/json'

Example Response

{
  "apiName": "magicapi/faceswap-v2",
  "store": "magicapi",
  "apiProduct": "faceswap-v2",
  "quota": 10000,
  "apiCallsLeft": 4158,
  "apiCallsMade": 5842,
  "startDate": "2025-04-30T19:11:38.010Z",
  "renewDate": "2025-05-30T19:11:38.010Z",
  "endDate": null
}

Field Reference

Field
Type
Notes

apiName

string

<store>/<product> canonical identifier

store

string

Slug of the provider store

apiProduct

string

Slug of the pricing plan / product

quota

int

Monthly (or plan) call allowance

apiCallsLeft

int

Remaining calls in current period

apiCallsMade

int

Calls consumed so far

startDate

ISO-8601

Billing cycle start

renewDate

ISO-8601

Next automatic renewal/refresh

endDate

ISO-8601 | null

Expiry date for one-off plans; usually null for recurring

Quick-start Code

import requests, os

API_KEY = os.getenv("API_MARKET_KEY")
url = "https://prod.api.market/api/v1/user/usage/magicapi/faceswap-v2/"
headers = {
    "x-magicapi-key": API_KEY,
    "accept": "application/json"
}
resp = requests.get(url, headers=headers, timeout=10)
resp.raise_for_status()
print(resp.json()["apiCallsLeft"])
const res = await fetch(
  "https://prod.api.market/api/v1/user/usage/magicapi/faceswap-v2/",
  {
    method: "GET",
    headers: {
      "x-magicapi-key": process.env.API_MARKET_KEY,
      "accept": "application/json"
    }
  }
);

if (!res.ok) throw new Error(`HTTP ${res.status}`);
const data = await res.json();
console.log(`Calls left: ${data.apiCallsLeft}`);

Endpoint 2 – Usage for All Active Subscriptions

Method

GET

Path

/user/usage/

Auth Required

Yes

Success Code

200 OK

Example Request

curl -X GET 'https://prod.api.market/api/v1/user/usage/' \
  -H 'x-magicapi-key: YOUR_API_MARKET_KEY' \
  -H 'accept: application/json'

Example Response (truncated)

{
  "usageData": [
    {
      "apiName": "magicapi/3d-asset-generator-api",
      "quota": 20,
      "apiCallsLeft": 18,
      "apiCallsMade": 2,
      "startDate": "2025-05-15T08:13:46.412Z",
      "renewDate": "2025-06-15T08:13:46.412Z",
      "endDate": null
    },
    {
      "apiName": "magicapi/faceswap-capix",
      "quota": 100,
      "apiCallsLeft": 87,
      "apiCallsMade": 13,
      "startDate": "2025-05-14T17:17:46.260Z",
      "renewDate": "2025-06-14T17:17:46.260Z",
      "endDate": null
    }
    /* …additional items… */
  ]
}

The response is an object with a single key, usageData, which is an array of the per-product schema described above.


Error Handling

Status
Meaning
Sample Payload

401 Unauthorized

Missing or invalid x-magicapi-key.

{"error":"invalid_api_key"}

404 Not Found

No subscription matches the path.

{"error":"subscription_not_found"}

429 Too Many Requests

Rate-limit exceeded. Retry-After header set.

{"error":"rate_limited"}

5xx

Upstream or gateway fault.

{"error":"server_error"}


Best Practices & Tips

  • Cache locally: Usage numbers change only when you make calls; polling every few minutes is sufficient for most dashboards.


Changelog

Date
Change

2025-05-17

Initial public release


Happy building!

Request JSON only (, )

Product slug shown in the URL and dashboard ()

Sync with UI analytics: Results match the figures displayed under Analytics → Account Usage in the web console. ()

Custom Usage adjustments: If a seller overrides usage via custom headers or the override endpoint, those changes are reflected instantly in this API. ()

Rotate keys: Treat the x-magicapi-key like a password; rotate periodically and immediately on suspected compromise. ()

Follow REST conventions when embedding the endpoint in client SDKs for long-term stability. ()

docs.api.market
docs.api.market
Swagger
Stoplight
docs.api.market
docs.api.market
Stack Overflow
Stack Overflow Blog
MDN Web Docs
Microsoft Learn
API.market