Developer API
Submit AI Tools Programmatically
Use the REST API or npm SDK to submit AI tools, check your credits, and attach optional promotional placements from your own workflow.
Authentication
All API requests require a Bearer token in the Authorization header. Create your API key and manage your credits from the API Keys page.
Authorization: Bearer aidirs_your_api_key_hereYour API key is shown only once when generated. Store it securely and never expose it in client-side code.
Credits & Plans
API submissions use a base plan plus optional promotional add-ons. You can check your remaining credits and buy more from the API Keys page before submitting.
starter1 credit
Base submission with standard review
pro3 credits
Featured submission with stronger placement
add-onsoptional
Attach sidebar spotlight or hero sponsor placements
Promotion add-ons
Endpoints
/api/v1/creditsCheck your current credit balance and subscription plan.
{
"credits": 8,
"plan": "free"
}/api/v1/submitSubmit an AI tool to the directory. Name and description are automatically generated by AI.
{
"url": "https://example.com",
"plan": "starter",
"addonIds": ["sidebar_spotlight_30d"]
}Required fields: url, plan (starter | pro). Optional field: addonIds. Submissions always enter pending review, and product details are auto-filled by AI before admin review.
Optional promotion add-ons
Credits are calculated as base plan + selected add-ons. Example:starter + sidebar_spotlight_30d = 10 credits.
SDK / npm Package
Use the official @aidirs/sdk package for a type-safe, zero-config experience in Node.js / TypeScript projects.
pnpm add @aidirs/sdkimport { Aidirs } from "@aidirs/sdk";
const client = new Aidirs({ apiKey: process.env.AIDIRS_API_KEY! });
// Check credits
const { credits, plan } = await client.credits();
console.log(`Credits: ${credits}, Plan: ${plan}`);
// Submit a tool
const result = await client.submit({
url: "https://example.com",
plan: "pro",
addonIds: ["hero_page_30d"],
});
console.log(result);
// { status, url, reviewStatus, creditsUsed, creditsRemaining }// Submit multiple tools — stops early on 402 (no credits)
const { results, errors } = await client.batchSubmit([
{ url: "https://tool-a.com", plan: "starter" },
{ url: "https://tool-b.com", plan: "pro", addonIds: ["sidebar_spotlight_30d"] },
{ url: "https://tool-c.com", plan: "starter", addonIds: ["hero_page_7d"] },
]);
console.log(`Submitted: ${results.length}, Errors: ${errors.length}`);SDK Features
Code Examples
cURL
curl https://aidirs.best/api/v1/credits \
-H "Authorization: Bearer aidirs_your_key"curl -X POST https://aidirs.best/api/v1/submit \
-H "Authorization: Bearer aidirs_your_key" \
-H "Content-Type: application/json" \
-d '{
"url": "https://example.com",
"plan": "starter",
"addonIds": ["sidebar_spotlight_30d"]
}'Node.js (fetch)
const API_KEY = process.env.AIDIRS_API_KEY;
const BASE = "https://aidirs.best";
async function submitTool(url, plan = "starter", addonIds = []) {
const res = await fetch(`${BASE}/api/v1/submit`, {
method: "POST",
headers: {
Authorization: `Bearer ${API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({ url, plan, addonIds }),
});
if (!res.ok) {
const err = await res.json();
throw new Error(err.error || res.statusText);
}
return res.json();
}
const result = await submitTool("https://example.com", "pro", ["hero_page_30d"]);
console.log(result);Python
import os, requests
API_KEY = os.environ["AIDIRS_API_KEY"]
BASE = "https://aidirs.best"
def submit_tool(url: str, plan: str = "starter", addon_ids=None):
addon_ids = addon_ids or []
res = requests.post(
f"{BASE}/api/v1/submit",
headers={
"Authorization": f"Bearer {API_KEY}",
"Content-Type": "application/json",
},
json={"url": url, "plan": plan, "addonIds": addon_ids},
)
res.raise_for_status()
return res.json()
result = submit_tool("https://example.com", "pro", ["hero_page_30d"])
print(result)Error Handling
{
"error": "Insufficient credits",
"required": 2,
"available": 1
}Rate Limits
10 requests / minute
Per API key. Exceeding this limit returns a 429 status code. Retry after 60 seconds.
