Quick Start

Connect to BulkToken with the OpenAI SDK or a simple HTTP request. One API key, a familiar protocol, and your choice of model.

POST /v1/chat/completions

1. Create a key and add credits

Create an account or sign in, then open API Keys to create a key. Check that your account has available credits, and that the key is enabled, has not expired, and allows the model you want to use.

Keep the key on your server. Set it as an environment variable in the terminal that will run your request.

Environment

export BULKTOKEN_API_KEY="YOUR_BULKTOKEN_API_KEY"

2. Set up your client

cURL is enough for an HTTP request. For Python or Node.js, install the official OpenAI SDK. The examples below run on your server or in a local terminal.

Install with pip

pip install openai

Install with npm

npm install openai

SDK base URL: https://bulktoken.ai/v1. SDK methods add /chat/completions for you; do not append /v1 twice.

3. Send a request

This example uses GLM-5.3 and streams the answer to your terminal. To use a different model, copy its exact ID from Model guides.

curl -N https://bulktoken.ai/v1/chat/completions \
  -H "Authorization: Bearer $BULKTOKEN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "glm-5.3",
  "messages": [
    {
      "role": "user",
      "content": "Explain how a hash table works in three sentences."
    }
  ],
  "stream": true
}'
import os
from openai import OpenAI

client = OpenAI(
    api_key=os.environ["BULKTOKEN_API_KEY"],
    base_url="https://bulktoken.ai/v1",
    timeout=120.0,
)

stream = client.chat.completions.create(
    model="glm-5.3",
    messages=[{"role": "user", "content": "Explain how a hash table works in three sentences."}],
    stream=True,
)
for chunk in stream:
    if chunk.choices and chunk.choices[0].delta.content:
        print(chunk.choices[0].delta.content, end="", flush=True)
import OpenAI from "openai";

const client = new OpenAI({
  apiKey: process.env.BULKTOKEN_API_KEY,
  baseURL: "https://bulktoken.ai/v1",
  timeout: 120_000,
});

const stream = await client.chat.completions.create({
  model: "glm-5.3",
  messages: [{ role: "user", content: "Explain how a hash table works in three sentences." }],
  stream: true,
});
for await (const chunk of stream) {
  process.stdout.write(chunk.choices[0]?.delta?.content ?? "");
}

4. Read the answer and check usage

You should see answer text appear as it is generated. Reasoning models may take time before the first answer token. The SDK handles the Server-Sent Events (SSE) frames for you.

Open Usage Logs to review model, token usage, and charges. If the call fails, use the status and error message with the troubleshooting guide.

Creating an API key does not add account credits. A key with no individual spending limit still uses your account balance.

Build on your first request