NewOpenAI- and Anthropic-compatible — no migrationRead the announcement
v1.0 · LiveOpenAI + Anthropic compatible

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

One key, two surfaces. Switch the 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.

CapabilityOpenAI endpointAnthropic endpointStatus
Chat / Messages/openai/v1/chat/completions/anthropic/v1/messagesLive
Streaming (SSE)stream=truestream=trueLive
Function callingtools + tool_choicetools + tool_use blocksLive
JSON moderesponse_formattool use + schemaLive
Vision / Imagesimage_url contentimage content blocksLive
Batch/v1/batches/v1/messages/batchesLive
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.

posthttps://api.IQXtokenfactory.com/openai/v1/
puthttps://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.

Python · OpenAI SDK
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)
Python · Anthropic SDK
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)
JavaScript · OpenAI SDK
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);
JavaScript · Anthropic SDK
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

Node 18+ or Python 3.9+ and a free IQx Token Factory account. New accounts get a $5 credit — no card on file required.

Step 1 — Install the SDK

Choose your SDK
# Python — pick onepip install openaipip install anthropic# Node.jsnpm i openainpm i @anthropic-ai/sdk

Step 2 — Set your API key

Get a key from the dashboard, then set it in your environment. Onetf-key works for both endpoints.

Environment variable
export IQX_API_KEY="tf-your-api-key-here"

Step 3 — Make your first request

OpenAI SDK
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

Treat 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

OpenAI-style header
Authorization: Bearer tf-your-api-key-here
Anthropic-style header
x-api-key: tf-your-api-key-hereanthropic-version: 2023-06-01

Response headers

Every response includes rate-limit headers. Use them to back off gracefully.

Rate-limit headers
X-RateLimit-Limit-Requests: 60X-RateLimit-Remaining-Requests: 59X-RateLimit-Reset-Requests: 30sX-RateLimit-Limit-Tokens: 1000000X-RateLimit-Remaining-Tokens: 999872X-RateLimit-Reset-Tokens: 0s

Error 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?

Use exponential backoff with full jitter on 429s. The 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

StatusOpenAI typeAnthropic typeMeaning
400invalid_request_errorinvalid_request_errorMalformed payload
401invalid_api_keyauthentication_errorBad or missing key
403permission_deniedpermission_errorPlan / scope mismatch
404not_found_errornot_found_errorUnknown model or route
429rate_limit_errorrate_limit_errorBackoff and retry
500api_errorapi_errorProvider / 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

Models with the UltraFast flag hit 1,800 tokens/sec sustained on streaming — first-token latency is typically under 200 ms on LPU hardware.
Python · OpenAI SDK (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)