Documentation
TextCLF implements the OpenAI API. If your code already talks to OpenAI, changing the base URL and the key is the entire integration — the request and response shapes match exactly, including streaming, tool calling, and the usage object.
https://api.textclf.com/v1Start here
Quickstart
Make your first request in Python, TypeScript, or curl.
Authentication
Create API keys, keep them secret, and rotate them.
Endpoints
The chat completions endpoint and its response shape.
Billing & credit
Prepaid credit, per-token pricing, and auto-refill.
Quickstart
Create an API key in your dashboard, then make a request. Every new account starts with $5 in free credit, so you can run this immediately.
curl https://api.textclf.com/v1/chat/completions \
-H "Authorization: Bearer $TEXTCLF_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "meta-llama/Llama-3.1-8B-Instruct",
"messages": [{ "role": "user", "content": "Hello" }]
}'from openai import OpenAI
client = OpenAI(
base_url="https://api.textclf.com/v1",
api_key="YOUR_TEXTCLF_API_KEY",
)
resp = client.chat.completions.create(
model="meta-llama/Llama-3.1-8B-Instruct",
messages=[{"role": "user", "content": "Hello"}],
)
print(resp.choices[0].message.content)import OpenAI from "openai"
const client = new OpenAI({
baseURL: "https://api.textclf.com/v1",
apiKey: process.env.TEXTCLF_API_KEY,
})
const resp = await client.chat.completions.create({
model: "meta-llama/Llama-3.1-8B-Instruct",
messages: [{ role: "user", content: "Hello" }],
})
console.log(resp.choices[0].message.content)OpenAI compatibility
Every model is served behind an OpenAI-compatible API (the same interface exposed by vllm serve), so anything that speaks the OpenAI protocol works by changing two settings: the base URL and the API key. No SDK forks, no request rewriting.
- OpenAI Python SDK
base_url= - OpenAI Node / TypeScript SDK
baseURL: - Vercel AI SDK (@ai-sdk/openai)
createOpenAI({ baseURL }) - LangChain (ChatOpenAI)
openai_api_base= - LlamaIndex (OpenAI)
api_base=
Standard sampling parameters pass straight through to vLLM — temperature, top_p, max_tokens, stop, stream, and tool/function calling on models that support it.
# TextCLF speaks the OpenAI protocol, so point any
# OpenAI-compatible client at the base URL and key.
# OpenAI Python / TypeScript SDK -> set base_url / baseURL
# LangChain (ChatOpenAI) -> set openai_api_base
# LlamaIndex (OpenAI) -> set api_base
# Vercel AI SDK (@ai-sdk/openai) -> createOpenAI({ baseURL })
from openai import OpenAI
client = OpenAI(base_url="https://api.textclf.com/v1", api_key="YOUR_TEXTCLF_API_KEY")Authentication
TextCLF keys begin with sk-tclf- and are passed as a bearer token on every request. Keys are shown once at creation — store them somewhere safe. You can create, name, and revoke keys at any time from the dashboard.
Authorization: Bearer sk-tclf-...Never expose a key in client-side code or commit it to version control. If a key leaks, revoke it — usage stops immediately.
Endpoints
The core endpoint is chat completions. It accepts the same parameters as OpenAI, so the official openai SDKs work without modification.
- POST
/v1/chat/completionsStreaming and non-streaming - GET
/v1/modelsList available models
Streaming
Set stream: true to receive server-sent events as tokens are generated. The final chunk carries the usage object, which is what we meter your credit against.
stream = client.chat.completions.create(
model="meta-llama/Llama-3.1-8B-Instruct",
messages=[{"role": "user", "content": "Hello"}],
stream=True,
)
for chunk in stream:
print(chunk.choices[0].delta.content or "", end="")Errors
Errors use standard HTTP status codes with an OpenAI-shaped JSON body.
- 400Malformed request or unknown model ID.
- 401Missing or invalid API key.
- 402Insufficient credit — top up to continue.
- 429Rate limit exceeded — retry with backoff.
- 503Model temporarily unavailable — try another model.
- 504Upstream gateway timed out.
Models
Pass any of the model IDs below in the model field. See the full model catalog for pricing, context windows, and latency.
meta-llama/Llama-3.3-70B-Instruct$0.08 / $0.30 per 1Mmeta-llama/Llama-3.1-8B-Instruct$0.018 / $0.038 per 1MQwen/Qwen3.8-27B$0.38 / $2.98 per 1M
Billing & credit
TextCLF is prepaid. You hold a credit balance and each request deducts its exact cost — prompt tokens times the model's input rate, plus completion tokens times its output rate. There are no subscriptions and credit never expires.
- Free credit. Every new account gets $5, no card required.
- Top up any time. Add credit from the billing page in preset or custom amounts.
- Auto-refill. Set a threshold and amount, and we top up from your saved card before you run dry.
Track balance, usage, and per-request cost in real time from your dashboard.
Open dashboard