One API for All AI Models
Just 3 lines of code to switch.
OpenAI-compatible. Privacy-first.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
const { OpenAI } = require("openai");
const client = new OpenAI({
baseURL: "https://api.forge.tensorblock.co/v1",
apiKey: OPENAI_API_KEY,
apiKey: FORGE_API_KEY,
});
async function main() {
const completion = await client.chat.completions.create({
model: "gpt-4o",
model: "OpenAI/gpt-4o",
messages: [
{ role: "developer", content: "You are a helpful assistant." },
{ role: "user", content: "Hello!" }
]
});
console.log(completion.choices[0].message);
}
+
-
+
-
+
Loading...