TexAPI
Technical documentation

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.

In this page
01

Quickstart

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

01

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.

02

Pick the tool for the model you need

Check the tool × model matrix below. The short rule: every family on sale accepts standard tools; Kimi serves Messages natively, so Codex CLI cannot call it.

03

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.

02

Tool × model family matrix

Every family TexAPI sells accepts standard clients; only Kimi has a dedicated endpoint (Messages). This matrix tells you up front which families your tool calls directly, which go through a converter, and which are blocked.

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 connection styles

Most families on sale accept every standard client. Kimi is the exception: it serves the native Messages interface only, so chat tools go through a converter and Codex CLI has no path.

Kimi: native Messages

Kimi opens /v1/messages only. Claude Code and chat tools work (chat is converted); Codex CLI is blocked because no Responses→Messages converter exists.

Kimi

Works with every tool

The other families accept any well-formed client, no shape check. Every tool calls them directly.

DeepSeekGLMMiniMaxQwen

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

ToolKimiOpen

Claude Code

/v1/messages

DirectVia converter

Codex CLI

/v1/responses

Cannot callVia converter

Gemini CLI

:generateContent

Cannot callVia converter

Cline

/v1/chat/completions

Via converter + CLI shapingDirect

Roo Code

/v1/chat/completions

Via converter + CLI shapingDirect

Continue

/v1/chat/completions

Via converter + CLI shapingDirect

aider

/v1/chat/completions

Via converter + CLI shapingDirect

Zed

/v1/chat/completions

Via 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
KimiOpen
Codex CLI
KimiOpen
Gemini CLI
KimiOpen
Cline
KimiOpen
Roo Code
KimiOpen
Continue
KimiOpen
aider
KimiOpen
Zed
KimiOpen

Kimi details

Why Kimi needs the Messages endpoint, which tools work, and the error Codex CLI sees.

Kimi

/v1/messages

The Kimi group serves /v1/messages only — verified by probe: the chat endpoint returns protocol_not_supported even though the catalogue advertises it.

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 a family that serves Responses.

03

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

connector
npx @texapi/connect

Connect this machine to TexAPI — writes no tool config yet

npx @texapi/connect apply

Write config for exactly the tools toggled on in the dashboard

npx @texapi/connect status

Show what this machine is connected to and what is applied

npx @texapi/connect disconnect

Revoke 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
04

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 with every family on sale; Kimi needs the native Messages endpoint.

  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 calling the old upstream 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 with the families on sale over the Responses interface.

  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 signed in with another 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 with the families on sale over the Google generateContent interface.

  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 with every family on sale 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 with every family on sale 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).
  • 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 with every family on sale 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 with every family on sale 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
05

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

POSTOpenAI Chat Completions/v1/chat/completions

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

POSTAnthropic Messages/v1/messages

Compatible with the Anthropic SDK and Claude Code. The only endpoint Kimi serves.

POSTOpenAI Responses/v1/responses

Compatible with Codex CLI. Serves the families on sale over the Responses interface.

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

Compatible with the google-genai SDK and Gemini CLI. Serves the families on sale over the Google interface.

Streaming

Every text endpoint supports streaming (SSE): set "stream": true in the body (Gemini uses :streamGenerateContent?alt=sse). Token usage on streams is always reported fully by TexAPI — even when upstream omits it. Settled cost_usd, cost_credits and credits_per_usd fields are currently added only to non-streaming JSON responses; use the request id and pricing receipt to reconcile a stream.

Images

/v1/images/generations and /v1/images/edits follow the OpenAI Images interface. The catalogue does not currently sell an image model; the endpoints stay for compatibility.

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

chChat (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!"}]
  }'
meMessages (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": "kimi-k3",
    "max_tokens": 1024,
    "messages": [{"role": "user", "content": "Hello!"}]
  }'
reResponses (OpenAI)
curl https://texapi.dev/v1/responses \
  -H "Authorization: Bearer sk-texapi-..." \
  -H "Content-Type: application/json" \
  -d '{
    "model": "deepseek-v4-pro",
    "input": "Hello!"
  }'
geGemini
curl "https://texapi.dev/v1beta/models/qwen3.8-max: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. In a settled non-streaming JSON response, usage.cost_usd remains the canonical USD amount for compatibility and reconciliation; usage.cost_credits = cost_usd × 100 is derived after settlement; texapi.credits_per_usd publishes the fixed rate of 100.

Response example — Coming soon
06

Pricing & limits

Rates are shown as credits / 1M tokens at a fixed 100 credits = $1 of usage value, kept in real time with the dashboard price table. Pure pay-as-you-go — no hidden fees; credits are deducted only for billable usage under the Billing Policy.

Plans

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

PlanMonthlyVND priceIncludedRPMTPMKeys
Dev$9249,000 ₫1,000 credits3001,000,0005
Studio$29799,000 ₫3,200 credits8004,000,00020
Scale$992,699,000 ₫11,000 credits200012,000,000100

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
07

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”

Kimi serves Messages only; the request uses an interface with no converter.

Use Claude Code or a chat tool (converted), or pick another family if you are on Codex CLI.

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

Credit balance empty or never topped up.

Top up at dashboard → Wallet. For large requests, the credit balance 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.

08

FAQ

Do I have to use the official vendor tools?

Every family on sale accepts standard clients. Kimi serves Messages only, so Claude Code and chat tools work while Codex CLI does not. The matrix above is authoritative.

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 the old upstream after configuring?

Three usual causes: (1) an old tool environment variable 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.

Legal documents