API examples
Requests to the free AI offers API in curl, JavaScript, Python and Go, and what each endpoint answers. Endpoints, filters and limits are on the developer page.
curl
curl -s 'https://aifree.dev/api/v1/offers?category=api-credits&cardRequired=false&fields=name,headline,vendorUrl'
# Free image tools whose free-plan output may be used commercially
curl -s 'https://aifree.dev/api/v1/offers?category=image&commercialUse=yes&fields=name,commercialUse,url'
# Conditional request: 304 when nothing changed
curl -s -i -H 'If-None-Match: "<etag from the previous response>"' 'https://aifree.dev/api/v1/offers'
# With a free key (6,000 requests / 15 min)
curl -s -H 'Authorization: Bearer afk_…' 'https://aifree.dev/api/v1/changes?since=2026-10-01'Best lists
The curated lists behind /best: curl, then the same through the @aifree/sdk package (the CLI has aifree best [slug], Python best_lists()).
# Every curated "best free X" list with the names of its picks
curl -s 'https://aifree.dev/api/v1/best'
# One list: picks with links, FAQ, sources and body
curl -s 'https://aifree.dev/api/v1/best/free-ai-apis'import { createClient } from '@aifree/sdk'
const client = createClient()
const lists = await client.best.list()
const list = await client.best.get('free-ai-apis')
for (const pick of list.data.items) console.log(pick.name, '-', pick.url)Clients
The three clients below send the same request with only the standard library, read an optional AIFREE_API_KEY, and print the error code on failure. A test runs each of them against a local server on every change.
JavaScript (Node 18+)
// offers.mjs - Node 18+ (built-in fetch), no dependencies
const base = process.env.AIFREE_API_URL ?? 'https://aifree.dev/api/v1'
const params = new URLSearchParams({
category: 'api-credits',
cardRequired: 'false',
fields: 'name,headline,url',
limit: '5'
})
const headers = { 'User-Agent': 'my-app/1.0' }
if (process.env.AIFREE_API_KEY) headers['X-API-Key'] = process.env.AIFREE_API_KEY
const res = await fetch(`${base}/offers?${params}`, { headers })
const body = await res.json()
if (!res.ok) {
// Stable error code; 429 and 5xx also carry retryAfter (seconds)
console.error(`${res.status} ${body.code}: ${body.error}`, body.retryAfter ?? '')
process.exit(1)
}
console.log(`${body.meta.total} offers`)
for (const offer of body.data) console.log(`${offer.name} - ${offer.url}`)Python
# offers.py - Python 3.8+, standard library only
import json, os, sys, urllib.error, urllib.parse, urllib.request
base = os.environ.get("AIFREE_API_URL", "https://aifree.dev/api/v1")
query = urllib.parse.urlencode({
"category": "api-credits",
"cardRequired": "false",
"fields": "name,headline,url",
"limit": 5,
})
headers = {"User-Agent": "my-app/1.0"}
if os.environ.get("AIFREE_API_KEY"):
headers["X-API-Key"] = os.environ["AIFREE_API_KEY"]
try:
req = urllib.request.Request(f"{base}/offers?{query}", headers=headers)
with urllib.request.urlopen(req, timeout=10) as res:
body = json.load(res)
except urllib.error.HTTPError as err:
# Stable error code; 429 and 5xx also carry retryAfter (seconds)
e = json.load(err)
sys.exit(f"{err.code} {e['code']}: {e['error']} {e.get('retryAfter', '')}")
print(f"{body['meta']['total']} offers")
for offer in body["data"]:
print(f"{offer['name']} - {offer['url']}")Go
// offers.go - Go 1.21+, standard library only: go run offers.go
package main
import (
"encoding/json"
"fmt"
"net/http"
"net/url"
"os"
"time"
)
type offersPage struct {
Data []struct {
Name string `json:"name"`
URL string `json:"url"`
} `json:"data"`
Meta struct {
Total int `json:"total"`
} `json:"meta"`
}
type apiError struct {
Error string `json:"error"`
Code string `json:"code"`
RetryAfter int `json:"retryAfter"` // set on 429 and 5xx
}
func main() {
base := os.Getenv("AIFREE_API_URL")
if base == "" {
base = "https://aifree.dev/api/v1"
}
q := url.Values{
"category": {"api-credits"},
"cardRequired": {"false"},
"fields": {"name,headline,url"},
"limit": {"5"},
}
req, err := http.NewRequest("GET", base+"/offers?"+q.Encode(), nil)
if err != nil {
panic(err)
}
req.Header.Set("User-Agent", "my-app/1.0")
if key := os.Getenv("AIFREE_API_KEY"); key != "" {
req.Header.Set("X-API-Key", key)
}
res, err := (&http.Client{Timeout: 10 * time.Second}).Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
if res.StatusCode != http.StatusOK {
var e apiError
json.NewDecoder(res.Body).Decode(&e)
fmt.Fprintf(os.Stderr, "%d %s: %s %d\n", res.StatusCode, e.Code, e.Error, e.RetryAfter)
os.Exit(1)
}
var page offersPage
if err := json.NewDecoder(res.Body).Decode(&page); err != nil {
panic(err)
}
fmt.Printf("%d offers\n", page.Meta.Total)
for _, o := range page.Data {
fmt.Printf("%s - %s\n", o.Name, o.URL)
}
}Example responses
Real responses of our test database, recorded 2026-11-01, the same ones openapi.json carries as examples; a test checks every endpoint still answers as the spec says. Arrays are cut to 3 items here.
GET /api/v1/offers?limit=1 → 200
{
"data": [
{
"slug": "agentrouter-free-credits",
"url": "https://aifree.dev/offer/agentrouter-free-credits",
"name": "AgentRouter free credits",
"provider": "AgentRouter",
"vendorUrl": "https://agentrouter.org",
"headline": "Up to $200 in free AI credits",
"whatYouGet": "Credits for LLM routing APIs and AI-assisted coding: $100 signup bonus, $50 referral bonus, $25 first check-in bonus.",
"theCatch": "The full $200 needs three actions: signup, a referral, and a first check-in. GitHub account must predate a cutoff date.",
"category": "coding",
"secondaryCategories": [
"api-credits"
],
"audiences": [
"developers"
],
"freeType": "free-credits",
"openSource": false,
"amount": {
"unit": "USD",
"value": 200,
"recurring": false,
"durationMonths": null
},
"resets": null,
"refill": "once",
"models": null,
"selfHostAlternative": null,
"requirements": null,
"apiBaseUrl": null,
"apiCompat": null,
"successorSlug": null,
"commercialUse": null,
"cardRequired": false,
"signupRequired": true,
"eligibility": {
"regions": [
"global"
],
"summary": "Developers with a GitHub account of minimum age",
"requirements": [
"GitHub account created before the listed cutoff date",
"Referral and check-in bonuses require extra steps"
]
},
"limits": [
"Total $200 is split: $100 signup, $50 referral, $25 first check-in",
"GitHub account age requirement applies"
],
"expiryDate": null,
"listedAt": "2026-09-10",
"verifiedAt": "2026-09-10",
"status": "verified",
"riskStatus": "clean",
"relatedSlugs": [
"groq-free-tier",
"cerebras-inference-free-trial",
"cline-free-models"
],
"updatedAt": "2026-11-01T06:42:33Z"
}
],
"meta": {
"total": 4,
"page": 1,
"limit": 1,
"pages": 4,
"version": "1",
"license": "CC BY 4.0",
"attribution": "Data from aifree.dev (CC BY 4.0): https://aifree.dev"
}
}GET /api/v1/offers?category=not-a-real-value → 400
{
"error": "Invalid query",
"code": "invalid_request",
"details": [
"category: unknown value(s) not-a-real-value; allowed: coding, image, audio, video, api-credits, assistant, other"
]
}GET /api/v1/offers (x-api-key: afk_contract-check-invalid-key000000000000000000) → 401
{
"error": "Unknown or revoked API key",
"code": "api_key_invalid"
}GET /api/v1/offers/agentrouter-free-credits → 200
{
"data": {
"slug": "agentrouter-free-credits",
"url": "https://aifree.dev/offer/agentrouter-free-credits",
"name": "AgentRouter free credits",
"provider": "AgentRouter",
"vendorUrl": "https://agentrouter.org",
"headline": "Up to $200 in free AI credits",
"whatYouGet": "Credits for LLM routing APIs and AI-assisted coding: $100 signup bonus, $50 referral bonus, $25 first check-in bonus.",
"theCatch": "The full $200 needs three actions: signup, a referral, and a first check-in. GitHub account must predate a cutoff date.",
"category": "coding",
"secondaryCategories": [
"api-credits"
],
"audiences": [
"developers"
],
"freeType": "free-credits",
"openSource": false,
"amount": {
"unit": "USD",
"value": 200,
"recurring": false,
"durationMonths": null
},
"resets": null,
"refill": "once",
"models": null,
"selfHostAlternative": null,
"requirements": null,
"apiBaseUrl": null,
"apiCompat": null,
"successorSlug": null,
"commercialUse": null,
"cardRequired": false,
"signupRequired": true,
"eligibility": {
"regions": [
"global"
],
"summary": "Developers with a GitHub account of minimum age",
"requirements": [
"GitHub account created before the listed cutoff date",
"Referral and check-in bonuses require extra steps"
]
},
"limits": [
"Total $200 is split: $100 signup, $50 referral, $25 first check-in",
"GitHub account age requirement applies"
],
"expiryDate": null,
"listedAt": "2026-09-10",
"verifiedAt": "2026-09-10",
"status": "verified",
"riskStatus": "clean",
"relatedSlugs": [
"groq-free-tier",
"cerebras-inference-free-trial",
"cline-free-models"
],
"updatedAt": "2026-11-01T06:42:33Z"
},
"meta": {
"version": "1",
"license": "CC BY 4.0",
"attribution": "Data from aifree.dev (CC BY 4.0): https://aifree.dev"
}
}GET /api/v1/offers/no-such-offer → 404
{
"error": "Offer not found",
"code": "not_found"
}GET /api/v1/changes?limit=1 → 200
{
"data": [
{
"id": "evt_smoke_seed",
"slug": "agentrouter-free-credits",
"url": "https://aifree.dev/offer/agentrouter-free-credits",
"kind": "terms_updated",
"at": "2026-11-01T06:42:33.360Z",
"source": "human",
"note": "Smoke suite seed event",
"offerStatus": "verified",
"alternativesUrl": null
}
],
"meta": {
"total": 8,
"page": 1,
"limit": 1,
"pages": 8,
"version": "1",
"license": "CC BY 4.0",
"attribution": "Data from aifree.dev (CC BY 4.0): https://aifree.dev"
}
}GET /api/v1/best → 200
{
"data": [
{
"slug": "seed-free-ai-apis",
"title": "Seeded free AI APIs",
"description": "A seeded top list for the smoke suite.",
"published": "2026-11-01",
"checked": "2026-11-01",
"image": null,
"url": "https://aifree.dev/best/seed-free-ai-apis",
"markdownUrl": "https://aifree.dev/best/seed-free-ai-apis.md",
"picks": [
"Groq free tier",
"ElevenLabs free plan"
]
}
],
"meta": {
"total": 1,
"version": "1",
"license": "CC BY 4.0",
"attribution": "Data from aifree.dev (CC BY 4.0): https://aifree.dev"
}
}GET /api/v1/best/seed-free-ai-apis → 200
{
"data": {
"slug": "seed-free-ai-apis",
"title": "Seeded free AI APIs",
"description": "A seeded top list for the smoke suite.",
"published": "2026-11-01",
"checked": "2026-11-01",
"image": null,
"url": "https://aifree.dev/best/seed-free-ai-apis",
"markdownUrl": "https://aifree.dev/best/seed-free-ai-apis.md",
"picks": [
"Groq free tier",
"ElevenLabs free plan"
],
"items": [
{
"name": "Groq free tier",
"url": "https://aifree.dev/offer/groq-free-tier"
},
{
"name": "ElevenLabs free plan",
"url": "https://aifree.dev/offer/elevenlabs-free-plan"
}
],
"faqs": [
{
"question": "Is it free?",
"answer": "Yes, within the limits."
}
],
"sources": [
"https://example.com/pricing"
],
"body": "## Why these\n\nSeeded for the smoke suite."
},
"meta": {
"version": "1",
"license": "CC BY 4.0",
"attribution": "Data from aifree.dev (CC BY 4.0): https://aifree.dev"
}
}GET /api/v1/providers → 200
{
"data": [
{
"slug": "agentrouter",
"name": "AgentRouter",
"offerCount": 1,
"categories": [
"coding",
"api-credits"
],
"freeTypes": [
"free-credits"
],
"offers": [
{
"slug": "agentrouter-free-credits",
"name": "AgentRouter free credits",
"url": "https://aifree.dev/offer/agentrouter-free-credits",
"status": "verified"
}
]
},
{
"slug": "elevenlabs",
"name": "ElevenLabs",
"offerCount": 1,
"categories": [
"audio"
],
"freeTypes": [
"free-tier"
],
"offers": [
{
"slug": "elevenlabs-free-plan",
"name": "ElevenLabs free plan",
"url": "https://aifree.dev/offer/elevenlabs-free-plan",
"status": "verified"
}
]
},
{
"slug": "openai",
"name": "OpenAI",
"offerCount": 1,
"categories": [
"assistant"
],
"freeTypes": [
"student-program"
],
"offers": [
{
"slug": "chatgpt-for-students-4-months-free",
"name": "ChatGPT for Students: 4 months free",
"url": "https://aifree.dev/offer/chatgpt-for-students-4-months-free",
"status": "verified"
}
]
},
"… 1 more"
],
"meta": {
"total": 4,
"version": "1",
"license": "CC BY 4.0",
"attribution": "Data from aifree.dev (CC BY 4.0): https://aifree.dev"
}
}GET /api/v1/models?limit=1 → 200
{
"data": [
{
"slug": "smoke-fixture-chat-8b",
"url": "https://aifree.dev/model/smoke-fixture-chat-8b",
"name": "Smoke Fixture Chat 8B",
"family": "llama",
"vendor": "Meta",
"openWeights": true,
"contextK": 128,
"toolCalling": true,
"vision": false,
"structuredOutput": true,
"sourceCount": 1,
"verifiedSourceCount": 0,
"indexable": false
}
],
"meta": {
"total": 2,
"page": 1,
"limit": 1,
"pages": 2,
"version": "1",
"license": "CC BY 4.0",
"attribution": "Data from aifree.dev (CC BY 4.0): https://aifree.dev"
}
}GET /api/v1/models/smoke-fixture-chat-8b → 200
{
"data": {
"slug": "smoke-fixture-chat-8b",
"url": "https://aifree.dev/model/smoke-fixture-chat-8b",
"name": "Smoke Fixture Chat 8B",
"family": "llama",
"vendor": "Meta",
"openWeights": true,
"contextK": 128,
"toolCalling": true,
"vision": false,
"structuredOutput": true,
"sourceCount": 1,
"verifiedSourceCount": 0,
"indexable": false,
"benchmarkUrl": null,
"sources": [
{
"offerSlug": "smoke-fixture-llm-api",
"offerUrl": "https://aifree.dev/offer/smoke-fixture-llm-api",
"offerName": "Smoke Fixture LLM API",
"provider": "Smoke Fixture",
"servedAs": "Smoke Fixture Chat 8B",
"verified": false,
"cardRequired": false,
"contextK": 128,
"structuredOutput": true,
"rateLimit": {
"rpm": 30,
"rpd": 14400,
"tpm": 60000,
"tpd": null,
"rpmo": null
},
"resets": null
}
]
},
"meta": {
"version": "1",
"license": "CC BY 4.0",
"attribution": "Data from aifree.dev (CC BY 4.0): https://aifree.dev"
}
}GET /api/v1/eligibility?limit=1 → 200
{
"data": {
"answers": {
"student": false,
"startup": "none",
"country": "",
"noCard": false,
"building": "any"
},
"profile": [
"Everyone"
],
"total": 3,
"verifiedCount": 2,
"listedCount": 1,
"totalUsd": 200,
"unrecordedRegionCount": 0,
"note": "The total adds up dollar-denominated credits on verified rows only; free tiers measured in tokens, requests, images or minutes are listed below but count as $0 - no exchange rates, no guesses.",
"unlockUrl": "https://aifree.dev/unlock?student=0&startup=none&country=&card=ok&building=any",
"offers": [
{
"slug": "agentrouter-free-credits",
"url": "https://aifree.dev/offer/agentrouter-free-credits",
"name": "AgentRouter free credits",
"provider": "AgentRouter",
"headline": "Up to $200 in free AI credits",
"category": "coding",
"freeType": "free-credits",
"status": "verified",
"cardRequired": false,
"usdValue": 200,
"verifiedAt": "2026-09-10"
}
]
},
"meta": {
"total": 3,
"limit": 1,
"version": "1",
"license": "CC BY 4.0",
"attribution": "Data from aifree.dev (CC BY 4.0): https://aifree.dev"
}
}GET /api/v1/status → 200
{
"generatedAt": "2026-11-01T06:44:09.283Z",
"overall": "unknown",
"slo": {
"siteAvailability": 0.999,
"jobLatenessMinutes": 30,
"fastJobMaxEveryMinutes": 10,
"jobDelayedMaxMinutes": 360,
"apiP95Ms": 500
},
"uptime30d": null,
"paths": [],
"daily": [
{
"day": "2026-10-03",
"uptime": null,
"checks": 0
},
{
"day": "2026-10-04",
"uptime": null,
"checks": 0
},
{
"day": "2026-10-05",
"uptime": null,
"checks": 0
},
"… 27 more"
],
"monitoringSince": null,
"jobs": [
{
"job": "webhooks-dispatch",
"label": "Webhook retries",
"everyMinutes": 5,
"runbook": "/docs/runbooks/webhooks.md",
"shipped": true,
"lastRunAt": null,
"lastOk": null,
"lastSummary": null,
"lastError": null,
"verdict": "never",
"minutesSinceRun": null
},
{
"job": "uptime-check",
"label": "External uptime check",
"everyMinutes": 5,
"runbook": "/docs/runbooks/monitoring.md",
"shipped": false,
"lastRunAt": null,
"lastOk": null,
"lastSummary": null,
"lastError": null,
"verdict": "not-scheduled",
"minutesSinceRun": null
},
{
"job": "db-backup",
"label": "Nightly database backup",
"everyMinutes": 1440,
"runbook": "/docs/runbooks/backup.md",
"shipped": true,
"lastRunAt": null,
"lastOk": null,
"lastSummary": null,
"lastError": null,
"verdict": "never",
"minutesSinceRun": null
},
"… 14 more"
]
}GET /api/v1/openapi.json → 429
{
"error": "Rate limit exceeded (600 requests per 15 minutes). Get a free API key at https://aifree.dev/developers.",
"code": "rate_limited",
"retryAfter": 897
}GET /api/v1/is-free?q=claude → 200
{
"data": {
"query": "claude",
"match": {
"kind": "provider",
"name": "Claude",
"url": "https://aifree.dev/provider/claude-com"
},
"free": true,
"answer": "Yes. Claude has 1 verified free offer today, no card required. Best: Claude API New User Credits: Free API credit for new Claude Console accounts. Main limit: One-time credit; amount not published. Verified Nov 6, 2026.",
"best": {
"slug": "claude-api-new-user-credits",
"name": "Claude API New User Credits",
"url": "https://aifree.dev/offer/claude-api-new-user-credits",
"headline": "Free API credit for new Claude Console accounts",
"mainLimit": "One-time credit; amount not published",
"cardRequired": false,
"eligibility": "New Claude Console accounts",
"verifiedAt": "2026-11-06"
},
"answerPage": "https://aifree.dev/learn/is-claude-free",
"checkedAt": "2026-11-06",
"searchUrl": "https://aifree.dev/offers?q=claude"
},
"meta": {
"version": "1",
"license": "CC BY 4.0",
"attribution": "Data from aifree.dev (CC BY 4.0): https://aifree.dev"
}
}More
Ready requests for every endpoint: Postman and Bruno collections. MCP client configs and agent frameworks: AI agents. Change notifications: webhooks.