Tools
OpenAI-compatible integration
Most clients that support a custom OpenAI Base URL can use 678API directly.
General configuration
Base URL
https://www.678api.com/v1API Key
YOUR_API_KEYChat Endpoint
/chat/completionsNode.js example
import OpenAI from "openai";
const client = new OpenAI({
apiKey: process.env.API678_API_KEY,
baseURL: "https://www.678api.com/v1",
defaultHeaders: { "User-Agent": "678API-Node/1.0" },
});
const res = await client.chat.completions.create({
model: "gpt-5.5",
messages: [{ role: "user", content: "Hello 678API" }],
});Python example
from openai import OpenAI
client = OpenAI(
api_key="YOUR_API_KEY",
base_url="https://www.678api.com/v1",
default_headers={"User-Agent": "678API-Python/1.0"},
)
resp = client.chat.completions.create(
model="gpt-5.5",
messages=[{"role": "user", "content": "Hello 678API"}],
)
print(resp.choices[0].message.content)If you see Your request was blocked
The request was blocked by an edge security rule, not by Python syntax. Keep the custom User-Agent shown in the example. The Python SDK uses default_headers, while the Node.js SDK uses defaultHeaders.