{"id":13684297,"url":"https://github.com/missuo/claude2openai","last_synced_at":"2025-04-06T08:11:42.725Z","repository":{"id":228427829,"uuid":"773495472","full_name":"missuo/claude2openai","owner":"missuo","description":"Convert the Claude API to OpenAI compatible API.","archived":false,"fork":false,"pushed_at":"2025-03-11T19:33:16.000Z","size":44,"stargazers_count":101,"open_issues_count":1,"forks_count":14,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-03-30T07:11:09.759Z","etag":null,"topics":["claude-3","claude-api","openai-api"],"latest_commit_sha":null,"homepage":"","language":"Go","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/missuo.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}},"created_at":"2024-03-17T20:13:46.000Z","updated_at":"2025-03-25T14:30:09.000Z","dependencies_parsed_at":"2024-03-18T19:36:51.989Z","dependency_job_id":"bd4a3930-e078-4254-adff-73bb55a685dc","html_url":"https://github.com/missuo/claude2openai","commit_stats":null,"previous_names":["missuo/claude2openai"],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/missuo%2Fclaude2openai","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/missuo%2Fclaude2openai/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/missuo%2Fclaude2openai/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/missuo%2Fclaude2openai/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/missuo","download_url":"https://codeload.github.com/missuo/claude2openai/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247451653,"owners_count":20940939,"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","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":["claude-3","claude-api","openai-api"],"created_at":"2024-08-02T14:00:32.009Z","updated_at":"2025-04-06T08:11:42.701Z","avatar_url":"https://github.com/missuo.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"# Claude2OpenAI\nUsed to convert the Claude API to OpenAI compatible API. **Easily use Claude with any OpenAI compatible client.**\n\n## Compatibility\nCurrently it is only compatible with the Claude-3 family of models, if you pass in any other model, the default will be to use **claude-3-5-haiku-20241022**.\n\nYou can customize the list of allowed models by setting the `ALLOWED_MODELS` environment variable with a comma-separated list of model names. This is useful when new Claude models are released, allowing you to add support without rebuilding:\n\n```bash\n# Example: Setting custom allowed models\nexport ALLOWED_MODELS=\"claude-3-5-haiku-20241022,claude-3-5-sonnet-20241022,claude-3-haiku-20240307\"\n```\n\nThe first model in the list will be used as the default model.\n\n## Request Example\n```bash\ncurl http://127.0.0.1:6600/v1/chat/completions \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Authorization: Bearer sk-ant-xxxxxxxxxxxxxxxx\" \\\n  -d '{\n    \"model\": \"claude-3-5-haiku-20241022\",\n    \"messages\": [\n      {\n        \"role\": \"system\",\n        \"content\": \"翻译为中文!\"\n      },\n      {\n        \"role\": \"user\",\n        \"content\": \"Hello!\"\n      }\n    ],\n    \"stream\": true\n  }'\n```\n\n## Features\n\n### Image Support\n\nClaude2OpenAI supports images in the same format as OpenAI. You can include images in your messages using either base64-encoded images or URLs.\n\n```bash\ncurl http://127.0.0.1:6600/v1/chat/completions \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Authorization: Bearer sk-ant-xxxxxxxxxxxxxxxx\" \\\n  -d '{\n    \"model\": \"claude-3-5-sonnet-20241022\",\n    \"messages\": [\n      {\n        \"role\": \"user\",\n        \"content\": [\n          {\n            \"type\": \"text\",\n            \"text\": \"What's in this image?\"\n          },\n          {\n            \"type\": \"image_url\",\n            \"image_url\": {\n              \"url\": \"https://example.com/image.jpg\"\n            }\n          }\n        ]\n      }\n    ]\n  }'\n```\n\n### Debug Mode\n\nYou can enable debug mode to help troubleshoot issues:\n\n1. Using an environment variable:\n```bash\nDEBUG=true ./claude2openai\n```\n\n2. Using the command-line flag:\n```bash\n./claude2openai -debug\n```\n\nIn debug mode, detailed information about requests and responses will be logged to help with troubleshooting.\n\n## Usage\n### Homebrew (MacOS)\n\n**Special thanks to [Sma1lboy](https://github.com/Sma1lboy) for his contribution.**\n\n```bash\nbrew tap owo-network/brew\nbrew install claude2openai\n```\n\n\n### Docker\n\n```bash\ndocker run -d --restart always -p 6600:6600 ghcr.io/missuo/claude2openai:latest\n```\n\n```bash\ndocker run -d --restart always -p 6600:6600 missuo/claude2openai:latest\n```\n\nTo set custom allowed models with Docker:\n\n```bash\ndocker run -d --restart always -p 6600:6600 -e ALLOWED_MODELS=\"claude-3-5-haiku-20241022,claude-3-5-sonnet-20241022\" ghcr.io/missuo/claude2openai:latest\n```\n\n### Docker Compose\nIt is recommended that you use docker version **26.0.0** or higher, otherwise you need to specify the version in the `compose.yaml` file.\n```diff\n+version: \"3.9\"\n```\n\n```bash\nmkdir claude2openai \u0026\u0026 cd claude2openai\nwget -O compose.yaml https://raw.githubusercontent.com/missuo/claude2openai/main/compose.yaml\ndocker compose up -d\n```\n\n### Manual\n\nDownload the latest release from the [release page](https://github.com/missuo/claude2openai/releases).\n\n```bash\nchmod +x claude2openai\n./claude2openai\n```\n\n## License\n[MIT](https://github.com/missuo/claude2openai/blob/main/LICENSE)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmissuo%2Fclaude2openai","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmissuo%2Fclaude2openai","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmissuo%2Fclaude2openai/lists"}