Quick Start
Learn to use the NodeKey API in just a few minutes
Step 1: Obtain API Key
Register on the NodeKey console and generate your unique API key (token).
Step 2: Integration
If you are already using the OpenAI SDK, simply change the base URL.
from openai import OpenAI
client = OpenAI(
api_key="YOUR_NODEKEY_KEY",
base_url="https://nodekey.xinghanyun.cn/v1"
)
response = client.chat.completions.create(
model="gpt-4o",
messages=[{"role": "user", "content": "Hello!"}]
)import OpenAI from "openai";
const client = new OpenAI({
apiKey: "YOUR_NODEKEY_KEY",
baseURL: "https://nodekey.xinghanyun.cn/v1"
});
const completion = await client.chat.completions.create({
model: "gpt-4o",
messages: [{ role: "user", content: "Hello!" }],
});curl -X POST "https://nodekey.xinghanyun.cn/v1/chat/completions" \
-H "Authorization: Bearer YOUR_NODEKEY_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-4o",
"messages": [
{
"role": "user",
"content": "Hello!"
}
]
}'Last updated on