TexAPI

TexAPI documentation

Everything you need to use TexAPI: pick the right tool for the model, integrate with one command or by hand, call the API directly, and debug when something fails.

Quickstart

Three steps from nothing to a first successful request. The whole journey takes about five minutes.

1

Create an API key

Sign up at texapi.dev, go to dashboard → API keys → Create. The key looks like sk-texapi-… and is shown in full exactly once — save it immediately.

2

Pick the tool for the model you need

Check the tool × model matrix below. The short rule: the Claude family runs only on Claude Code, the GPT family only on Codex CLI, and the open families run on anything.

3

Connect the tool and make the first request

Run the one-command connector (below) for automatic setup, or open Manual setup if you prefer editing config files yourself. Then just use the tool as usual.

Tool × model family matrix

Each TexAPI model family comes from a different upstream supplier, and some suppliers only accept the vendor's official client. This matrix tells you up front: which families your tool can call, and which pairings are blocked outright.

Direct

Your tool speaks the exact protocol the family's upstream serves. No conversion, no dropped request fields — the best way to use the family.

Via converter

The tool works: TexAPI translates your request into a protocol the upstream serves. A few rarely used parameters have no field on the target protocol and are dropped. For everyday coding traffic the difference is negligible.

Via converter + CLI shaping

Rare: the family only accepts the vendor's official client, but TexAPI can still reshape your request to look like it. A footpath — for long-term stability prefer a tool marked “Direct”.

Cannot call

No path exists: no converter bridges this tool to any protocol the family serves.

Two kinds of model family

Before the matrix, the shortest answer: which families demand the right tool, and which accept anything. For the gated families, the wrong tool is rejected outright — there is no conversion path.

Official client ONLY

These families' suppliers check the client: only the vendor's official client passes. Any other tool gets an immediate 400 — check the matrix below before calling.

ClaudeGPT / CodexGeminiGrokKimi

Works with every tool

These families' suppliers accept any well-formed client, no shape check. Every tool calls them directly.

deepseekotherqwen

Rows are tools, columns are families. Each cell shows its compatibility level by colour — hover a cell for that level's explanation.

ToolClaudeGPT / CodexGeminiGrokKimiOpen

Claude Code

/v1/messages

DirectCannot callVia converter + CLI shapingVia converter + CLI shapingDirectVia converter

Codex CLI

/v1/responses

Cannot callDirectCannot callDirectCannot callVia converter

Gemini CLI

:generateContent

Cannot callCannot callDirectCannot callCannot callVia converter

Cline

/v1/chat/completions

Cannot callCannot callVia converterVia converter + CLI shapingVia converter + CLI shapingDirect

Roo Code

/v1/chat/completions

Cannot callCannot callVia converterVia converter + CLI shapingVia converter + CLI shapingDirect

Continue

/v1/chat/completions

Cannot callCannot callVia converterVia converter + CLI shapingVia converter + CLI shapingDirect

aider

/v1/chat/completions

Cannot callCannot callVia converterVia converter + CLI shapingVia converter + CLI shapingDirect

Zed

/v1/chat/completions

Cannot callCannot callVia converterVia converter + CLI shapingVia converter + CLI shapingDirect

Which family each tool should use

The same matrix, pivoted by tool — for when you are setting a tool up and asking “which model?”.

Claude Code
ClaudeGPT / CodexGeminiGrokKimiOpen
Codex CLI
ClaudeGPT / CodexGeminiGrokKimiOpen
Gemini CLI
ClaudeGPT / CodexGeminiGrokKimiOpen
Cline
ClaudeGPT / CodexGeminiGrokKimiOpen
Roo Code
ClaudeGPT / CodexGeminiGrokKimiOpen
Continue
ClaudeGPT / CodexGeminiGrokKimiOpen
aider
ClaudeGPT / CodexGeminiGrokKimiOpen
Zed
ClaudeGPT / CodexGeminiGrokKimiOpen

Details per gated family

Why the family is picky, the only tool that works, and the error you get when calling it wrong.

