Node.js Integration
Use the AiSpendTrack proxy with Node.js by pointing your OpenAI or Anthropic client to the proxy base URL and adding your project key in headers or environment variables.
See Installation for base URL and Authentication for API key setup.
Example
const { OpenAI } = require('openai')
const openai = new OpenAI({
baseURL: process.env.AISPENDTRACK_PROXY_URL,
apiKey: process.env.OPENAI_API_KEY,
defaultHeaders: {
'X-AiSpendTrack-Project': process.env.AISPENDTRACK_PROJECT_KEY,
},
})Replace AISPENDTRACK_PROXY_URL and AISPENDTRACK_PROJECT_KEY with your proxy URL and project key from the dashboard.
Last updated on