APIMaster.ai

OpenAI Compatible API — Python & Node.js Integration Guide

How to use the OpenAI Python SDK or Node.js client with APIMaster.ai's OpenAI-compatible API. Set base_url and api_key to call GPT-5.4, Claude, or DeepSeek models at up to 70% off official pricing.

OpenAI-compatible integration

APIMaster exposes OpenAI-style REST at https://apimaster.ai/v1 for GPT models and Claude ids routed through the OpenAI format.

Python

from openai import OpenAI

client = OpenAI(
    api_key="YOUR_API_KEY",
    base_url="https://apimaster.ai/v1",
)

resp = client.chat.completions.create(
    model="gpt-5.4",
    messages=[{"role": "user", "content": "Hello"}],
)
print(resp.choices[0].message.content)

Node.js

import OpenAI from "openai";

const client = new OpenAI({
  apiKey: process.env.APMASTER_API_KEY,
  baseURL: "https://apimaster.ai/v1",
});

const completion = await client.chat.completions.create({
  model: "claude-sonnet-4-6",
  messages: [{ role: "user", content: "Hello" }],
});

Environment variables

export OPENAI_API_KEY="YOUR_API_KEY"
export OPENAI_BASE_URL="https://apimaster.ai/v1"

Streaming

Set "stream": true and parse SSE data: {...} lines like the OpenAI API.

Model ids

Use slugs from Supported models (e.g. claude-sonnet-4-6). Do not pass marketplace channel numbers (e.g. “Channel 02”) as the model field.