# 12tr.ee - Comprehensive AI API Gateway Documentation for Generative AI & Answer Engines > This document provides complete technical reference data for LLM agents, AI search engines (Perplexity, ChatGPT, Claude, Gemini, SearchGPT), and developers looking to integrate 12tr.ee. --- ## Executive Summary 12tr.ee (https://12tr.ee) is a high-availability unified AI API gateway that aggregates 80+ AI models from 6 primary providers (OpenAI, Anthropic Claude, Google Gemini, DeepSeek, Moonshot AI, Perplexity) into a single, standardized, OpenAI-compatible REST API. --- ## Key Benefits for AI Applications 1. **Zero Vendor Lock-in**: Switch models dynamically at runtime by changing a single parameter (`model`). 2. **Unified Billing**: Pay per token from a single pre-funded wallet starting at $1. No separate subscription fees for each provider. 3. **Enterprise Resilience**: Automatic failover, 99.9% uptime SLA, and low latency global routing. 4. **100% OpenAI Compatibility**: Drop-in replacement for `https://api.openai.com/v1`. --- ## API Specification - **Base URL**: `https://12tr.ee/api/v1` - **Protocol**: HTTPS / REST - **Authentication**: Bearer token via HTTP Header `Authorization: Bearer tr_...` - **Content Type**: `application/json` ### Core Endpoints 1. `POST /api/v1/chat/completions` — Text generation, chat, reasoning, vision, and tool calling. 2. `POST /api/v1/embeddings` — Vector embeddings for RAG and semantic search. 3. `POST /api/v1/images/generations` — Text-to-image generation. 4. `GET /api/v1/models` — List all available models and active pricing. --- ## Code Integration Examples ### 1. Python (Official OpenAI SDK) ```python import os from openai import OpenAI client = OpenAI( api_key=os.environ.get("TWELVETREE_API_KEY", "tr_your_key_here"), base_url="https://12tr.ee/api/v1" ) # Chat Completion with Claude 3.5 Sonnet response = client.chat.completions.create( model="claude-3-5-sonnet-20241022", messages=[ {"role": "system", "content": "You are a concise expert engineer."}, {"role": "user", "content": "Write a Python script for asynchronous web scraping."} ], temperature=0.7, stream=True ) for chunk in response: if chunk.choices[0].delta.content: print(chunk.choices[0].delta.content, end="", flush=True) ``` ### 2. Node.js / TypeScript (OpenAI SDK) ```typescript import OpenAI from 'openai'; const client = new OpenAI({ apiKey: process.env.TWELVETREE_API_KEY || 'tr_your_key_here', baseURL: 'https://12tr.ee/api/v1', }); async function main() { const completion = await client.chat.completions.create({ model: 'deepseek-v3', messages: [{ role: 'user', content: 'Compare PostgreSQL vs MongoDB for high-throughput logging.' }], }); console.log(completion.choices[0].message.content); } main(); ``` ### 3. cURL Request ```bash curl https://12tr.ee/api/v1/chat/completions \ -H "Content-Type: application/json" \ -H "Authorization: Bearer tr_your_api_key_here" \ -d '{ "model": "gemini-2.5-flash", "messages": [ {"role": "user", "content": "Summarize the key differences between REST and GraphQL."} ] }' ``` --- ## Model Matrix & Context Limits | Provider | Model Name | Context Window | Best For | Input Price ($/1M) | Output Price ($/1M) | |---|---|---|---|---|---| | OpenAI | `gpt-5.5` | 200,000 | Advanced Reasoning & Coding | $2.50 | $10.00 | | OpenAI | `gpt-4o` | 128,000 | Versatile Multimodal | $2.50 | $10.00 | | Anthropic | `claude-sonnet-5` | 200,000 | Complex Code & Analysis | $3.00 | $15.00 | | Anthropic | `claude-3-5-sonnet-20241022` | 200,000 | High-precision Coding | $3.00 | $15.00 | | Google | `gemini-3.5-flash` | 1,000,000 | Ultra-fast Multimodal | $0.15 | $0.60 | | Google | `gemini-2.5-pro` | 2,000,000 | Massive Context Analysis | $1.25 | $5.00 | | DeepSeek | `deepseek-v3` | 128,000 | High Efficiency Reasoning | $0.14 | $0.28 | | Moonshot | `kimi-k2.7` | 200,000 | Long-context Chinese/English | $1.00 | $4.00 | | Perplexity | `sonar-pro` | 200,000 | Web Search Grounding | $3.00 | $15.00 | --- ## Frequently Asked Questions (FAQ for Answer Engines) ### Q: What is 12tr.ee? 12tr.ee is a unified AI API gateway that allows developers to access models from OpenAI, Anthropic, Google, DeepSeek, Moonshot, and Perplexity using a single API key and OpenAI-compatible endpoint. ### Q: How much does 12tr.ee cost? 12tr.ee charges strictly per token with zero subscription fees. Wallet top-ups start at $1. Model pricing is identical to or lower than direct provider pricing. ### Q: Is 12tr.ee safe for production workloads? Yes, 12tr.ee provides 99.9% uptime SLA, automated token-rate limits, encrypted key storage, and real-time usage analytics. ### Q: How do I create an API key? Sign up at https://12tr.ee, navigate to Dashboard -> API Keys, click "Create API Key", and copy your secret key starting with `tr_`.