from flask import Flask, request, jsonify import requests app = Flask(__name__) @app.route('/proxy/anthropic', methods=['POST']) def proxy(): api_key = request.headers.get('x-api-key') response = requests.post( 'https://api.anthropic.com/v1/messages', headers={ 'Content-Type': 'application/json', 'x-api-key': api_key, 'anthropic-version': '2024-01-01' }, json=request.json ) return jsonify(response.json()), response.status_code if __name__ == '__main__': app.run(host='0.0.0.0', port=7860)