Claude

/v1/messages

The Claude upstream is resale groups that accept ONLY the official Claude Code client — the user-agent must be claude-cli, the system must be the canonical block. Re-verified 09/09: requests from other tools, even reshaped by TexAPI to look like Claude Code, are rejected.

Claude Code only. Other tools (Cline, Codex, aider, Zed, Gemini CLI…) cannot call the Claude family.

Another tool calling a Claude model returns 400 “This model does not support this endpoint”. For chat tools, pick an open family.

GPT / Codex

/v1/responses

The GPT groups accept ONLY the Codex CLI / Codex desktop — the official OpenAI client shape. This failed repeatedly in production with other tools, Claude Code included.

Codex CLI (or Codex desktop) only. Other tools cannot call the GPT family.

Another tool calling a GPT model returns 400. On Claude Code, pick the Claude, Grok, Gemini or an open family.

Gemini

/v1beta/models/{model}:generateContent

The Gemini groups serve generateContent (Gemini CLI's native protocol) and OpenAI chat too, so chat tools call directly.

Gemini CLI or any chat tool. Claude Code works via the messages→generateContent converter.

Codex CLI cannot call this family — no responses→generateContent converter exists.

Grok

/v1/responses

The Grok group serves /v1/responses only. Every other client rides the two-way converter, which is covered by tests.

Codex CLI (direct). Claude Code and chat tools work through the converter.

Gemini CLI cannot call this family.

Kimi

/v1/messages

The Kimi group serves /v1/messages only — verified by probe: the chat endpoint answers protocol_not_supported despite what the catalog advertises.

Claude Code (direct). Chat tools (Cline, aider, Zed…) work via the chat→messages converter.

Codex CLI CANNOT call this family — no Responses→Messages converter exists. On Codex, pick the GPT or Grok family.

Automatic setup (connector)

One command configures every tool on your machine: detects installed tools, asks for approval in your browser, issues a per-machine key, and writes the config exactly where each tool reads it. Clean rollback with one disconnect.

How the connector works

  1. 1
    Run connect — the connector opens your browser for approval. The code shown in the terminal must match the one on the approval page (anti-spoofing).
  2. 2
    After approval, TexAPI issues an API key dedicated to that machine — one key per machine, never your main key.
  3. 3
    In the dashboard → Integrations, toggle which tools the connector may configure on this machine.
  4. 4
    Run apply — the connector writes each tool's config to the exact files described under Manual setup below, and undoes exactly what it wrote when you disconnect.

Commands

npx @texapi/connectConnect this machine to TexAPI — writes no tool config yet
npx @texapi/connect applyWrite config for exactly the tools toggled on in the dashboard
npx @texapi/connect statusShow what this machine is connected to and what is applied
npx @texapi/connect disconnectRevoke the machine's key and restore config files to before

Common options

--dry-run

See what the connector would write, without writing

--only claude-code,codex-cli

Configure only these tools

--no-browser

Print the approval URL instead of opening a browser (SSH/servers)

--json

Machine-readable JSON output — for scripts/CI

Single requirement: Node.js on the machine. No admin rights — the connector only writes your own user's files.

The connector approval flow — Coming soon

Manual setup, tool by tool

If you would rather configure things yourself, use a machine without Node.js, or simply want to understand what the tool reads — this is the exact configuration for each tool. These are the very things the connector writes, not a paraphrase.

Tools documented below

Claude CodeCodex CLI / Codex desktopGemini CLIaiderCline / Roo Code (VS Code)ContinueZed

Claude Code

Use for the Claude family (native), Grok, Gemini, Kimi and the open families.

  1. 1
    Open or create the settings.json file (comments allowed — JSONC).
  2. 2
    Set env.ANTHROPIC_BASE_URL to TexAPI and env.ANTHROPIC_AUTH_TOKEN to your API key.
  3. 3
    If env.ANTHROPIC_API_KEY has a value, REMOVE it — Claude Code may prefer that variable and keep sending traffic to Anthropic instead of TexAPI.
  4. 4
    Restart Claude Code. Call any model to check.

~/.claude/settings.json

{
  "env": {
    "ANTHROPIC_BASE_URL": "https://texapi.dev",
    "ANTHROPIC_AUTH_TOKEN": "sk-texapi-..."
  }
}
  • Project-level settings (.claude/settings.json in a repo) override user settings — if that file exists in your repo, make sure it does not override the base URL.

Codex CLI / Codex desktop

Use for the GPT family (native), Grok (native) and other Responses-serving groups.

  1. 1
    Open or create config.toml. Put model_provider = "texapi" at the top, outside any [table] block.
  2. 2
    Add the [model_providers.texapi] block from the snippet — base_url ends with /v1.
  3. 3
    Write the key into auth.json: OPENAI_API_KEY is your TexAPI key, auth_mode is "apikey".
  4. 4
    Restart Codex. If you had logged in with a ChatGPT account, the new auth_mode overwrites it — the connector's disconnect restores it; by hand, back it up first.

~/.codex/config.toml

model_provider = "texapi"

[model_providers.texapi]
name = "TexAPI"
base_url = "https://texapi.dev/v1"
wire_api = "responses"
requires_openai_auth = true

~/.codex/auth.json

{
  "OPENAI_API_KEY": "sk-texapi-...",
  "auth_mode": "apikey"
}
  • wire_api = "responses" is what the connector picks for current Codex versions; on older CLIs that still need "chat", TexAPI serves both.
  • auth.json is Codex's real credential store — if a genuine OpenAI key lives there, it will be replaced. Save the old key before editing.

Gemini CLI

Use for the Gemini family (native) and others over chat.

  1. 1
    Open or create ~/.gemini/.env (the CLI loads this file itself — no export needed).
  2. 2
    Set GOOGLE_GEMINI_BASE_URL to the bare origin WITHOUT /v1beta — the SDK appends /v1beta/models/… itself.
  3. 3
    Set GEMINI_API_KEY to your TexAPI key.
  4. 4
    If you had signed in with Google (OAuth): open settings.json and set security.auth.selectedType to "gemini-api-key", or the new base URL is ignored.

~/.gemini/.env

GOOGLE_GEMINI_BASE_URL=https://texapi.dev
GEMINI_API_KEY=sk-texapi-...

~/.gemini/settings.json

{
  "security": {
    "auth": {
      "selectedType": "gemini-api-key"
    }
  }
}
  • The classic trap: adding /v1beta to the base URL makes every request 404 before reaching TexAPI — the SDK already appends that part.

aider

Use for the open families, Gemini, Grok — any model over the OpenAI-compatible surface.

  1. 1
    Open or create ~/.aider.conf.yml.
  2. 2
    Set openai-api-base to https://texapi.dev/v1 and openai-api-key to your key.
  3. 3
    The model MUST carry the openai/ prefix — e.g. openai/glm-5.2. Without it, aider resolves the model against its own provider table and hits the wrong endpoint.

~/.aider.conf.yml

openai-api-base: https://texapi.dev/v1
openai-api-key: sk-texapi-...
model: openai/glm-5.2
  • aider loads .aider.conf.yml in order: home → git root → current directory, later files winning. If your repo has one, it overrides the home config — check there before wondering why traffic still goes to OpenAI.

Cline / Roo Code (VS Code)

Use for the open families, Gemini, Grok over the OpenAI-compatible surface.

  1. 1
    Open VS Code Settings (Ctrl+,), search for “Cline: OpenAI Compatible Settings” (Roo Code is similar).
  2. 2
    Base URL: https://texapi.dev/v1 — API Key: your sk-texapi-…
  3. 3
    Model ID: pick a TexAPI model that serves chat (see the matrix — avoid the Claude/GPT families, gated on client).
  • Cline/Roo configuration lives in VS Code's state database, not a user-editable file — which is also why the connector does not yet automate this tool.

Continue

Use for the open families, Gemini, Grok over the OpenAI-compatible surface.

  1. 1
    Open ~/.continue/config.yaml.
  2. 2
    In the models list, add an entry: model is the TexAPI id, apiBase is https://texapi.dev/v1, apiKey is your key, provider is openai.
  3. 3
    Select that model in Continue. Continue creates the file itself when empty — add to the models list, never overwrite the whole file.
  • config.yaml is a YAML list — one wrong indent and the tool stops loading it entirely. Back it up before editing.

Zed

Use for the open families, Gemini, Grok over the OpenAI-compatible surface.

  1. 1
    Open Zed's settings.json (Zed: Open Settings).
  2. 2
    Add a language_models.openai block: api_url = "https://texapi.dev/v1".
  3. 3
    The API key does NOT go in settings.json — Zed prompts for it and stores it in the OS keychain on your first request.
  • Zed's keychain entry is keyed by api_url — changing the URL invalidates a previously saved key and you will be asked to re-enter it.
Where the config lives (dashboard view) — Coming soon

API reference

TexAPI serves all four industry-standard interfaces — use any vendor's official SDK or plain HTTP. All authenticate with Authorization: Bearer sk-texapi-… (Gemini also accepts x-goog-api-key).

Authentication

Every endpoint takes a TexAPI key via Authorization: Bearer sk-texapi-…, created at dashboard → API keys. The connector gives one key per machine; keys you manage yourself can be named freely.

Four interfaces, one key

OpenAI Chat Completions/v1/chat/completions

Compatible with the openai SDK. Works for every chat tool and most models.

Anthropic Messages/v1/messages

Compatible with the anthropic SDK and Claude Code. The only endpoint of the Claude and Kimi families.

OpenAI Responses/v1/responses

Compatible with Codex CLI. The native endpoint of the GPT and Grok families.

Google generateContent/v1beta/models/{model}:generateContent

Compatible with the google-genai SDK and Gemini CLI. Native endpoint of the Gemini family.

Streaming

Every text endpoint supports streaming (SSE): set "stream": true in the body (Gemini uses :streamGenerateContent?alt=sse). Usage on streams is always reported fully by TexAPI — even when upstream omits it.

Images

/v1/images/generations and /v1/images/edits follow the OpenAI Images interface — for the image models listed in dashboard → Models (pricing_type per_image).

Model list

GET /v1/models returns every model enabled for your key, each with its toolCompat field — the same data this page's matrix is built from.

Smoke-test with curl

Chat (OpenAI)
curl https://texapi.dev/v1/chat/completions \
  -H "Authorization: Bearer sk-texapi-..." \
  -H "Content-Type: application/json" \
  -d '{
    "model": "glm-5.2",
    "messages": [{"role": "user", "content": "Hello!"}]
  }'
