TokensClub documentation

API reference and examples

Choose a protocol supported by your model and channel. The examples below use complete request URLs; console pages are not API endpoints.

ProtocolFull endpoint
Chat CompletionsPOST /v1/chat/completions
ResponsesPOST /v1/responses
Anthropic MessagesPOST /v1/messages

Chat Completions

curl https://tokensclub.top/v1/chat/completions \
  -H "Authorization: Bearer $TOKENSCLUB_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"YOUR_ENABLED_MODEL","messages":[{"role":"user","content":"Reply only OK"}]}' 

Responses

curl https://tokensclub.top/v1/responses \
  -H "Authorization: Bearer $TOKENSCLUB_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "YOUR_ENABLED_MODEL",
    "input": "Hello, TokensClub."
  }'

Image generation (1K)

GPT image models have been tested with the size=1024x1024 (1K) request setting and are charged per successfully returned image. Actual output dimensions may differ; inspect the image if exact dimensions are required. Use a GPT-group API key. Other size or quality settings have not been verified.

curl https://tokensclub.top/v1/images/generations   -H "Authorization: Bearer $TOKENSCLUB_API_KEY"   -H "Content-Type: application/json"   -d '{"model":"gpt-image-1","prompt":"A blue circle on white","n":1,"size":"1024x1024"}'

Image generation API

Create a TokensClub API key in the image generation group. Use https://tokensclub.top/v1 as the Base URL, POST /v1/images/generations for generation and POST /v1/images/edits for reference editing. Supply the exact model ID from the price table.

Create a TokensClub API key · View models, prices and reference limits

gpt-image-2.6 passed paid generation, multi-reference editing and settlement acceptance. Other models have isolated billing verification only. Check usage before resubmitting a timeout or unconfirmed result; do not retry automatically.

Supply a size from the table below. The requested size selects the billing tier; returned pixels do not change it. n must be an integer from 1 to 15 and defaults to 1. Use non-streaming requests, automatic quality and PNG output. response_format may be url or b64_json. Unsupported parameters are explicitly rejected.

Sizes for the other image models

Aspect ratio1K2K4K
1:11024x10242048x20483840x3840
16:91280x7202560x14403840x2160
9:16720x12801440x25602160x3840
3:21536x10243072x20483840x2560
2:31024x15362048x30722560x3840
4:31344x10082688x20163840x2880
3:41008x13442016x26882880x3840
5:41280x10242560x20483840x3072
4:51024x12802048x25603072x3840
21:91792x7683136x13444032x1728

Model limits still apply: -fb models support 1:1, 4:3, 3:4, 2:3, 9:16 and 16:9 at 1K, only 16:9 at 2K / 4K, and no reference edits. Lite supports only 1K; Firefly has no 4K tier.

curl https://tokensclub.top/v1/images/generations \
  -H "Authorization: Bearer $TOKENSCLUB_API_KEY" \
  -H "Content-Type: application/json" \
  --data '{"model": "gpt-image-2", "prompt": "A blue circle on white", "size": "1024x1024", "n": 1, "quality": "auto"}'

Reference edits use multipart/form-data with PNG, JPEG or WebP files in image or image[]. Follow the model reference limit; the complete request must be at most 64 MiB.

curl https://tokensclub.top/v1/images/edits \
  -H "Authorization: Bearer $TOKENSCLUB_API_KEY" \
  -F model=gpt-image-2 \
  -F prompt="Use a clean studio background" \
  -F size=2048x2048 \
  -F n=1 \
  -F "image=@/absolute/path/reference.png"

gpt-image-2.6

Only the sizes listed below are supported. Billing follows the TokensClub size tier and successful image count. The 4K square is 4096×4096. Reference editing accepts up to 5 images per request.

TierAspect ratiosize
1K1:11024x1024
1K3:21536x1024
1K2:31024x1536
1K3:41008x1344
1K9:16720x1280
1K16:91280x720
2K1:12048x2048
2K16:92560x1440
4K1:14096x4096
4K16:93840x2160
curl https://tokensclub.top/v1/images/generations \
  -H "Authorization: Bearer $TOKENSCLUB_API_KEY" \
  -H "Content-Type: application/json" \
  --data '{"model": "gpt-image-2.6", "prompt": "A red cube on a white table", "size": "1024x1024", "n": 1, "quality": "auto", "output_format": "png"}'
curl https://tokensclub.top/v1/images/edits \
  -H "Authorization: Bearer $TOKENSCLUB_API_KEY" \
  -F model=gpt-image-2.6 \
  -F prompt="make the cube blue" \
  -F size=1024x1024 \
  -F n=1 \
  -F quality=auto \
  -F output_format=png \
  -F "image=@/absolute/path/reference.png"

JavaScript: server-side request

const response = await fetch("https://tokensclub.top/v1/responses", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.TOKENSCLUB_API_KEY}`,
    "Content-Type": "application/json"
  },
  body: JSON.stringify({ model: "YOUR_ENABLED_MODEL", input: "Reply only OK" })
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
console.log(await response.json());

Streaming & retries

For streaming, pass stream: true and parse incremental events with an SSE parser. After a disconnect or timeout, check usage before retrying; a retry may incur a separate charge.

Support for images, tools, caching and long contexts depends on the model and channel. A successful text request does not verify these features.

Updated: 2026-10-25 · Features depend on the active platform configuration