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.
| Protocol | Full endpoint |
|---|---|
| Chat Completions | POST /v1/chat/completions |
| Responses | POST /v1/responses |
| Anthropic Messages | POST /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."
}'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.