GPT-Image-2 Generation Pricing: APIMart Costs, Fallback Rates, and Community Tiers Explained
GPT-Image-2 generation pricing starts at $0.006 per image through the APIMart platform, with fallback rates ranging from $0.010625 to $0.02625 based on resolution, plus a community tier priced at ¥9.90 CNY.
The freestylefly/awesome-gpt-image-2 repository implements a multi-tiered pricing model for GPT-Image-2 generation that combines live API rates from APIMart with hardcoded fallback values. Understanding these cost structures is essential for budgeting image generation workloads and handling API outages gracefully.
Official APIMart Pricing Structure
The primary pricing mechanism relies on APIMart's live API, documented in the repository's public-facing documentation and implemented in private API libraries.
Live API Rates
According to the README.md at line 49, the base GPT-Image-2 generation pricing through APIMart is set at $0.006 per image. This rate delivers approximately 160+ images per US $1, making it one of the more cost-effective options for high-volume generation tasks.
Fallback Resolution-Based Pricing
When the APIMart endpoint is unavailable, the system defaults to resolution-specific pricing defined in shared/apimart.js. The fallbackApimartPricing() function returns structured USD costs based on output dimensions:
- 1K resolution (approximately 1024px): $0.010625 per image
- 2K resolution (approximately 2048px): $0.0175 per image
- 4K resolution (approximately 4096px): $0.02625 per image
These values are hardcoded at lines 100-105 in shared/apimart.js and serve as the safety net when live pricing cannot be retrieved.
Community Tier Pricing
Beyond the standard APIMart integration, the repository supports a community checkout mechanism priced at ¥9.90 CNY. This value is defined in api/_lib/community.js at lines 30-31, offering a localized payment option for users accessing the free-tier community features.
Implementing Pricing Checks in Code
The repository provides distinct modules for fetching live versus fallback pricing. The getApimartPricing() function in api/_lib/apimart.js (lines 84-98) handles live rate retrieval, while fallbackApimartPricing() in shared/apimart.js provides offline-capable cost estimates.
Fetch live APIMart rates:
import { getApimartPricing } from '../api/_lib/apimart.js';
async function showLivePricing() {
const pricing = await getApimartPricing();
console.log('Live APIMart pricing:', pricing);
}
showLivePricing();
Use fallback pricing when the endpoint fails:
import { fallbackApimartPricing } from '../shared/apimart.js';
function showFallbackPricing() {
const pricing = fallbackApimartPricing();
console.log('Fallback pricing (USD):', pricing);
}
showFallbackPricing();
Summary
- Primary cost: $0.006 per image via APIMart live API (160+ images per dollar) documented in
README.md - Fallback rates: Resolution-based pricing from $0.010625 (1K) to $0.02625 (4K) defined in
shared/apimart.js - Community option: ¥9.90 CNY tier hardcoded in
api/_lib/community.js - Implementation: Use
getApimartPricing()for live data andfallbackApimartPricing()for offline resilience
Frequently Asked Questions
What is the standard cost per image for GPT-Image-2 generation?
The standard GPT-Image-2 generation pricing is $0.006 per image when accessing the live APIMart API, as documented in the repository's README.md at line 49. This translates to roughly 160 images generated per US dollar spent.
How does the system handle pricing when the APIMart API is unavailable?
The repository implements a fallback mechanism via the fallbackApimartPricing() function in shared/apimart.js, which returns default USD costs based on image resolution. The system automatically serves $0.010625 for 1K, $0.0175 for 2K, and $0.02625 for 4K outputs when the live endpoint cannot be reached.
What is the community tier price and where is it defined?
The community checkout tier is priced at ¥9.90 CNY, hardcoded in api/_lib/community.js at lines 30-31. This provides a localized payment option separate from the standard APIMart USD integration, specifically targeting the free-tier community checkout payload.
Which source files control the pricing logic in the repository?
The pricing logic is distributed across four key files: README.md for public documentation of the base rate, api/_lib/apimart.js for live price fetching via getApimartPricing(), shared/apimart.js for fallback rates via fallbackApimartPricing(), and api/_lib/community.js for community-tier checkout values.
Have a question about this repo?
These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →