Use Claude, GPT and Gemini in your app without an OpenAI or Anthropic account

, developer of Bot-Hosting

You want your app to answer questions, summarise text or call tools with a good model. The usual path is an account at OpenAI, another at Anthropic for Claude, a third at Google for Gemini, a card on each one, three keys to keep secret and three bills to watch.

If your app runs on Bot-Hosting, there is a shorter path. Every deployment, whether it is a website, an API, a worker or a Discord bot, has an AI tab. One click gives it an OpenAI-compatible AI API with access to Claude, GPT, Gemini, DeepSeek and more than 360 other models. You pay with AI Tokens from the balance you already have, and you never open an account at a model provider.

This guide shows the whole thing with code you can paste.

The short version

  1. Deploy your app on Bot-Hosting, or open one you already host.
  2. Open its AI tab, pick a default model and select Turn on AI.
  3. Restart the deployment. Three variables are now set, OPENAI_BASE_URL, OPENAI_API_KEY and BOTHOSTING_AI_MODEL.
  4. Use the official OpenAI library. It reads the address and the key on its own. Only the model name changes.

The full reference, with every error code, is in the AI API docs.

Why the OpenAI library works for Claude and Gemini

The OpenAI chat completions format has become the common language of AI APIs. A request is a list of messages and a model name, and the answer comes back in the same shape whatever the model.

Bot-Hosting AI speaks that format at https://bot-hosting.net/api/ai/v1. Your code sends model: "claude-sonnet-5.5" or model: "gemini-3.8-flash" to the same address, with the same key, and gets the same response object back. Switching models is a one-word change, not a new SDK.

Node.js

npm install openai
import OpenAI from "openai";

// OPENAI_BASE_URL and OPENAI_API_KEY come from the deployment's variables.
const ai = new OpenAI({ timeout: 60_000, maxRetries: 2 });

const answer = await ai.chat.completions.create({
  model: process.env.BOTHOSTING_AI_MODEL, // gpt-6-luna by default
  messages: [
    { role: "system", content: "You summarise text in three bullet points." },
    { role: "user", content: "Paste a long article here." },
  ],
});

console.log(answer.choices[0].message.content);

Python

pip install openai
import os
from openai import OpenAI

ai = OpenAI(timeout=60, max_retries=2)

answer = ai.chat.completions.create(
    model=os.environ["BOTHOSTING_AI_MODEL"],
    messages=[
        {"role": "system", "content": "You summarise text in three bullet points."},
        {"role": "user", "content": "Paste a long article here."},
    ],
)

print(answer.choices[0].message.content)

To use Claude instead, change one line, model="claude-haiku-5.5". Nothing else moves.

Stream the answer

For a chat page or any long answer, stream it. People see the first words at once.

const stream = await ai.chat.completions.create({
  model: "claude-haiku-5.5",
  messages: [{ role: "user", content: "Explain DNS to a beginner." }],
  stream: true,
});

for await (const chunk of stream) {
  process.stdout.write(chunk.choices[0]?.delta?.content ?? "");
}

Let the model call your code

Tool calling lets the model ask your app for data, then answer with it. Here the model looks up an order before it replies.

const tools = [{
  type: "function",
  function: {
    name: "get_order_status",
    description: "Returns the delivery status of an order",
    parameters: { type: "object", properties: { id: { type: "string" } }, required: ["id"] },
  },
}];
const messages = [{ role: "user", content: "Where is order 1042?" }];

const first = await ai.chat.completions.create({ model: "gpt-6-luna", messages, tools });
const reply = first.choices[0].message;

if (reply.tool_calls) {
  messages.push(reply);
  for (const call of reply.tool_calls) {
    const { id } = JSON.parse(call.function.arguments);
    messages.push({ role: "tool", tool_call_id: call.id, content: JSON.stringify(await getOrderStatus(id)) });
  }
  const final = await ai.chat.completions.create({ model: "gpt-6-luna", messages, tools });
  console.log(final.choices[0].message.content);
}

The twelve recommended models, from GPT-6 Luna to Claude Sonnet 5.5, all passed a tool-calling test before we listed them.

Example, an AI endpoint in a web app

A small Express API that summarises whatever text it receives. Deploy it as a Node.js app and turn on AI.

import express from "express";
import OpenAI from "openai";

const ai = new OpenAI({ timeout: 60_000 });
const app = express();
app.use(express.json({ limit: "200kb" }));

