Documentation
Quick Start
Token Factory serves an OpenAI-compatible API from self-hosted H100 hardware (3× H100 on a Jetstream2 ACCESS allocation through 2026-09-25; check the status page for current availability). If your tool speaks OpenAI, it already speaks Token Factory — point it at the base URL and go.
1. Get your API key
Create an account and generate a key from the dashboard. One click, no credit card during beta. During the private beta the API is served from our gateway endpoint below; the public endpoint ships with open beta.
2. First request
curl https://api.agent-next.com/v1/chat/completions \
-H "Authorization: Bearer $TOKEN_FACTORY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "orcarouter/Qwen3.8-27B-Uncensored-FP8",
"messages": [{"role": "user", "content": "Hello!"}]
}'
API Basics
- Base URL: OpenAI-compatible —
/v1/chat/completions,/v1/responses,/v1/models, streaming via"stream": true - Anthropic-compatible:
/v1/messages— authenticate withx-api-key: $TOKEN_FACTORY_API_KEY(orAuthorization: Bearer, never both with different values);anthropic-version/anthropic-betaheaders are forwarded upstream - Tool calling: native function calling; verified multi-tool chains at 100% accuracy
- Context: 131K tokens in, long generations out
- Concurrency: stable to 32 parallel requests per key at full quality; 64+ with graceful degradation
Claude Code
Claude Code can run against any OpenAI-compatible endpoint via the model provider configuration:
export ANTHROPIC_MODEL="orcarouter/Qwen3.8-27B-Uncensored-FP8" export OPENAI_BASE_URL="https://api.agent-next.com/v1" export OPENAI_API_KEY="$TOKEN_FACTORY_API_KEY"
We used this exact setup to run our own agent fleet on the factory — the dogs ate the dog food.
Coding Agents
Any OpenAI-compatible agent works by setting the base URL and key:
- Cursor: Settings → Models → Override OpenAI Base URL →
https://api.agent-next.com/v1 - Continue / Aider / Roo Code: set
apiBase/--openai-api-baseto the same URL - Custom agents: use the OpenAI SDK with
base_urloverridden
Python (OpenAI SDK)
from openai import OpenAI
client = OpenAI(
base_url="https://api.agent-next.com/v1",
api_key="$TOKEN_FACTORY_API_KEY",
)
resp = client.chat.completions.create(
model="orcarouter/Qwen3.8-27B-Uncensored-FP8",
messages=[{"role": "user", "content": "Write a haiku about GPUs."}],
)
print(resp.choices[0].message.content)
Available Models
| Model ID | Context | Best at | Served on |
|---|---|---|---|
| orcarouter/Qwen3.8-27B-Uncensored-FP8 | 131K | Coding, tool calling, fast loops | 2× H100 (load-balanced) |
| openai/gpt-oss-120b | 131K | Deep reasoning, analysis | 1× H100 (direct endpoint) |
Fleet layout above is as of the 2026-09-25 allocation end. Live health for each model is on the status page.
Limits & Fair Use
- Beta: was free while our ACCESS allocation lasted (the Jetstream2 allocation ended 2026-09-25). Rate limits may change without notice.
- Be kind: batch when you can, stream when latency matters.
- Abuse (scraping, mining, sustained max-load hammering) gets keys revoked.
Quick reference
- Base URL:
https://api.agent-next.com/v1 - Auth header:
Authorization: Bearer tfk-...— all keys start with thetfk-prefix - Model IDs:
orcarouter/Qwen3.8-27B-Uncensored-FP8(aliasqwen-27b),openai/gpt-oss-120b - Streaming: SSE — pass
"stream": trueon chat completions - Status: live model health at /status