{"id":45297371,"url":"https://github.com/aprilnea/byokey","last_synced_at":"2026-04-11T21:22:00.364Z","repository":{"id":339655512,"uuid":"1162854015","full_name":"AprilNEA/BYOKEY","owner":"AprilNEA","description":"Turn AI subscriptions into standard API endpoints. OpenAI \u0026 Anthropic compatible gateway — for Amp Code, Cursor, Factory CLI, and more.","archived":false,"fork":false,"pushed_at":"2026-02-26T10:26:20.000Z","size":815,"stargazers_count":6,"open_issues_count":1,"forks_count":1,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-02-26T13:58:34.793Z","etag":null,"topics":["ai-gateway","amp","anthropic-api","claude","copilot","cursor","gemini","llm","oauth","openai-api","proxy","rust"],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AprilNEA.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE-APACHE","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":"AGENTS.md","dco":null,"cla":null}},"created_at":"2026-02-20T19:25:29.000Z","updated_at":"2026-02-26T10:25:42.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/AprilNEA/BYOKEY","commit_stats":null,"previous_names":["aprilnea/byokey"],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/AprilNEA/BYOKEY","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AprilNEA%2FBYOKEY","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AprilNEA%2FBYOKEY/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AprilNEA%2FBYOKEY/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AprilNEA%2FBYOKEY/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AprilNEA","download_url":"https://codeload.github.com/AprilNEA/BYOKEY/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AprilNEA%2FBYOKEY/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29892063,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-27T09:48:51.284Z","status":"ssl_error","status_checked_at":"2026-02-27T09:48:43.992Z","response_time":57,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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-gateway","amp","anthropic-api","claude","copilot","cursor","gemini","llm","oauth","openai-api","proxy","rust"],"created_at":"2026-02-21T04:09:16.874Z","updated_at":"2026-04-02T16:22:58.626Z","avatar_url":"https://github.com/AprilNEA.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\n# BYOKEY\n\n**Bring Your Own Keys**\u003cbr\u003e\nTurn AI subscriptions into standard API endpoints.\u003cbr\u003e\nExpose any provider as OpenAI- or Anthropic-compatible API — locally or in the cloud.\n\n[![ci](https://img.shields.io/github/actions/workflow/status/AprilNEA/BYOKEY/ci.yml?style=flat-square\u0026labelColor=000\u0026color=444\u0026label=ci)](https://github.com/AprilNEA/BYOKEY/actions/workflows/ci.yml)\n\u0026nbsp;\n[![crates.io](https://img.shields.io/crates/v/byokey?style=flat-square\u0026labelColor=000\u0026color=444)](https://crates.io/crates/byokey)\n\u0026nbsp;\n[![license](https://img.shields.io/badge/license-MIT%20%7C%20Apache--2.0-444?style=flat-square\u0026labelColor=000)](LICENSE-MIT)\n\u0026nbsp;\n[![rust](https://img.shields.io/badge/rust-1.85+-444?style=flat-square\u0026labelColor=000\u0026logo=rust\u0026logoColor=fff)](https://www.rust-lang.org)\n\n\u003c/div\u003e\n\n```\nSubscriptions                                     Tools\n\nClaude Pro  ─┐                              ┌──  Amp Code\nOpenAI Plus ─┼──  byokey serve  ────────────┼──  Cursor · Windsurf\nCopilot     ─┘                              ├──  Factory CLI (Droid)\n                                            └──  any OpenAI / Anthropic client\n```\n\n## Features\n\n- **Multi-format API** — OpenAI and Anthropic compatible endpoints; just change the base URL\n- **OAuth login flows** — PKCE, device-code, and auth-code flows handled automatically\n- **Token persistence** — SQLite at `~/.byokey/tokens.db`; survives restarts\n- **API key passthrough** — Set raw keys in config to skip OAuth entirely\n- **Deploy anywhere** — Run locally as a CLI, or deploy as a shared AI gateway\n- **Agent-ready** — Native support for [Amp Code](https://ampcode.com); [Factory CLI (Droid)](https://factory.ai) coming soon\n- **Hot-reload config** — YAML-based with sensible defaults\n\n## Supported Providers\n\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003ctd align=\"center\" width=\"120\"\u003e\n      \u003cimg src=\"https://assets.byokey.io/icons/providers/anthropic.svg\" width=\"36\" alt=\"Anthropic\"\u003e\u003cbr\u003e\n      \u003cb\u003eClaude\u003c/b\u003e\u003cbr\u003e\n      \u003csup\u003ePKCE\u003c/sup\u003e\u003cbr\u003e\n      \u003csub\u003eopus-4-6 · sonnet-4-5 · haiku-4-5\u003c/sub\u003e\n    \u003c/td\u003e\n    \u003ctd align=\"center\" width=\"120\"\u003e\n      \u003cimg src=\"https://assets.byokey.io/icons/providers/openai.svg\" width=\"36\" alt=\"OpenAI\"\u003e\u003cbr\u003e\n      \u003cb\u003eCodex\u003c/b\u003e\u003cbr\u003e\n      \u003csup\u003ePKCE\u003c/sup\u003e\u003cbr\u003e\n      \u003csub\u003eo4-mini · o3\u003c/sub\u003e\n    \u003c/td\u003e\n    \u003ctd align=\"center\" width=\"120\"\u003e\n      \u003cimg src=\"https://assets.byokey.io/icons/providers/githubcopilot.svg\" width=\"36\" alt=\"GitHub Copilot\"\u003e\u003cbr\u003e\n      \u003cb\u003eCopilot\u003c/b\u003e\u003cbr\u003e\n      \u003csup\u003eDevice code\u003c/sup\u003e\u003cbr\u003e\n      \u003csub\u003egpt-5.x · claude-sonnet-4.x · gemini-3.x\u003c/sub\u003e\n    \u003c/td\u003e\n    \u003ctd align=\"center\" width=\"120\"\u003e\n      \u003cimg src=\"https://assets.byokey.io/icons/providers/googlegemini.svg\" width=\"36\" alt=\"Google Gemini\"\u003e\u003cbr\u003e\n      \u003cb\u003eGemini\u003c/b\u003e\u003cbr\u003e\n      \u003csup\u003ePKCE\u003c/sup\u003e\u003cbr\u003e\n      \u003csub\u003e2.0-flash · 1.5-pro · 1.5-flash\u003c/sub\u003e\n    \u003c/td\u003e\n    \u003ctd align=\"center\" width=\"120\"\u003e\n      \u003cimg src=\"https://assets.byokey.io/icons/providers/amazonwebservices.svg\" width=\"36\" alt=\"AWS\"\u003e\u003cbr\u003e\n      \u003cb\u003eKiro\u003c/b\u003e\u003cbr\u003e\n      \u003csup\u003eDevice code\u003c/sup\u003e\u003cbr\u003e\n      \u003csub\u003ekiro-default\u003c/sub\u003e\n    \u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n\u003e **Coming soon** — auth implemented, executor in progress:\u003cbr\u003e\n\u003e Antigravity (Google) · Qwen (Alibaba) · Kimi (Moonshot) · iFlow (Z.ai)\n\n## Installation\n\n**Homebrew (macOS / Linux)**\n\n```sh\nbrew install AprilNEA/tap/byokey\n```\n\n**From crates.io**\n\n```sh\ncargo install byokey\n```\n\n**From source**\n\n```sh\ngit clone https://github.com/AprilNEA/BYOKEY\ncd BYOK\ncargo install --path .\n```\n\n\u003e **Requirements:** Rust 1.85+ (edition 2024), a C compiler for SQLite.\n\n## Quick Start\n\n```sh\n# 1. Authenticate (opens browser or shows a device code)\nbyokey login claude\nbyokey login codex\nbyokey login copilot\n\n# 2. Start the proxy\nbyokey serve\n\n# 3. Point your tool at it\nexport OPENAI_BASE_URL=http://localhost:8018/v1\nexport OPENAI_API_KEY=any          # byokey ignores the key value\n```\n\n**For Amp:**\n\n```jsonc\n// ~/.amp/settings.json\n{\n  \"amp.url\": \"http://localhost:8018/amp\"\n}\n```\n\n## CLI Reference\n\n```\nbyokey \u003cCOMMAND\u003e\n\nCommands:\n  serve         Start the proxy server (foreground)\n  start         Start the proxy server in the background\n  stop          Stop the background proxy server\n  restart       Restart the background proxy server\n  autostart     Manage auto-start on system boot\n  login         Authenticate with a provider\n  logout        Remove stored credentials for a provider\n  status        Show authentication status for all providers\n  accounts      List all accounts for a provider\n  switch        Switch the active account for a provider\n  amp           Amp-related utilities\n  openapi       Export the OpenAPI specification as JSON\n  completions   Generate shell completions\n  help          Print help\n```\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003eCommand details\u003c/b\u003e\u003c/summary\u003e\n\u003cbr\u003e\n\n**`byokey serve`**\n\n```\nOptions:\n  -c, --config \u003cFILE\u003e   Config file (JSON or YAML) [default: ~/.config/byokey/settings.json]\n  -p, --port \u003cPORT\u003e     Listen port     [default: 8018]\n      --host \u003cHOST\u003e     Listen address  [default: 127.0.0.1]\n      --db \u003cPATH\u003e       SQLite DB path  [default: ~/.byokey/tokens.db]\n```\n\n**`byokey start`** — Same options as `serve`, plus `--log-file` (default: `~/.byokey/server.log`).\n\n**`byokey login \u003cPROVIDER\u003e`**\n\nRuns the appropriate OAuth flow for the given provider.\nSupported names: `claude`, `codex`, `copilot`, `gemini`, `kiro`,\n`antigravity`, `qwen`, `kimi`, `iflow`.\n\n```\nOptions:\n      --db \u003cPATH\u003e   SQLite DB path [default: ~/.byokey/tokens.db]\n```\n\n**`byokey logout \u003cPROVIDER\u003e`** — Deletes the stored token for the given provider.\n\n**`byokey status`** — Prints authentication status for every known provider.\n\n**`byokey accounts \u003cPROVIDER\u003e`** — Lists all accounts for a provider.\n\n**`byokey switch \u003cPROVIDER\u003e`** — Switches the active account for a provider.\n\n**`byokey autostart \u003cenable|disable|status\u003e`** — Manages boot-time service registration.\n\n**`byokey amp \u003cinject|disable-ads\u003e`** — Amp utilities: inject proxy URL into Amp config, or patch Amp to hide ads.\n\n\u003c/details\u003e\n\n## Configuration\n\nCreate a config file (JSON or YAML, e.g. `~/.config/byokey/settings.json`) and pass it with `--config`:\n\n```yaml\nport: 8018\nhost: 127.0.0.1\n\nproviders:\n  # Use a raw API key (takes precedence over OAuth)\n  claude:\n    api_key: \"sk-ant-...\"\n\n  # Disable a provider entirely\n  gemini:\n    enabled: false\n\n  # OAuth-only (no api_key) — use `byokey login codex` first\n  codex:\n    enabled: true\n```\n\nAll fields are optional; unspecified providers are enabled by default and use\nthe OAuth token stored in the database.\n\n## Contributing\n\nSee [CONTRIBUTING.md](CONTRIBUTING.md) for build commands, architecture details, and coding guidelines.\n\n## License\n\nLicensed under either of [MIT](LICENSE-MIT) or [Apache-2.0](LICENSE-APACHE) at your option.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faprilnea%2Fbyokey","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faprilnea%2Fbyokey","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faprilnea%2Fbyokey/lists"}