Documentation IndexFetch the complete documentation index at: /llms.txtUse this file to discover all available pages before exploring further.
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Chat, streaming, embeddings and image generation - no API key to manage.
provider/model
const completion = await backend.ai.chat.completions.create({ model: "openai/gpt-4o-mini", messages: [{ role: "user", content: "Summarize this..." }], }); console.log(completion.choices[0].message.content);
const stream = await backend.ai.chat.completions.create({ model: "openai/gpt-4o-mini", messages, stream: true, }); for await (const chunk of stream) { process.stdout.write(chunk.choices[0]?.delta?.content ?? ""); }
const res = await backend.ai.embeddings.create({ model: "openai/text-embedding-3-small", input: "hello world", }); // res.data[0].embedding → number[]
const img = await backend.ai.images.generate({ model: "google/gemini-2.5-flash-image", prompt: "A sunset over mountains", }); // img.data[0].b64_json → base64 PNG