Call GPT and Claude from your code with one API key: Python, Node.js and curl examples
AI Agents & Agentic Systems · November 13, 2026 · 2 min read

Call GPT and Claude from your code with one API key: Python, Node.js and curl examples

Call GPT and Claude from your code with one LaRouter API key: curl, Python and Node.js examples with the OpenAI SDK, the Anthropic SDK, and notes for production.

LP
LaPage Digital
Systems Editorial
Call GPT and Claude from your code with one API key: Python, Node.js and curl examples

If your app needs to call both GPT and Claude, LaRouter gives you one API address and one key that work for both. Code written for the OpenAI SDK only needs a new base_url and key, and to switch models you change the model name. You pay by VND bank transfer, and businesses get a VAT invoice.

▶ Watch the setup video (about 2 minutes, in Vietnamese): youtu.be/ILiPv5mHZQ0

One endpoint for GPT and Claude

Connection details

  • Base URL: https://i-larouter.lapage.vn/v1
  • API key: get it in the dashboard at larouter.lapage.vn
  • Models: for example claude-sonnet-5-5, claude-haiku-5-5, claude-opus-5-5, gpt-6.1-sol. For the full list, call GET /v1/models.

Put the key in an environment variable instead of writing it into your code:

export LAROUTER_KEY='YOUR_KEY'

curl

curl https://i-larouter.lapage.vn/v1/chat/completions \
  -H "Authorization: Bearer $LAROUTER_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"claude-haiku-5-5","messages":[{"role":"user","content":"Xin chào"}]}'

Python (OpenAI SDK)

import os
from openai import OpenAI

client = OpenAI(base_url="https://i-larouter.lapage.vn/v1", api_key=os.environ["LAROUTER_KEY"])

r = client.chat.completions.create(
    model="claude-sonnet-5-5",
    messages=[{"role": "user", "content": "Viết 3 tiêu đề cho bài về quản lý kho"}],
)
print(r.choices[0].message.content)

Change to model="gpt-6.1-sol" to call GPT; nothing else needs to change.

Node.js (OpenAI SDK)

import OpenAI from "openai";

const client = new OpenAI({ baseURL: "https://i-larouter.lapage.vn/v1", apiKey: process.env.LAROUTER_KEY });

const r = await client.chat.completions.create({
  model: "claude-haiku-5-5",
  messages: [{ role: "user", content: "Phân loại email này: khiếu nại, hỏi giá hay khác?" }],
});
console.log(r.choices[0].message.content);

Using the Anthropic SDK

If your code already uses the Anthropic SDK, set base_url to https://i-larouter.lapage.vn/v1 and use your LaRouter key; the /v1/messages endpoint works as usual.

Plans and pricing

  • ChatGPT and Claude in one plan, from just 300,000 VND/month (plan T150: $150 of usage per week, reset every 7 days). Each $150 a week is about the size of one Claude Pro or Codex account.
  • Six tiers from T150 to T1500 (3,000,000 VND/month, about 10 accounts). Upgrade when you need more; the extra capacity is available as soon as payment is confirmed.
  • Annual plan: pay for 12 months, use 13.
  • Pay in VND by bank transfer (VietQR). Prices exclude VAT; companies choose "VAT invoice for a company" at checkout and pay 10% VAT on top.

See the plans at larouter.lapage.vn.

Notes for production

  • One key for the whole team: the key belongs to the workspace, and team members share the same weekly limit. Check usage in the dashboard.
  • Handle usage-limit errors: when the weekly limit is used up, the API returns an error. Catch it and tell the user instead of retrying in a loop.
  • Protect your key: call the API from your server only; never put the key in browser code or a mobile app.

Detailed endpoint documentation is on the LaRouter API page.

LP

LaPage Digital

LaPage Digital publishes systems-focused writing on architecture, automation, infrastructure, and operational delivery.

Editorial subscription

Stay Updated

Subscribe to our newsletter to receive technical insights and updates on best practices for web development and hosting infrastructure.

We respect your privacy. Unsubscribe at any time.

Call: +84 981 690 658
Message us on Facebook
Zalo
Contact us on Zalo
Message us on WhatsApp
Contact us