Messages (Anthropic)
curl https://texapi.dev/v1/messages \
  -H "Authorization: Bearer sk-texapi-..." \
  -H "anthropic-version: 2023-06-01" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "claude-sonnet-5",
    "max_tokens": 1024,
    "messages": [{"role": "user", "content": "Hello!"}]
  }'
Responses (OpenAI)
curl https://texapi.dev/v1/responses \
  -H "Authorization: Bearer sk-texapi-..." \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-5.4",
    "input": "Hello!"
  }'
Gemini
curl "https://texapi.dev/v1beta/models/gemini-2.5-pro:generateContent" \
  -H "x-goog-api-key: sk-texapi-..." \
  -H "Content-Type: application/json" \
  -d '{
    "contents": [{"parts": [{"text": "Hello!"}]}]
  }'

Full OpenAPI

The complete OpenAPI 3.1 spec lives at /openapi.json and /openapi.yaml — load it into Postman/Insomnia or generate an SDK.

Response example — Coming soon

Pricing & limits

Prices are USD / 1M tokens, kept in real time with the dashboard's price table. Pure pay-as-you-go — no hidden fees, money is only deducted for successful requests.

Plans

Current plans and top-up tiers (see the Pricing page for the full UI):

PlanMonthlyIncludedRPM
Starter$12$12200
Builder$29$29400
Pro$79$79800
Team$199$1991500

