{"id":30285863,"url":"https://github.com/ckt1031/toupie","last_synced_at":"2026-05-08T05:48:34.312Z","repository":{"id":281597353,"uuid":"941556071","full_name":"ckt1031/toupie","owner":"ckt1031","description":"“Tube” your LLMs into single one single OpenAI compatible API, easy and fast.","archived":false,"fork":false,"pushed_at":"2025-08-10T17:03:01.000Z","size":665,"stargazers_count":1,"open_issues_count":4,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-10T19:04:31.640Z","etag":null,"topics":["ai","api","llm","llm-inference","openai","openai-api","serverless","vercel"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/ckt1031.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"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}},"created_at":"2025-03-02T15:18:37.000Z","updated_at":"2025-08-10T17:03:04.000Z","dependencies_parsed_at":"2025-03-10T06:24:36.951Z","dependency_job_id":"5f6d5b60-eca2-4b3c-9bb7-9ea6e7f0b5d1","html_url":"https://github.com/ckt1031/toupie","commit_stats":null,"previous_names":["ckt1031/llm-relay","ckt1031/toupie"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ckt1031/toupie","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ckt1031%2Ftoupie","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ckt1031%2Ftoupie/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ckt1031%2Ftoupie/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ckt1031%2Ftoupie/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ckt1031","download_url":"https://codeload.github.com/ckt1031/toupie/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ckt1031%2Ftoupie/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270769036,"owners_count":24642068,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-16T02:00:11.002Z","response_time":91,"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","api","llm","llm-inference","openai","openai-api","serverless","vercel"],"created_at":"2025-08-16T20:43:37.970Z","updated_at":"2026-04-10T23:36:15.997Z","avatar_url":"https://github.com/ckt1031.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Toupie\n\nToupie (French for \"spinning top\" or, in a more technical sense, \"router\" or \"turntable\") is an LLM Relay API server with OpenAI API format.\n\n## Target Users and Use Cases\n\nThe API uses just **one JSON file stored on the server** - no database, no dashboard, and no visual API‑key manager. This keeps routing simple on a server‑less platform.\n\nIf you need a UI or more advanced features, you should go with OpenRouter with BYOK (Bring Your Own Key), the [New API](https://github.com/QuantumNous/new-api), or the [LiteLLM Proxy](https://github.com/BerriAI/liteLLM-proxy).\n\n## Installation\n\n```bash\nbun install\n```\n\n## Usage of API\n\n```bash\nbun run dev\nbun run deploy\n```\n\n### Chat Completion\n\n```bash\ncurl -X POST https://YOUR_DOMAIN/v1/chat/completions \\\n-H \"Content-Type: application/json\" \\\n-d '{\"model\": \"gpt-4o-mini\", \"messages\": [{\"role\": \"user\", \"content\": \"Hello, how are you?\"}]}'\n```\n\n## CLI Tool (`helper.ts`)\n\nThis helper tool helps manage the `api.json` configuration file, allowing you to add user API keys, add providers, add keys to existing providers, add models to existing providers, and modify provider settings.\n\n### Usage\n\nTo run the helper tool, use the following command:\n\n```bash\nbun run helper\n```\n\nThis will start an interactive menu in your terminal, guiding you through the available options:\n\n1. **Add User API Key**: Generates and adds a new user API key to the configuration.\n2. **Add Provider**: Adds a new provider to the configuration, prompting for the provider's name, base URL, models, and keys.\n3. **Add Key to Existing Provider**: Adds a new API key to an existing provider.\n4. **Add Model to Existing Provider**: Adds a new model to an existing provider.\n5. **Modify Provider Settings**: Modifies the settings of an existing provider, such as the name, base URL, and Azure-specific settings.\n\n## File `api.json` Format\n\nMake sure all provider supports OpenAI API format.\n\nThe file is located in `./data/api.json`, make sure to create it if it doesn't exist, and keep it secure.\n\n```json\n{\n    \"userKeys\": [\n        {\n            \"name\": \"Test\",\n            \"key\": \"sk-123456\", // User key, generated locally\n            \"allowedProviders\": [ // Optional, if not provided, all providers are allowed\n                \"google-genai\" // Only allow Google GenAI provider\n            ],\n            \"allowedModels\": [ // Optional, if not provided, all models are allowed\n                \"gpt-4o-mini\", \"gemini-1.5-flash-latest\"\n            ]\n        }\n    ],\n    \"providers\": {\n        // Azure\n        \"azure\": {\n            \"name\": \"Azure OpenAI\",\n            \"azure\": true, // Required for Azure providers\n            \"azureAPIVersion\": \"2024-10-21\", // Azure API version\n            \"baseURL\": \"https://azure-openai.azure-api.net/v1\",\n            \"models\": [\"gpt-4o\", \"gpt-4o-mini\"],\n            \"keys\": [\"123456\"]\n        },\n        // Google provider\n        \"google-genai\": {\n            \"name\": \"Google GenAI\",\n            \"baseURL\": \"https://generativelanguage.googleapis.com/v1beta/openai\",\n            \"models\": [\n                // 2 Types: Object (Need casting), String (Direct)\n                {\n                    \"request\": \"gpt-4o-mini\", // Model name from request to be casted\n                    \"destination\": \"openai/gpt-4o-mini\" // Model name sent to provider\n                },\n                \"gemini-1.5-flash-latest\", // Direct model name, without casting\n            ],\n            \"keys\": [\n                // User provided\n                \"AIzaSyB1234567890\" // Provider key, which sends requests to the provider\n            ]\n        }\n    }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fckt1031%2Ftoupie","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fckt1031%2Ftoupie","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fckt1031%2Ftoupie/lists"}