# TokenFajri — Complete Technical Reference for AI Agents & LLMs (llms-full.txt) ## 1. Platform Overview - **Platform Name**: TokenFajri - **Canonical Web URL**: https://token.fajriag.ai.id - **OpenAI v1 API Base URL**: https://token.fajriag.ai.id/v1 - **OpenAPI 3.1 Spec**: https://token.fajriag.ai.id/openapi.json - **Primary Market**: Indonesia & Southeast Asia Software Engineering Teams, AI Agents, and Enterprises - **Supported Protocols**: OpenAI Chat Completions v1 (`POST https://token.fajriag.ai.id/v1/chat/completions`), Model Discovery (`GET https://token.fajriag.ai.id/v1/models`), Server-Sent Events (SSE) Streaming (`stream: true`), Tool/Function Calling. ## 2. Authentication & Security Architecture - All API requests require a Bearer token in the HTTP Authorization header: `Authorization: Bearer sk-tok-` - API keys are stored as SHA-256 cryptographic hashes in PostgreSQL; plaintext keys are never persisted after creation. - Zero Prompt Retention: Request messages and completion streams pass through the edge proxy via SSE without writing prompt bodies to database disk. ## 3. Atomic Billing & Quota Deduction Waterfall When an authenticated request arrives at `POST https://token.fajriag.ai.id/v1/chat/completions`: 1. **Free Tier Models (`FREE_TIER`)**: Executed immediately at Rp 0 cost even if the user's balance is Rp 0. 2. **Active Time-Based Subscription (`WEEKLY` / `MONTHLY`)**: Deducts 1 request from `planRemainingRequests`. IDR wallet balance is untouched (Rp 0 deducted). Includes automatic periodic quota regeneration. 3. **Perpetual Request Quota (`REQUESTS` / No Expiry)**: If no timed subscription is active, deducts 1 request from `quotaRequests`. 4. **Pay-As-You-Go IDR Wallet (`balance`)**: If no request quota remains, atomically holds and settles the exact token cost in Indonesian Rupiah based on `(prompt_tokens * input_price + completion_tokens * output_price) / 1,000,000`. ## 4. Live Model Catalog & Pricing (IDR) | Model ID | Provider | Display Name | Input / 1M Tokens (IDR) | Output / 1M Tokens (IDR) | Context Window | Tier | | :--- | :--- | :--- | :--- | :--- | :--- | :--- | | `deepseek-v4.1-flash` | DeepSeek | DeepSeek V4.1 Flash | Rp 0 | Rp 0 | 1,000,000 | FREE_TIER | | `mimo-v2.6-flash:free` | th | mimo v2.6 Flash:free | Rp 0 | Rp 0 | 1,048,576 | FREE_TIER | | `muse-spark-1.2-contributor-free` | OpenCode | muse spark 1.2 contributor free | Rp 0 | Rp 0 | 128,000 | FREE_TIER | ## 5. Active Subscription & Quota Packages (IDR) | Package ID | Name | Category | Price (IDR) | Requests Included | Validity | Description | | :--- | :--- | :--- | :--- | :--- | :--- | :--- | | `pkg-sprint-3d` | Paket Sprint 3 Hari | WEEKLY | Rp 10.000 | 200 | 3 Days | 200 Request AI aktif selama 3 hari. Pas untuk uji coba atau sprint proyek kilat. | | `pkg-weekly-7d` | Paket Mingguan 7 Hari | WEEKLY | Rp 25.000 | 500 | 7 Days | 500 Request AI aktif selama 7 hari. Pas untuk kebutuhan coding mingguan. | | `pkg-monthly-1m` | Paket Bulanan 1 Bulan | MONTHLY | Rp 85.000 | 3,000 | 30 Days | 3.000 Request AI aktif selama 30 hari (1 Bulan). Paling hemat untuk developer harian. | | `pkg-quarterly-3m` | Paket Triwulan 3 Bulan | MONTHLY | Rp 240.000 | 10,000 | 90 Days | 10.000 Request AI aktif selama 90 hari (3 Bulan). Solusi hemat untuk jangka menengah. | | `pkg-semester-6m` | Paket Semester 6 Bulan | MONTHLY | Rp 450.000 | 22,000 | 180 Days | 22.000 Request AI aktif selama 180 hari (6 Bulan). Nilai terbaik untuk developer & tim profesional. | ## 6. Integration Configurations ### 6.1 Cursor IDE / VS Code Cline / Roo Code 1. Open Settings -> Models -> OpenAI API Key. 2. Enter your `TokenFajri` key (`sk-tok-...`). 3. Enable **Override OpenAI Base URL** and set it to: `https://token.fajriag.ai.id/v1` 4. Add any model ID from the table above (or query `GET https://token.fajriag.ai.id/v1/models`). ### 6.2 Python (OpenAI SDK) ```python from openai import OpenAI import os client = OpenAI( base_url="https://token.fajriag.ai.id/v1", api_key=os.environ.get("TOKEN_API_KEY"), ) stream = client.chat.completions.create( model="claude-sonnet-4-5", messages=[{"role": "user", "content": "Explain distributed consensus."}], stream=True, ) for chunk in stream: print(chunk.choices[0].delta.content or "", end="") ``` ### 6.3 cURL ```bash curl -N https://token.fajriag.ai.id/v1/chat/completions \ -H "Content-Type: application/json" \ -H "Authorization: Bearer sk-tok-YOUR_KEY" \ -d '{ "model": "claude-sonnet-4-5", "messages": [{"role": "user", "content": "Ping gateway"}], "stream": true }' ``` ## 7. Contact & Support - Web Console: https://token.fajriag.ai.id - Register API Key: https://token.fajriag.ai.id/register - Support Telegram: https://t.me/FAJRIAG1