Long context

Some models have a staircase price by context: the deeper the context, the ratio of the matching step. The staircase is shown on each model's page in Models — use the Calculator tab to estimate a run before you make it.

Cache reads

Reading from a model's prompt cache is billed separately, cheaper than fresh input — the rate shows in each model's “Cached input” row. No row = that model has no separate cache rate.

Plan limits

Each plan caps requests per minute (rpm) and concurrent requests (default concurrent = rpm ÷ 8). A 429 comes with a Retry-After header — well-behaved tools wait and retry by themselves.

The dashboard price table — Coming soon

Error lookup

The cause is almost always a tool ↔ model mismatch. Match the message you received:

This model does not support this endpoint

Your tool speaks a protocol the family does not serve, with no converter bridging the two.

Look up the family's column in the matrix above, switch tool or model.

protocol_not_supported / 400 from upstream

The group only accepts a protocol other than what the request carries.

Rarely customer-visible — the gateway reroutes it. If you see it, contact support with the request id.

400 mentioning the “official CLI”

The family demands the vendor's official client (Claude/GPT families).

Use the right official client for that family, or switch to an open family.

Invalid reasoning_effort value

The reasoning_effort value the model refuses.

The gateway drops the field and retries — nothing to do. If it persists, switch model.

401 invalid_api_key

