API Reference
OpenAI-compatible. Point any official SDK at the base URL below and use your TokenForge key.
Base URL https://api.tokenforge.dev/v1
Auth Authorization: Bearer sk-live-...
Quickstart
from openai import OpenAI
client = OpenAI(
base_url="https://api.tokenforge.dev/v1",
api_key="sk-live-...",
)
stream = client.chat.completions.create(
model="deepseek-chat",
messages=[{"role": "user", "content": "Explain vector search in 2 sentences."}],
stream=True,
)
for chunk in stream:
print(chunk.choices[0].delta.content or "", end="")POST /v1/chat/completions
GET /v1/models
Returns every model available to your account, with context length and per-million pricing.
Errors
Rate limits
Limits apply per key. Default is 60 requests per minute; higher limits on request. Responses include Retry-After on 429. Token-per-minute limits follow upstream capacity and scale with your account tier.
Streaming
Set stream: true to receive server-sent events. Chunks follow the OpenAI format and terminate with data: [DONE]. Usage is reported in the final chunk and is what your balance is charged against.