claude web 转 openai api 接口
2025-08-03
深度学习
00

官网: https://claude.ai/chat

F12找到小饼干~

短信验证:https://sms-activate.io/freePrice#activation

项目:https://github.com/xxddccaa/claude2api-wUI

改写docker-compose.config-web.yml:

你必须要有PROXY,不然地区禁用。或者选美国服务器。WSL里这个会有回环,借助TCP隧道穿透避免回环。

bash
展开代码
version: '3' services: claude2api: image: ghcr.io/yushangxiao/claude2api:latest container_name: claude2api-with-config-web ports: - "8080:8080" environment: # Required: Your Claude session keys - SESSIONS=sk-ant-sid01-LKLHRFIgNE-xx-ZljvSAAA # Required: API key for authentication - APIKEY=xxxxxauthentication # Server configuration - ADDRESS=0.0.0.0:8080 # Enable the config web interface - ENABLE_CONFIG_WEB=true # Optional: Other configuration - PROXY=http://10.142.23.9:10808 # Optional - CHAT_DELETE=true - MAX_CHAT_HISTORY_LENGTH=10000 - NO_ROLE_PREFIX=false - PROMPT_DISABLE_ARTIFACTS=false - ENABLE_MIRROR_API=false - MIRROR_API_PREFIX=/mirror volumes: # Mount a volume to persist config.yaml changes - ./config:/app/config restart: unless-stopped # Example usage: # 1. Copy this file to docker-compose.yml # 2. Update the SESSIONS and APIKEY environment variables # 3. Run: docker-compose up -d # 4. Access the config web interface at: http://localhost:8080/config # 5. Use the APIKEY value for authentication in the browser

cursro可用:

image.png

curl可用:

bash
展开代码
curl -X POST http://10.126.150.28:8017/v1/chat/completions \ -H "Content-Type: application/json" \ -H "Authorization: Bearer xxxxxauthentication" \ -d '{ "model": "claude-sonnet-4-20250514", "messages": [ { "role": "user", "content": "你好,Claude!" } ], "stream": false }'
如果对你有用的话,可以打赏哦
打赏
ali pay
wechat pay

本文作者:Dong

本文链接:

版权声明:本博客所有文章除特别声明外,均采用 CC BY-NC。本作品采用《知识共享署名-非商业性使用 4.0 国际许可协议》进行许可。您可以在非商业用途下自由转载和修改,但必须注明出处并提供原作者链接。 许可协议。转载请注明出处!