Before you start
TokenRaft supports plain-text GPT Chat Completions and streaming for funded accounts. Model prices and wallet balances are in USD. Online payments are not yet enabled; contact the operator to arrange funding. Use a model from the live catalog. Image input, tools, audio, Responses and compact-response endpoints are not supported in this release.
1. Create a project API key
Open the console and create an account or sign in. Go to API Keys, create a named key for your project, and choose its quota and access settings. Use a separate key for each application so you can disable one integration without changing the others.
Keep the key in a server environment variable or secret store. Do not put it into a public repository, a browser bundle, or a screenshot. Your account password and your project's API key serve different purposes.
Open API Keys2. Copy the API base URL
The console's Overview page shows the API base URL. Set TOKENRAFT_BASE_URL to that exact address, including its /v1 suffix. Set TOKENRAFT_API_KEY to your project's key on your server.
For an OpenAI-compatible client, the base URL and API key are separate configuration values. Use the TokenRaft API key with the TokenRaft base URL. A ChatGPT subscription does not supply credit for this account.
3. Select a model and prepare a request
Choose an enabled model ID from the live catalog and review its rates. This example uses gpt-6-luna; set a small completion-token limit for your first request.
curl "$TOKENRAFT_BASE_URL/chat/completions" \
-H "Authorization: Bearer $TOKENRAFT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-6-luna",
"max_completion_tokens": 128,
"messages": [
{"role": "user", "content": "Hello!"}
]
}'This example uses the Chat Completions request shape. Feature support, streaming behavior, and available endpoint formats must be checked for the selected model and channel before production use.
4. Inspect usage before scaling up
Start with a small request after your account is funded. Compare the response's usage information with the matching record in the console. Review input, cached input, output token quantities and the recorded USD charge. The upstream may add its own prompt tokens; the response usage and your history include those tokens. A conservative reservation is made before forwarding and unused funds are released on verified settlement.
A GPT token count is useful for planning prompt size. It does not include every part of a real API request or predict the exact amount of generated output. Set an appropriate output limit using the parameter supported by your selected model.
Common integration checks
| Symptom | What to check |
|---|---|
| Authentication rejected | The key is active, belongs to this service, and is sent as a Bearer token. |
| Model unavailable | The model ID matches an enabled model and the key has access. |
| Quota or balance error | Both the account balance and the key's quota permit the request. |
| Rate limit or timeout | Check the returned error before retrying. Use bounded retries and avoid assuming a timed-out request was free. |
This guide describes the current New API-based console. Live text relay and USD usage billing are enabled. Online payment settlement remains unavailable.
Back to TokenRaft