app.post("/summarize", async (req, res) => {
  try {
    const answer = await ai.chat.completions.create({
      model: process.env.BOTHOSTING_AI_MODEL,
      messages: [
        { role: "system", content: "Summarise in three short sentences." },
        { role: "user", content: String(req.body.text ?? "").slice(0, 20_000) },
      ],
    });
    res.json({ summary: answer.choices[0].message.content });
  } catch (error) {
    res.status(error.status === 402 ? 503 : 500).json({ error: "AI is not available right now" });
  }
});

app.listen(process.env.SERVER_PORT ?? 3000);

Example, a Discord bot that answers questions

The same API works in a bot. This discord.js v14 bot answers an /ask command. Register the command with a string option named question, as in our discord.js hosting guide, and put the bot token in DISCORD_TOKEN.

import { Client, GatewayIntentBits } from "discord.js";
import OpenAI from "openai";

const ai = new OpenAI({ timeout: 60_000 });
const client = new Client({ intents: [GatewayIntentBits.Guilds] });

client.on("interactionCreate", async (interaction) => {
  if (!interaction.isChatInputCommand() || interaction.commandName !== "ask") return;
  await interaction.deferReply();
  try {
    const answer = await ai.chat.completions.create({
      model: process.env.BOTHOSTING_AI_MODEL,
      messages: [
        { role: "system", content: "You answer in under 1,500 characters." },
        { role: "user", content: interaction.options.getString("question", true) },
      ],
    });
    await interaction.editReply(answer.choices[0].message.content.slice(0, 2000));
  } catch (error) {
    await interaction.editReply(error.status === 402 ? "AI is paused for now." : "Something went wrong.");
  }
});

client.login(process.env.DISCORD_TOKEN);

What it costs, in euros

You pay per use with AI Tokens, the same balance Ask AI and Studio use. There is no subscription and packs never expire. The smallest pack is Starter, 2.99 EUR for 2,000,000 AI Tokens before tax, and larger packs cost less per token.

The figures below use the Starter pack, the most expensive per token. A short message is 500 tokens in and 150 tokens out, a typical chat reply.

ModelMakerInput, per million tokensOutput, per million tokensShort messages for 1 EUR
GPT-6 LunaOpenAI0.17 EUR0.66 EURabout 5,500
Claude Haiku 5.5Anthropic0.17 EUR0.66 EURabout 5,500
GLM 5.3 FlashZ.AI0.40 EUR1.32 EURabout 2,500
DeepSeek V4.1 FlashDeepSeek0.40 EUR1.59 EURabout 2,300
Gemini 3.8 FlashGoogle0.99 EUR4.96 EURabout 810
Grok 4.7xAI2.64 EUR7.94 EURabout 400
Claude Sonnet 5.5Anthropic3.31 EUR13.22 EURabout 270
GPT-6.2 SolOpenAI3.31 EUR13.22 EURabout 270

So the cheapest way to call GPT or Claude from your code here is GPT-6 Luna or Claude Haiku 5.5. One euro covers about 5,500 short replies, and both handle tools well. Keep Claude Sonnet 5.5 or GPT-6.2 Sol for the questions that need them, by passing their id on those requests only.

Each request is charged from what it really cost to run, and the AI tab shows what each day and each model used. The full table of the twelve recommended models is in the docs.

Keep the bill under control

  • Every deployment has a monthly limit, 5,000,000 AI Tokens by default. You get a notification at 50%, 75% and 90%, and the deployment stops using AI at the limit. A loop in your code cannot drain your balance.
  • Only purchased AI Tokens are used. The free weekly allowance you use in the panel is never spent by your apps.
  • An empty balance does not crash anything. Requests get a 402 error and nothing is charged. Catch it, as in the examples above, and your app keeps running.

Questions

Can I use the Claude API without an Anthropic account? Yes. Turn on AI in a deployment and call claude-haiku-5.5 or claude-sonnet-5.5 with the OpenAI library. Usage is paid from your AI Tokens.

Do I have to change my code if it already uses OpenAI? Only the model name. The library reads OPENAI_BASE_URL and OPENAI_API_KEY from the environment. If your deployment already had its own OpenAI variables, Bot-Hosting leaves them untouched and writes BOTHOSTING_AI_BASE_URL and BOTHOSTING_AI_API_KEY instead.

Which models can I use? More than 360 chat models. Twelve are recommended and tested with tools, the others are listed with a search field in the AI tab and by GET /v1/models.

Does it work outside Bot-Hosting? The key is made for the deployment it belongs to. Call the API from the app you host here.

Is there a free tier? The AI API uses purchased AI Tokens only. Hosting the app itself can be free, see the pricing page.

Try it

Open any deployment, select AI, then Turn on AI. Or read how the AI API fits into your hosting first.