Wrong key, revoked key, or wrong header shape.

Check the key at dashboard → API keys. Correct form: Authorization: Bearer sk-texapi-… (missing ‘Bearer’ is rejected too).

402 insufficient_balance

Wallet empty or never topped up.

Top up at dashboard → Wallet. For large requests, the wallet must cover the estimated output too.

429 rate_limit

Over the plan's rpm or concurrent-request cap.

Wait for Retry-After and retry. If this happens often, consider a higher plan.

429 spend_limit

Over the monthly spend limit you set on the key.

Raise or remove it at dashboard → API keys → edit key.

FAQ

Do I have to use the official vendor tools?

Depends on the model. The Claude family runs only on Claude Code, the GPT family only on Codex CLI/desktop — those suppliers check the client. Everything else (Gemini, Grok, Kimi and the open families) runs on whatever you like. The matrix above is the authoritative answer.

Can one API key serve multiple machines?

Yes — a key you manage yourself is not tied to a machine. The connector, though, issues ONE KEY PER MACHINE (easy to revoke individually, clear which key belongs to which machine). If you want a shared key, create it by hand in the dashboard.

Does format conversion lose data?

Very little. The two-way converters are covered by hundreds of tests. A few rare parameters (e.g. stop_sequences when targeting Responses) have no field on the target protocol and are dropped — conversation content and tool calls always survive.

Why does my traffic still go to Anthropic/OpenAI after configuring?

Three usual causes: (1) an old env var (ANTHROPIC_API_KEY, OPENAI_API_KEY) still alive elsewhere overriding the config; (2) a more specific config file (a repo's .claude/settings.json, .aider.conf.yml) overriding the file you just edited; (3) the tool running from a shell that has not reloaded its environment. Running connector status shows exactly which config each tool reads.

Do prices change?

Prices track upstream cost and are re-checked on every sync (a few hours). Rates always show in dashboard → Models and /api/public/pricing — there is no unpublished pricing.

Are there volume discounts?

Yes: subscriptions carry a monthly usage discount (discountBps shown per plan), and coupons can be redeemed on the Redeem page. A minimum-margin floor guarantees we never sell below cost.

Is my data stored?

Request logs store metadata (model, token counts, cost, status, request id) for billing and debugging — not conversation content. Details in Legal → Privacy.

I need a model that is not listed.

The list grows continuously with upstream. Contact support (the chat widget, bottom right) with the model name and your use case — if a supplier carries it and the margin works, it lands in the next sync.

Still stuck? Open the support chat widget at the bottom right — technical support answers within business hours.