Search across IndiaMART, TradeIndia, Alibaba & Google — sequentially optimized for accuracy.
Try:
⚙️ Connection Setup
🔒 Deploy a free Cloudflare Worker to relay API calls (bypasses CORS). Your API key goes only to your Worker → Anthropic. Takes ~2 minutes to set up.
// ── Cloudflare Worker: Anthropic API Proxy ──
// 1. Go to https://dash.cloudflare.com → Workers & Pages → Create
// 2. Name it (e.g. "anthropic-proxy") → Deploy
// 3. Click "Edit Code" → paste this entire file → Save & Deploy
// 4. Copy the worker URL and paste it above
export default {
async fetch(request) {
// Handle CORS preflight
if (request.method === "OPTIONS") {
return new Response(null, {
headers: {
"Access-Control-Allow-Origin": "*",
"Access-Control-Allow-Methods": "POST, OPTIONS",
"Access-Control-Allow-Headers": "Content-Type, x-api-key, anthropic-version",
"Access-Control-Max-Age": "86400",
},
});
}
if (request.method !== "POST") {
return new Response("Method not allowed", { status: 405 });
}
// Forward to Anthropic
const apiKey = request.headers.get("x-api-key");
if (!apiKey) {
return new Response(JSON.stringify({ error: "Missing x-api-key header" }), {
status: 401,
headers: { "Content-Type": "application/json", "Access-Control-Allow-Origin": "*" },
});
}
try {
const response = await fetch("https://api.anthropic.com/v1/messages", {
method: "POST",
headers: {
"Content-Type": "application/json",
"x-api-key": apiKey,
"anthropic-version": "2023-06-01",
},
body: request.body,
});
const newResponse = new Response(response.body, {
status: response.status,
statusText: response.statusText,
headers: {
"Content-Type": "application/json",
"Access-Control-Allow-Origin": "*",
},
});
return newResponse;
} catch (err) {
return new Response(JSON.stringify({ error: err.message }), {
status: 500,
headers: { "Content-Type": "application/json", "Access-Control-Allow-Origin": "*" },
});
}
},
};
⚠️ Direct browser → Anthropic API. Often blocked by CORS on hosted pages. Works on localhost or if Anthropic has enabled direct browser access for your key.