API Credits
OpenGraph.io uses a credit-based system to meter API usage. Understanding how credits work helps you optimize costs and plan your integration effectively.
How Credits Work
Every API request consumes credits from your monthly allocation. The number of credits consumed depends on three factors:
- The endpoint you call — Different APIs have different base costs
- Features you enable — Options like proxies and JavaScript rendering add to the cost
- Cache status — Cached responses always cost just 1 credit
Credits reset at the beginning of each billing cycle. Unused credits do not roll over to the next month.
Credit Costs by Endpoint
Each API endpoint has a specific credit cost. Some endpoints have fixed pricing that does not change based on features like proxies or JavaScript rendering.
| Endpoint | Cost | Description |
|---|---|---|
/site | 1 credit | Extract OpenGraph metadata and link previews |
/scrape | 1 credit | Fetch raw HTML content from a URL |
/extract | 1 credit | Extract specific HTML elements in structured format |
/oembed | 10 credits | Generate embeddable iframe content |
/screenshot | 20 credits | Capture webpage screenshots (includes headless browser) |
/query (nano) | 100 credits | AI-powered extraction with nano model (default) |
/query (mini) | 200 credits | AI-powered extraction with mini model |
/query (standard) | 100 credits | AI-powered extraction with standard model |
Cache hits always cost 1 credit regardless of the endpoint or features that were used to generate the cached response.
Feature Credit Costs
Enabling features changes the credit cost of a request. Feature costs replace the base cost—they are not additive with the base.
| Feature | Parameter | Cost | Description |
|---|---|---|---|
| JavaScript Rendering | full_render=true | 10 credits | Executes JavaScript in a headless browser before extracting data |
| Standard Proxy | use_proxy=true | 10 credits | Routes through datacenter proxies for basic bot protection bypass |
| Residential Proxy | use_premium=true | 20 credits | Routes through residential IP pools for Cloudflare, Akamai, etc. |
| Mobile Proxy | use_superior=true | 30 credits | Routes through mobile carrier IPs for heavily protected sites |
How costs combine: When using multiple features together (e.g., full_render + proxy), the costs are added. For example, full_render=true with use_proxy=true costs 20 credits total (10 + 10).
Query API Pricing
The Query API uses AI models to answer questions about webpages. The credit cost depends on the model size you select:
| Model Size | Parameter | Cost | Best For |
|---|---|---|---|
| Nano (default) | modelSize=nano | 100 credits | Simple extractions, lists, basic questions |
| Mini | modelSize=mini | 200 credits | Complex extractions, structured data, summaries |
| Standard | modelSize=standard | 100 credits | Advanced reasoning, nuanced analysis, long content |
Fixed pricing: Query API costs are fixed regardless of other options. Using full_render or proxy options does not add additional credits to Query API requests.
Calculating Total Cost
The total credit cost depends on which features are enabled:
No features enabled: 1 credit (base cost)
Features enabled: Sum of feature costs
Cached response: 1 credit (always)Example Calculations
| Request | Calculation | Total |
|---|---|---|
/site (no features) | Base request | 1 credit |
/site + full_render | 10 (full_render) | 10 credits |
/site + use_proxy | 10 (proxy) | 10 credits |
/site + use_premium | 20 (residential proxy) | 20 credits |
/site + use_superior | 30 (mobile proxy) | 30 credits |
/site + full_render + use_proxy | 10 + 10 | 20 credits |
/site + full_render + use_premium | 10 + 20 | 30 credits |
/site + full_render + use_superior | 10 + 30 | 40 credits |
/screenshot | 20 (screenshot base) | 20 credits |
/oembed | 10 (oembed base) | 10 credits |
/query (nano or standard) | Fixed pricing | 100 credits |
/query (mini) | Fixed pricing | 200 credits |
/query + use_premium | Fixed (proxies don't add) | 100 credits |
| Any cached response | Cache hit | 1 credit |
Auto Proxy Credits
If you have Auto Proxy enabled (default on qualifying plans), the system automatically uses the appropriate proxy tier when needed. You're billed for the proxy tier that was actually used:
- If the request succeeds without a proxy: 1 credit
- If standard proxy was needed: 10 credits
- If residential proxy was needed: 20 credits
- If mobile proxy was needed: 30 credits
The response includes a proxyUsed field indicating which proxy tier was applied.
Retry Feature Credits
When using the retry=true feature, you're only charged for the successful attempt. Failed retry attempts do not consume additional credits.
{
"hybridGraph": { ... },
"retryInfo": {
"attempts": 3,
"successfulProxyLevel": "use_premium",
"creditCost": 20,
"attemptDetails": [
{ "attempt": 1, "proxyLevel": null, "success": false },
{ "attempt": 2, "proxyLevel": "use_proxy", "success": false },
{ "attempt": 3, "proxyLevel": "use_premium", "success": true }
]
}
}Retry billing: In the example above, only the successful attempt with use_premium is billed (20 credits). The failed attempts cost nothing.
Monthly Credit Allocations
Each plan includes a monthly credit allocation:
| Plan | Monthly Credits | Overage Rate |
|---|---|---|
| Free | 100 | Not available |
| Developer | 50,000 | $0.001 / credit |
| Production | 250,000 | $0.0008 / credit |
| Enterprise | 1,000,000+ | Custom |
Overage charges are billed at the end of your billing cycle if you exceed your allocation. You can set spending limits in the dashboard to prevent unexpected charges.
Optimizing Credit Usage
Here are strategies to minimize credit consumption:
1. Leverage Caching
Cached responses cost just 1 credit. Use cache_ok=true (default) and set appropriate max_cache_age values:
# Accept cached data up to 7 days old (604800 seconds)
curl "https://opengraph.io/api/1.1/site/https%3A%2F%2Fexample.com?app_id=YOUR_APP_ID&max_cache_age=604800"2. Start Without Premium Features
Only use proxies and JavaScript rendering when needed. Start with basic requests and escalate only if you encounter issues:
- Try without any special options first (1 credit)
- If blocked, add
use_proxy=true(10 credits) - If still blocked, try
use_premium=true(20 credits) - As a last resort, use
use_superior=true(30 credits)
3. Use the Right Model Size for Query API
Choose the appropriate model for your task. The mini model costs 2x more than nano/standard:
- Nano (100 credits): Simple extractions, lists, basic questions (default)
- Standard (100 credits): Advanced reasoning, nuanced analysis
- Mini (200 credits): Complex extractions, structured data, summaries
4. Batch Similar Requests
If you need data from multiple pages on the same domain, consider whether you really need all of them, or if sampling would suffice.
5. Monitor Usage
Regularly check your credit consumption in the dashboard to identify optimization opportunities.
Tracking Credit Usage
You can monitor your credit usage in several ways:
- Dashboard — Real-time usage charts and history
- Response headers — Each response includes credit information
- Email alerts — Configure notifications at usage thresholds
Response Headers
API responses include headers with credit information:
X-Billing-Request: 20