PlatformAPI documentation

Developer docs

2. Quick start

Version 1.0 · 2026-10-20

← Back to the API reference

Three steps to your first request: get a key, set an environment variable, and send a request.

  1. Get a key: email info@powerchampion.org to apply. Keys start with sk-b300- and are issued by our team and sent to you. The platform stores only a hash, so a key cannot be recovered — keep it safe.
  2. Add credit: when you buy a credit pack you receive a redeem code. Apply it with POST /v1/redeem (see section 10).
  3. Set the environment variable:
bash
export PC_API_KEY="sk-b300-..."

curl

bash
curl https://b300.powerchampion.ai/v1/chat/completions \
  -H "Authorization: Bearer $PC_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "glm-5.2-fp8",
    "messages": [{"role": "user", "content": "Describe Taipei in one sentence."}],
    "max_tokens": 512
  }'

Python

Install: pip install openai.

python
import os
from openai import OpenAI

client = OpenAI(
    base_url="https://b300.powerchampion.ai/v1",
    api_key=os.environ["PC_API_KEY"],
)

resp = client.chat.completions.create(
    model="glm-5.2-fp8",
    messages=[{"role": "user", "content": "Describe Taipei in one sentence."}],
    max_tokens=512,
)
print(resp.choices[0].message.content)
print(resp.usage)

Node.js

Install: npm install openai. Requires Node.js 18 or later, running as ESM (a .mjs file, or "type": "module" in package.json).

javascript
import OpenAI from "openai";

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

const resp = await client.chat.completions.create({
  model: "glm-5.2-fp8",
  messages: [{ role: "user", content: "Describe Taipei in one sentence." }],
  max_tokens: 512,
});
console.log(resp.choices[0].message.content);

Successful response

json
{
  "id": "chatcmpl-...",
  "object": "chat.completion",
  "created": 1792483207,
  "model": "glm-5.2-fp8",
  "choices": [
    {
      "index": 0,
      "message": { "role": "assistant", "content": "Taipei is the capital of Taiwan, …" },
      "finish_reason": "stop"
    }
  ],
  "usage": { "prompt_tokens": 14, "completion_tokens": 27, "total_tokens": 41 }
}

A 502 means the model is temporarily offline. Check the service status and switch to a model whose ready is true.