STEP 01
Create an account
Register at the TokenRoc console and sign in.
API documentation / Quickstart
TokenRoc exposes an OpenAI-compatible API. Keep the SDK and request format you already use, then replace the API key and base URL.
https://api.tokenroc.com/v101 / Setup
Create an account, generate a key, and choose a model from the live pricing catalog. Never expose an API key in browser or mobile client code.
STEP 01
Register at the TokenRoc console and sign in.
STEP 02
Open API Keys, create a token, and store it in a server-side secret.
STEP 03
Use the exact identifier shown in the live model catalog.
02 / cURL
Set your key as an environment variable and send the same JSON shape used by OpenAI-compatible clients.
curl https://api.tokenroc.com/v1/chat/completions \
-H "Authorization: Bearer $TOKENROC_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "deepseek-v3.2",
"messages": [
{"role": "user", "content": "Say hello in one sentence."}
]
}'03 / Python
Only the credentials and base URL are TokenRoc-specific. The client call remains OpenAI-compatible.
import os
from openai import OpenAI
client = OpenAI(
api_key=os.environ["TOKENROC_API_KEY"],
base_url="https://api.tokenroc.com/v1",
)
response = client.chat.completions.create(
model="deepseek-v3.2",
messages=[{"role": "user", "content": "Say hello in one sentence."}],
)
print(response.choices[0].message.content)04 / Reference
Support varies by model and upstream provider. Start with the model catalog, then use the endpoint supported by that model.
| Method | Endpoint | Purpose |
|---|---|---|
| GET | /v1/models | List models available to the current API key. |
| POST | /v1/chat/completions | Create a standard or streaming chat completion. |
| POST | /v1/responses | Use the Responses-compatible request format where supported. |
05 / Troubleshooting
| Status | Meaning | What to check |
|---|---|---|
| 401 | Authentication failed | Confirm the Bearer token is present, active, and copied without spaces. |
| 403 | Access or balance rejected | Check wallet balance, key permissions, and model access. |
| 429 | Rate or quota limit | Reduce concurrency, apply backoff, or review token limits. |
| 5xx | Gateway or upstream failure | Retry with exponential backoff and check the status page. |
06 / Next