Cursor, Trae & AI IDEs
Route AI-powered IDE features through SpendLil for spend visibility.
AI-native IDEs like Cursor, Trae, Windsurf (Codeium), and Continue.dev make API calls to AI providers on your behalf. Since SpendLil uses provider-specific gateway subdomains and X-Provider-Key instead of Authorization, most AI IDEs need a local proxy to inject the correct headers.
Continue.dev
Continue.dev is an open-source AI coding assistant for VS Code and JetBrains. It supports full configuration of API endpoints and custom headers, making it the easiest AI IDE to integrate with SpendLil.
{
"models": [
{
"title": "GPT-4o (via SpendLil)",
"provider": "openai",
"model": "gpt-4o",
"apiKey": "sk-your-openai-key",
"apiBase": "https://openai.gateway.spendlil.ai/v1",
"requestOptions": {
"headers": {
"X-SpendLil-Key": "sl_abc123def456",
"X-Provider-Key": "Bearer sk-your-openai-key"
}
}
},
{
"title": "Claude Sonnet (via SpendLil)",
"provider": "anthropic",
"model": "claude-sonnet-4-5-20250514",
"apiKey": "sk-ant-your-key",
"apiBase": "https://anthropic.gateway.spendlil.ai",
"requestOptions": {
"headers": {
"X-SpendLil-Key": "sl_abc123def456",
"X-Provider-Key": "Bearer sk-ant-your-key"
}
}
}
]
} Cursor
Cursor supports custom base URLs but uses the standard Authorization header internally. Since SpendLil requires X-Provider-Key instead, you'll need the local header injection proxy described below.
Trae
Trae is a free AI IDE by ByteDance, built on VS Code, with access to Claude, GPT-4o, DeepSeek, and Gemini models.
As of April 2026, Trae IDE does not support custom base URLs for API endpoints. There's an open feature request on GitHub (Trae-AI/Trae #2076). Use the local proxy below.
Trae Agent CLI
Trae also offers trae-cli (Trae Agent), a standalone CLI tool that does support custom base URLs. However, it still uses the standard Authorization header, so you'll need the local proxy for the X-Provider-Key header swap.
GitHub Copilot
GitHub Copilot uses a proprietary API channel and does not support custom base URLs. Copilot spend cannot be routed through SpendLil. You can manually add Copilot's fixed subscription cost to your budget tracking in the dashboard.
Local Header Injection Proxy
For IDEs that use the standard Authorization header and don't support custom headers, run this local proxy. It accepts requests with a normal Authorization header, swaps it to X-Provider-Key, injects X-SpendLil-Key, and forwards to the SpendLil gateway.
import http from 'node:http';
import https from 'node:https';
const SPENDLIL_KEY = process.env.SPENDLIL_KEY || 'sl_abc123def456';
const PROVIDER = process.env.PROVIDER || 'openai'; // openai | anthropic | google | mistral
const GATEWAY = `${PROVIDER}.gateway.spendlil.ai`;
const PORT = 8787;
const server = http.createServer((req, res) => {
// Swap Authorization → X-Provider-Key
const headers = { ...req.headers };
if (headers['authorization']) {
headers['x-provider-key'] = headers['authorization'];
delete headers['authorization'];
}
headers['x-spendlil-key'] = SPENDLIL_KEY;
headers['host'] = GATEWAY;
const options = {
hostname: GATEWAY,
port: 443,
path: req.url,
method: req.method,
headers,
};
const proxy = https.request(options, (proxyRes) => {
res.writeHead(proxyRes.statusCode, proxyRes.headers);
proxyRes.pipe(res);
});
req.pipe(proxy);
proxy.on('error', (err) => {
console.error('Proxy error:', err.message);
res.writeHead(502);
res.end('SpendLil proxy error');
});
});
server.listen(PORT, () => {
console.log(`SpendLil proxy for ${PROVIDER} on http://localhost:${PORT}`);
console.log(`Set your IDE base URL to: http://localhost:${PORT}`);
}); # For OpenAI-based IDEs
PROVIDER=openai SPENDLIL_KEY=sl_abc123 node spendlil-proxy.mjs
# Then set IDE base URL to http://localhost:8787
# For Anthropic-based IDEs
PROVIDER=anthropic SPENDLIL_KEY=sl_abc123 node spendlil-proxy.mjs