{"id":50318710,"url":"https://github.com/ctex-ai/texapi","last_synced_at":"2026-05-29T02:02:22.411Z","repository":{"id":358136252,"uuid":"1240175832","full_name":"ctex-ai/texapi","owner":"ctex-ai","description":"Unified AI API Gateway — Access Claude, GPT, Gemini through one OpenAI-compatible endpoint. Save 15-50% vs official pricing.","archived":false,"fork":false,"pushed_at":"2026-05-15T22:03:20.000Z","size":1565,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-15T23:59:26.136Z","etag":null,"topics":["ai","anthropic","api-gateway","cheap-ai-api","claude","claude-code","codex","free","gemini","llm","openai","openclaw","vibe-coding"],"latest_commit_sha":null,"homepage":"https://texapi.dev","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ctex-ai.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"custom":["https://texapi.dev"]}},"created_at":"2026-05-15T21:06:26.000Z","updated_at":"2026-05-15T22:03:24.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/ctex-ai/texapi","commit_stats":null,"previous_names":["ctex-ai/texapi"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/ctex-ai/texapi","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ctex-ai%2Ftexapi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ctex-ai%2Ftexapi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ctex-ai%2Ftexapi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ctex-ai%2Ftexapi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ctex-ai","download_url":"https://codeload.github.com/ctex-ai/texapi/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ctex-ai%2Ftexapi/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33633468,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-29T02:00:06.066Z","response_time":107,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","anthropic","api-gateway","cheap-ai-api","claude","claude-code","codex","free","gemini","llm","openai","openclaw","vibe-coding"],"created_at":"2026-05-29T02:02:17.901Z","updated_at":"2026-05-29T02:02:22.405Z","avatar_url":"https://github.com/ctex-ai.png","language":null,"funding_links":["https://texapi.dev"],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"./assets/logo.png\" alt=\"TexAPI\" width=\"100\" /\u003e\n\u003c/p\u003e\n\n\u003ch1 align=\"center\"\u003eTexAPI\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cstrong\u003eOne API key. All AI models. Save 15–50% vs official pricing.\u003c/strong\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  Access Claude, GPT, Gemini, and free models through a single OpenAI-compatible endpoint.\u003cbr/\u003e\n  Drop-in replacement for Anthropic, OpenAI, and Google APIs.\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://texapi.dev\"\u003e\u003cimg src=\"https://img.shields.io/badge/Website-texapi.dev-0969da?style=flat-square\" alt=\"Website\" /\u003e\u003c/a\u003e\n  \u003ca href=\"https://discord.gg/texapi\"\u003e\u003cimg src=\"https://img.shields.io/badge/Discord-Join-5865F2?style=flat-square\u0026logo=discord\u0026logoColor=white\" alt=\"Discord\" /\u003e\u003c/a\u003e\n  \u003ca href=\"#pricing\"\u003e\u003cimg src=\"https://img.shields.io/badge/Savings-15%25%20to%2050%25-16a34a?style=flat-square\" alt=\"Savings\" /\u003e\u003c/a\u003e\n  \u003ca href=\"./README.vi.md\"\u003e\u003cimg src=\"https://img.shields.io/badge/lang-Tiếng%20Việt-red?style=flat-square\" alt=\"Vietnamese\" /\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cbr/\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"./assets/hero-diagram.svg\" alt=\"TexAPI Architecture\" width=\"700\" /\u003e\n\u003c/p\u003e\n\n---\n\n## Getting Started\n\n```bash\n# That's it. Use any OpenAI-compatible SDK or tool.\ncurl https://texapi.dev/v1/chat/completions \\\n  -H \"Authorization: Bearer tex-YOUR_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"model\": \"claude-sonnet-4-5\", \"messages\": [{\"role\": \"user\", \"content\": \"Hello!\"}]}'\n```\n\n1. **Sign up** → [texapi.dev](https://texapi.dev) (Google / GitHub / Discord). Get 2 free credits.\n2. **Create API key** → Dashboard → API Keys → Create.\n3. **Use anywhere** → Set base URL to `https://texapi.dev/v1` in any OpenAI-compatible tool.\n\n---\n\n## Works With Everything\n\n\u003ctable\u003e\n\u003ctr\u003e\n\u003ctd width=\"50%\"\u003e\n\n### Claude Code\n\n```bash\nexport ANTHROPIC_BASE_URL=https://texapi.dev\nexport ANTHROPIC_API_KEY=tex-YOUR_KEY\nclaude\n```\n\n\u003c/td\u003e\n\u003ctd width=\"50%\"\u003e\n\n### OpenAI Codex CLI\n\n```bash\nexport OPENAI_BASE_URL=https://texapi.dev/v1\nexport OPENAI_API_KEY=tex-YOUR_KEY\ncodex\n```\n\n\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd width=\"50%\"\u003e\n\n### Gemini CLI\n\n```bash\nexport GEMINI_API_BASE=https://texapi.dev/v1\nexport GEMINI_API_KEY=tex-YOUR_KEY\ngemini\n```\n\n\u003c/td\u003e\n\u003ctd width=\"50%\"\u003e\n\n### Any OpenAI SDK\n\n```python\nfrom openai import OpenAI\nclient = OpenAI(\n    api_key=\"tex-YOUR_KEY\",\n    base_url=\"https://texapi.dev/v1\"\n)\n```\n\n\u003c/td\u003e\n\u003c/tr\u003e\n\u003c/table\u003e\n\n\u003e Also works with **Cursor**, **Continue**, **Cline**, **Aider**, **LiteLLM**, and any tool that accepts a custom OpenAI base URL.\n\n---\n\n## Models\n\n### 💎 Paid Models\n\n| Model | Family | Input ($/1M) | Output ($/1M) | Official | Savings |\n|-------|--------|:------------:|:-------------:|:--------:|:-------:|\n| `claude-opus-4-7` | Claude | $4.25 | $21.25 | $5 / $25 | **15% off** |\n| `claude-opus-4-6` | Claude | $4.25 | $21.25 | $5 / $25 | **15% off** |\n| `claude-sonnet-4-6` | Claude | $2.55 | $12.75 | $3 / $15 | **15% off** |\n| `claude-haiku-4-5` | Claude | $0.85 | $4.25 | $1 / $5 | **15% off** |\n| `gpt-5.5` | GPT | $2.50 | $15.00 | $5 / $30 | **50% off** |\n| `gpt-5.4` | GPT | $1.25 | $7.50 | $2.50 / $15 | **50% off** |\n| `gpt-5.4-mini` | GPT | $0.38 | $2.25 | $0.75 / $4.50 | **50% off** |\n| `gpt-5-codex` | GPT | $0.63 | $5.00 | $1.25 / $10 | **50% off** |\n| `o4-mini` | GPT | $0.55 | $2.20 | $1.10 / $4.40 | **50% off** |\n| `gemini-2.5-pro` | Gemini | $0.75 | $6.00 | $1.25 / $10 | **40% off** |\n| `gpt-image-2` | Image | ~$0.012 / image | | ~$0.02–$0.19 / image | **~40% off** |\n\n\u003csub\u003ePrices in USD per 1M tokens. Official prices sourced from \u003ca href=\"https://openai.com/api/pricing/\"\u003eOpenAI\u003c/a\u003e, \u003ca href=\"https://docs.anthropic.com/en/docs/about-claude/pricing\"\u003eAnthropic\u003c/a\u003e, \u003ca href=\"https://ai.google.dev/gemini-api/docs/pricing\"\u003eGoogle\u003c/a\u003e. Full model list at \u003ca href=\"https://texapi.dev/api/models\"\u003etexapi.dev/api/models\u003c/a\u003e\u003c/sub\u003e\n\n### 🆓 Free Models\n\n| Model | Description | Daily Limit |\n|-------|-------------|-------------|\n| `gpt-oss-120b` | 120B open-source model | 100 – 10,000 req/day |\n| `minimax-m2.5-free` | MiniMax M2.5 | 100 – 10,000 req/day |\n| `nemotron-3-super-free` | NVIDIA Nemotron 3 Super | 100 – 10,000 req/day |\n| `big-pickle` | Big Pickler | 100 – 10,000 req/day |\n\n\u003csub\u003eFree models require one successful payment. Limit scales with plan: No plan (100) → Starter (300) → Builder (1,000) → Pro (3,000) → Business (10,000)\u003c/sub\u003e\n\n---\n\n## Endpoints\n\n| Endpoint | Format | Use with |\n|----------|--------|----------|\n| `POST /v1/chat/completions` | OpenAI Chat | All models, all tools |\n| `POST /v1/messages` | Anthropic Messages | Claude Code, native Anthropic SDK |\n| `POST /v1/responses` | OpenAI Responses | Codex CLI, Responses API |\n| `POST /v1/images/generations` | OpenAI Images | gpt-image-2 |\n| `GET /v1/models` | OpenAI Models | List available models |\n\n---\n\n## Pricing\n\n### Top-up (Pay-as-you-go)\n\n| Amount | Credits | ~USD |\n|--------|---------|------|\n| 50,000₫ | 90 | $2 |\n| 100,000₫ | 180 | $4 |\n| 200,000₫ | 360 | $8 |\n| 500,000₫ | 900 | $19 |\n| 1,000,000₫ | 1,800 | $38 |\n\nPayment via VietQR (instant bank transfer). International payments coming soon.\n\n### Subscription Plans\n\n| | Starter | Builder | Pro | Business |\n|---|---------|---------|-----|----------|\n| **Monthly** | 299,000₫ | 749,000₫ | 2,090,000₫ | 5,290,000₫ |\n| **Credits** | 550 | 1,400 | 3,900 | 10,000 |\n| **RPM** | 60 | 240 | 1,000 | 3,000 |\n| **API Keys** | 3 | 10 | 25 | 100 |\n| **Free model/day** | 300 | 1,000 | 3,000 | 10,000 |\n\n---\n\n## How It Works\n\n```\n┌─────────────────────────────────────────────────────────────┐\n│  Your App / IDE / CLI                                       │\n│  (Claude Code, Codex, Gemini CLI, Cursor, SDK, ...)         │\n└─────────────────────┬───────────────────────────────────────┘\n                      │ Authorization: Bearer tex-...\n                      ▼\n┌─────────────────────────────────────────────────────────────┐\n│  TexAPI Gateway  (https://texapi.dev/v1)                    │\n│                                                             │\n│  ┌──────────┐  ┌──────────┐  ┌──────────┐  ┌───────────┐  │\n│  │ Auth \u0026   │→ │ Rate     │→ │ Credit   │→ │ Smart     │  │\n│  │ Key Check│  │ Limiting │  │ Check    │  │ Routing   │  │\n│  └──────────┘  └──────────┘  └──────────┘  └─────┬─────┘  │\n└───────────────────────────────────────────────────┼─────────┘\n                      │ Priority-based fallback      │\n          ┌───────────┼───────────┬─────────────────┘\n          ▼           ▼           ▼\n   ┌────────────┐ ┌────────┐ ┌────────────┐ ┌────────────┐\n   │  Claude    │ │  GPT   │ │  Gemini    │ │  Free Pool │\n   │ (Anthropic)│ │(OpenAI)│ │ (Google)   │ │ (OSS 120B) │\n   └────────────┘ └────────┘ └────────────┘ └────────────┘\n```\n\n**Key features:**\n\n- 🔀 **Smart routing** — Priority-based with automatic fallback. If one provider is down, your request goes to the next.\n- 🔄 **Format translation** — Send OpenAI format, get Anthropic response (or vice versa). TexAPI handles conversion.\n- 📊 **Real-time analytics** — Usage per model, per key, per day. Costs, latency, error rates in your dashboard.\n- 🔒 **Security** — Keys hashed (HMAC-SHA256), upstream creds encrypted (AES-256-GCM), zero content storage.\n- 💰 **Spending controls** — Daily cap, per-key monthly limits, real-time balance tracking.\n- 🤝 **Referral program** — Earn 5% commission on every top-up from users you invite. Permanent.\n\n---\n\n## Code Examples\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003ePython — Streaming\u003c/strong\u003e\u003c/summary\u003e\n\n```python\nfrom openai import OpenAI\n\nclient = OpenAI(api_key=\"tex-YOUR_KEY\", base_url=\"https://texapi.dev/v1\")\n\nstream = client.chat.completions.create(\n    model=\"claude-sonnet-4-5\",\n    messages=[{\"role\": \"user\", \"content\": \"Write a Python quicksort\"}],\n    stream=True,\n)\n\nfor chunk in stream:\n    print(chunk.choices[0].delta.content or \"\", end=\"\")\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eNode.js / TypeScript — Streaming\u003c/strong\u003e\u003c/summary\u003e\n\n```typescript\nimport OpenAI from \"openai\";\n\nconst client = new OpenAI({ apiKey: \"tex-YOUR_KEY\", baseURL: \"https://texapi.dev/v1\" });\n\nconst stream = await client.chat.completions.create({\n  model: \"claude-sonnet-4-5\",\n  messages: [{ role: \"user\", content: \"Explain async/await in TypeScript\" }],\n  stream: true,\n});\n\nfor await (const chunk of stream) {\n  process.stdout.write(chunk.choices[0]?.delta?.content || \"\");\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003ecURL — Non-streaming\u003c/strong\u003e\u003c/summary\u003e\n\n```bash\ncurl https://texapi.dev/v1/chat/completions \\\n  -H \"Authorization: Bearer tex-YOUR_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"model\": \"gpt-5.4\",\n    \"messages\": [{\"role\": \"user\", \"content\": \"Hello!\"}],\n    \"max_tokens\": 100\n  }'\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eAnthropic Messages API (native)\u003c/strong\u003e\u003c/summary\u003e\n\n```bash\ncurl https://texapi.dev/v1/messages \\\n  -H \"Authorization: Bearer tex-YOUR_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -H \"anthropic-version: 2023-06-01\" \\\n  -d '{\n    \"model\": \"claude-sonnet-4-5\",\n    \"max_tokens\": 1024,\n    \"messages\": [{\"role\": \"user\", \"content\": \"Explain quantum computing\"}]\n  }'\n```\n\n\u003c/details\u003e\n\n---\n\n## FAQ\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eIs my data safe?\u003c/strong\u003e\u003c/summary\u003e\n\nYes. TexAPI does not store any request or response content. Only metadata (token counts, latency, model used) is logged for billing and analytics purposes.\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eCan I use this in production?\u003c/strong\u003e\u003c/summary\u003e\n\nAbsolutely. The Business plan supports 3,000 RPM, 100 API keys, and 99.9%+ uptime with multi-provider fallback.\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eWhat payment methods are accepted?\u003c/strong\u003e\u003c/summary\u003e\n\nVietQR bank transfer (instant) — works with all Vietnamese banks. International payment methods coming soon.\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eDo credits expire?\u003c/strong\u003e\u003c/summary\u003e\n\nTop-up credits never expire. Subscription credits expire at the end of each billing period.\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eWhat happens if a provider goes down?\u003c/strong\u003e\u003c/summary\u003e\n\nTexAPI automatically routes your request to the next available provider. You don't need to change anything.\n\u003c/details\u003e\n\n---\n\n## Documentation\n\n| Doc | Description |\n|-----|-------------|\n| [API Reference](./docs/api-reference.md) | Full endpoint documentation |\n| [Setup Claude Code](./docs/setup-claude-code.md) | Use TexAPI with Claude Code |\n| [Setup Codex CLI](./docs/setup-codex.md) | Use TexAPI with OpenAI Codex |\n| [Setup Gemini CLI](./docs/setup-gemini-cli.md) | Use TexAPI with Gemini CLI |\n| [Pricing Comparison](./docs/comparison.md) | Detailed pricing vs official APIs |\n\n---\n\n## Links\n\n🌐 [texapi.dev](https://texapi.dev) · 💬 [Discord](https://discord.gg/texapi) · 📧 support@texapi.dev\n\n---\n\n\u003cp align=\"center\"\u003e\n  \u003csub\u003eIf TexAPI saves you money, consider giving this repo a ⭐\u003c/sub\u003e\n\u003c/p\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fctex-ai%2Ftexapi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fctex-ai%2Ftexapi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fctex-ai%2Ftexapi/lists"}