← All applications · Connect apps section on /docs
Anthropic + OpenAIManual setup
Node.js
Node.js: set the base URL and API key in integration code.
Published instructions · App version: unverified
Chat, ping, invoke and content-generation examples may send real billable requests. Check the model, balance, rate and minimum before running them. GET /v1/models checks authentication and the catalogue only. Set up environment variables safely
Base URL to paste
OpenAI SDKs generally use a URL ending in /v1; Anthropic SDKs use the root URL. Avoid adding /v1 twice. Protocol compatibility does not guarantee every provider feature.
https://thapi.cloudPrerequisites
- Node.js 22 or later; Node.js 24 LTS recommended
- npm i @anthropic-ai/sdk openai
Recommended model: claude-fable-5
Quick way — command / config
import Anthropic from "@anthropic-ai/sdk";
const client = new Anthropic({
apiKey: process.env.STALI_API_KEY,
baseURL: "https://thapi.cloud",
});
const msg = await client.messages.create({
model: "claude-fable-5",
max_tokens: 1024,
messages: [{ role: "user", content: "Hello!" }],
});
console.log(msg.content[0].text);Where to place file / fill Settings
Environment variableany
STALI_API_KEY
Set STALI_API_KEY in the Node.js process environment as shown in Quickstart. node script.mjs does not load .env automatically; if using .env, load it explicitly with dotenv before creating the client. Do not commit the key to Git.
Verify connection
- node script.mjs
Troubleshooting
| Symptom | Reason | How to handle |
|---|---|---|
| 401 | Environment variables have not loaded. | Use dotenv or export the variables before running. |