Connect GPT, Claude, Gemini & Video APIs in n8n, Make & Telegram Bots

Configure self-hosted n8n, Make.com and Python aiogram Telegram bots to call GPT-6.2 (from ¥0.32/1M CNY), Claude Sonnet 5.5, Gemini and Seedance video APIs on one balance.

Updated 3 min read

On this page(5)
  1. Recommended Models by Workflow Step
  2. 1. Configure n8n OpenAI Credentials & AI Agent Nodes
  3. 2. Native Claude /v1/messages & Async Video /v1/videos in n8n
  4. 3. Minimal Python Telegram Bot (aiogram 3.x + AsyncOpenAI)
  5. Troubleshooting

When deploying self-hosted n8n in Docker, building Make.com scenarios, or running Python Telegram bots, managing separate billing accounts, regional API restrictions, and rate limits across OpenAI, Anthropic, Google, and video vendors quickly becomes operational overhead. Pointing your credentials to Brioi (https://vip.brioi.com/v1) lets every workflow node draw from a single USDT- or card-funded balance—covering LLMs, image generation, and async video APIs with per-workflow spending caps.

Endpoint paths verified against the Brioi API Docs and n8n OpenAI credential settings (2026-12); starting model prices fetched 2026-12-04 from the pricing page.

All models below share the same account balance (token-billed LLM prices vary by route; lowest standard route shown):

Automation step Model ID Endpoint Brioi rate (CNY)
High-volume ticket triage & routing gemini-3.8-flash /v1beta or /v1/chat/completions From ¥0.60/1M in · ¥3.00/1M out
Multi-step AI Agents & tool calling gpt-6.2-sol /v1/chat/completions or /v1/responses From ¥0.32/1M in · ¥1.60/1M out
Long document parsing & code/contract review claude-sonnet-5-5 /v1/messages From ¥0.20/1M in · ¥1.00/1M out
Automated e-commerce product visuals gpt-image-2 /v1/images/async/generations ¥0.05 / image
Short product videos & social reels seedance-2-0-mini /v1/videos ¥0.141/s (¥0.702 for 5s)

1. Configure n8n OpenAI Credentials & AI Agent Nodes

First, create a dedicated key on the Brioi API keys page and assign a quota cap so runaway webhook loops cannot drain your main balance:

  1. In n8n, open Credentials → Add Credential and select OpenAI API.
  2. Paste your Brioi key into API Key.
  3. Set Base URL to https://vip.brioi.com/v1 (include /v1 once, with no trailing slash).
  4. Click Save — n8n queries GET /v1/models and confirms Connection tested successfully.

Inside an AI Agent or Basic LLM Chain node using the OpenAI Chat Model sub-node, switch the Model field to Expression mode and enter gpt-6.2-sol (or any model returned by GET /v1/models).

2. Native Claude /v1/messages & Async Video /v1/videos in n8n

For native Anthropic prompt caching or automated video rendering, use n8n’s built-in HTTP Request node:

Native Anthropic /v1/messages

  • Method: POST
  • URL: https://vip.brioi.com/v1/messages
  • Headers: x-api-key: YOUR_API_KEY, anthropic-version: 2023-06-01, Content-Type: application/json
  • JSON Body:
{
  "model": "claude-sonnet-5-5",
  "max_tokens": 1024,
  "messages": [
    {"role": "user", "content": "Extract sentiment, issue category, and reply draft as JSON: $json.review"}
  ]
}

Async Video Pipeline (Submit → Wait → Poll)

Chain three nodes to generate product or social videos without HTTP timeouts:

  1. HTTP Request (Create Task): POST https://vip.brioi.com/v1/videos with Authorization: Bearer YOUR_API_KEY and JSON body {"model": "seedance-2-0-mini", "prompt": "...", "duration": 5}. Capture the returned id.
  2. Wait Node: Pause 15 seconds.
  3. HTTP Request (Poll Status) + IF Node: GET https://vip.brioi.com/v1/videos/$json.id. Branch on status: when completed, download metadata.url immediately; when queued or in_progress, loop back to the Wait node (never re-POST the creation request on poll retries).

In Make.com, use the HTTP → Make a request module with the exact same URLs and headers.

3. Minimal Python Telegram Bot (aiogram 3.x + AsyncOpenAI)

Use AsyncOpenAI so concurrent Telegram messages never block the event loop:

pip install aiogram openai
export BOT_TOKEN="your_telegram_bot_token"
export BRIOI_API_KEY="your_brioi_api_key"
import asyncio
import os
from aiogram import Bot, Dispatcher, types
from openai import AsyncOpenAI

bot = Bot(token=os.environ["BOT_TOKEN"])
dp = Dispatcher()
ai = AsyncOpenAI(
    api_key=os.environ["BRIOI_API_KEY"],
    base_url="https://vip.brioi.com/v1",
)

@dp.message()
async def reply(msg: types.Message) -> None:
    if not msg.text:
        return
    resp = await ai.chat.completions.create(
        model="gpt-6.2-sol",
        messages=[
            {"role": "system", "content": "You are a concise, accurate assistant."},
            {"role": "user", "content": msg.text},
        ],
    )
    await msg.answer(resp.choices[0].message.content or "")

if __name__ == "__main__":
    asyncio.run(dp.start_polling(bot))

Troubleshooting

  • 404 Invalid URL (POST /v1/v1/chat/completions): Remove the duplicate /v1 — Base URL must be https://vip.brioi.com/v1.
  • 503 model_not_found: Check GET /v1/models to verify the exact model ID enabled for your key’s group.

For protocol-specific options, see OpenAI API access, Claude API access, Gemini API access and the video generation API page.