SDKs & Tools

Which client SDKs and tools work with the gateway — what is tested vs what should work.

The gateway is an OpenAI-compatible endpoint plus a native Anthropic surface, so any client that speaks either dialect points at it by changing two lines: the base URL and the API key.

Verified

These are exercised by TokenFactory's own regression suites and documented end-to-end in these docs — treat them as supported:

ClientSurfaceNotes
OpenAI Python SDK (pip install openai)/v1/*The canonical example throughout these docs. base_url="https://api.<domain>/v1".
OpenAI Node SDK (npm install openai)/v1/*baseURL: 'https://api.<domain>/v1'.
Anthropic Python SDK (pip install anthropic)/v1/messagesbase_url="https://api.<domain>" — no /v1; the SDK appends the path.
curl / plain HTTPboth dialectsEvery endpoint page shows a curl sample; nothing SDK-specific is required.

The wire shapes themselves are contract-tested per modality (chat, embeddings, images, audio, rerank, anthropic, video) — an SDK that emits the standard OpenAI or Anthropic wire format hits the same tested path.

Should work — same dialect, not individually verified

Any client that emits the standard OpenAI (or Anthropic) wire format should work by setting the base URL and key. This includes tools frequently used with OpenAI-compatible endpoints:

  • LangChain (ChatOpenAI with base_url)
  • Vercel AI SDK (OpenAI provider with baseURL)
  • Editor/agent clients (e.g. Cursor) that accept a custom OpenAI base URL
  • Claude Code and Anthropic SDK clients via /v1/messages (Auth)

These are not part of a tested support matrix — the gateway does not run per-tool certification. If a tool strictly follows the OpenAI or Anthropic schemas, it works; if it depends on provider-specific extensions outside those schemas (which the gateway strips or rejects — see Errors), that specific extension may not be available.

Endpoint coverage inside the OpenAI SDKs

The OpenAI SDKs' typed surface does not cover every gateway endpoint:

  • /v1/rerank and /v1/videos/* are not part of the SDKs' typed resources. Use the SDK's generic request escape hatch (client.post('/rerank', …) in Python, client.post('/rerank', {body}) in Node) — or plain curl. Both are shown on the Rerank and Videos — Create pages.
  • Everything else (chat.completions, completions, embeddings, images.*, audio.transcriptions/translations/speech, models.list, videos.create/retrieve*) maps to typed methods.
  • videos.* typed methods exist but target the deprecated OpenAI Sora surface — the gateway's async video API is submit + poll, not the Sora job shape. Use the curl samples on the video pages.