IQx Token Factory API
A unified inference API for 33 open-source and frontier models — from lightweight LLMs to vision, code, reasoning, and embeddings. Switch the base URL in your existing OpenAI or Anthropic SDK and run on IQx Token Factory infrastructure. No new SDK to learn, no migration to plan.
Now serving both OpenAI and Anthropic endpoints
base_url in your existing OpenAI or Anthropic SDK and run on the same model pool, same pricing, same usage dashboard. No migration, no new client library to learn.OpenAI + Anthropic compatibility
Both API surfaces come from the same router. The two are not separate products — they're two doors into the same model pool, same pricing, same API key, same usage dashboard. Use whichever client your stack already speaks.
| Capability | OpenAI endpoint | Anthropic endpoint | Status |
|---|---|---|---|
| Chat / Messages | /openai/v1/chat/completions | /anthropic/v1/messages | Live |
| Streaming (SSE) | stream=true | stream=true | Live |
| Function calling | tools + tool_choice | tools + tool_use blocks | Live |
| JSON mode | response_format | tool use + schema | Live |
| Vision / Images | image_url content | image content blocks | Live |
| Batch | /v1/batches | /v1/messages/batches | Live |
| Embeddings | /openai/v1/embeddings | — (use OpenAI) | OpenAI only |
| Audio (ASR / TTS) | /openai/v1/audio/* | — (use OpenAI) | OpenAI only |
Base URLs
The same API key works for both. Pick the URL that matches your SDK.
https://api.IQXtokenfactory.com/openai/v1/https://api.IQXtokenfactory.com/anthropic/v1/Quick integration
Drop-in compatible with both SDKs. The base URL is the only thing that changes — the rest of your code stays the same.
from openai import OpenAI client = OpenAI( base_url="https://api.IQXtokenfactory.com/openai/v1/", api_key="tf-your-api-key-here",) response = client.chat.completions.create( model="meta-llama/Llama-3.3-70B-Instruct", messages=[{"role": "user", "content": "Hello!"}],) print(response.choices[0].message.content)import anthropic client = anthropic.Anthropic( base_url="https://api.IQXtokenfactory.com/anthropic/", api_key="tf-your-api-key-here",) message = client.messages.create( model="claude-3-5-sonnet-20241022", max_tokens=1024, messages=[{"role": "user", "content": "Explain quantum entanglement"}],) print(message.content[0].text)import OpenAI from "openai"; const client = new OpenAI({ baseURL: "https://api.IQXtokenfactory.com/openai/v1/", apiKey: "tf-your-api-key-here",}); const response = await client.chat.completions.create({ model: "meta-llama/Llama-3.3-70B-Instruct", messages: [{ role: "user", content: "Hello!" }],}); console.log(response.choices[0].message.content);import Anthropic from "@anthropic-ai/sdk"; const client = new Anthropic({ baseURL: "https://api.IQXtokenfactory.com/anthropic/", apiKey: "tf-your-api-key-here",}); const message = await client.messages.create({ model: "claude-3-5-sonnet-20241022", max_tokens: 1024, messages: [{ role: "user", content: "Hello!" }],}); console.log(message.content[0].text);Key concepts
API keys
All requests require a Bearer token. Get your key from the Dashboard. Keys start with tf-.
Token billing
Billed per token — input and output separately. Check the Models page for per-model rates.
UltraFast
Models with the UltraFast flag run on LPU hardware — up to 1,800 tokens/sec. Use for latency-critical apps.
Rate limits
Limits vary by plan. Check X-RateLimit-* and retry-after headers in responses.
Quickstart
First response in under 2 minutes. Pick the SDK you already have.
Prerequisites
Step 1 — Install the SDK
# Python — pick onepip install openaipip install anthropic# Node.jsnpm i openainpm i @anthropic-ai/sdkStep 2 — Set your API key
Get a key from the dashboard, then set it in your environment. Onetf-key works for both endpoints.
export IQX_API_KEY="tf-your-api-key-here"Step 3 — Make your first request
from openai import OpenAIimport osclient = OpenAI( base_url="https://api.IQXtokenfactory.com/openai/v1/", api_key=os.environ["IQX_API_KEY"],)response = client.chat.completions.create( model="meta-llama/Llama-3.3-70B-Instruct", messages=[{"role": "user", "content": "Hello from IQx Token Factory!"}],)print(response.choices[0].message.content)Choose a model
Browse the full 33-model catalog with pricing, context length, and TPS on the Models page.
Authentication
A single tf- API key authorizes both the OpenAI and Anthropic endpoints. Pass it in whichever header your SDK expects.
Never expose your API key
tf-* keys like passwords. Keep them out of client-side code, public repos, and shared screenshots. Rotate any key that has been exposed — old keys are revoked instantly in the dashboard.Key format
Authorization: Bearer tf-your-api-key-herex-api-key: tf-your-api-key-hereanthropic-version: 2023-06-01Response headers
Every response includes rate-limit headers. Use them to back off gracefully.
X-RateLimit-Limit-Requests: 60X-RateLimit-Remaining-Requests: 59X-RateLimit-Reset-Requests: 30sX-RateLimit-Limit-Tokens: 1000000X-RateLimit-Remaining-Tokens: 999872X-RateLimit-Reset-Tokens: 0sError codes
IQx Token Factory uses standard HTTP status codes. The response shape matches the SDK that issued the request — OpenAI SDK calls return OpenAI-style error envelopes, Anthropic SDK calls return Anthropic-style envelopes.
Rate limit exceeded?
retry-after header is a hint, not a deadline — your retry strategy should layer randomness on top so a fleet of clients doesn't synchronize on the same recovery window.Cross-SDK error handling
| Status | OpenAI type | Anthropic type | Meaning |
|---|---|---|---|
| 400 | invalid_request_error | invalid_request_error | Malformed payload |
| 401 | invalid_api_key | authentication_error | Bad or missing key |
| 403 | permission_denied | permission_error | Plan / scope mismatch |
| 404 | not_found_error | not_found_error | Unknown model or route |
| 429 | rate_limit_error | rate_limit_error | Backoff and retry |
| 500 | api_error | api_error | Provider / gateway error |
Streaming
Set stream=true on chat or messages calls and the response comes back as Server-Sent Events. Each chunk carries a delta you can forward to the user interface as it arrives.
UltraFast + streaming
from openai import OpenAI client = OpenAI( base_url="https://api.IQXtokenfactory.com/openai/v1/", api_key="tf-your-api-key-here",) stream = client.chat.completions.create( model="meta-llama/Llama-3.3-70B-Instruct", stream=True, messages=[{"role": "user", "content": "Write a haiku about inference."}],) for chunk in stream: delta = chunk.choices[0].delta.content if delta: print(delta, end="", flush=True)