Skip to content

Quick Start

Sign up at api.tokensupernova.com. After registration, copy your API key from the console. It looks like tsn_live_xxxxx.

TokenSupernova is fully compatible with the standard OpenAI SDK. Install it in your language of choice:

:::tab Python

Terminal window
pip install openai

:::tab Node.js

Terminal window
npm install openai

::: :::

:::tab Python

from openai import OpenAI
client = OpenAI(
api_key="tsn_live_xxx",
base_url="https://api.tokensupernova.com/v1",
)
response = client.chat.completions.create(
model="deepseek-chat",
messages=[
{"role": "user", "content": "Explain quantum computing in one sentence."}
],
)
print(response.choices[0].message.content)

:::tab Node.js

import OpenAI from "openai";
const client = new OpenAI({
apiKey: "tsn_live_xxx",
baseURL: "https://api.tokensupernova.com/v1",
});
const response = await client.chat.completions.create({
model: "deepseek-chat",
messages: [
{ role: "user", content: "Explain quantum computing in one sentence." }
],
});
console.log(response.choices[0].message.content);

::: :::tab curl

Terminal window
curl "https://api.tokensupernova.com/v1/chat/completions" \
-H "Authorization: Bearer tsn_live_xxx" \
-H "Content-Type: application/json" \
-d '{
"model": "deepseek-chat",
"messages": [{"role": "user", "content": "Explain quantum computing in one sentence."}]
}'

::: :::

That’s it. If you can use the OpenAI API, you can use TokenSupernova. No other changes needed.