Update app.py
Browse files
app.py
CHANGED
|
@@ -491,7 +491,7 @@ def index():
|
|
| 491 |
|
| 492 |
return jsonify({"rpm": rpm, "tpm": tpm, "rpd": rpd, "tpd": tpd})
|
| 493 |
|
| 494 |
-
@app.route('/
|
| 495 |
def list_models():
|
| 496 |
if not check_authorization(request):
|
| 497 |
return jsonify({"error": "Unauthorized"}), 401
|
|
@@ -541,7 +541,7 @@ def list_models():
|
|
| 541 |
"data": detailed_models
|
| 542 |
})
|
| 543 |
|
| 544 |
-
@app.route('/
|
| 545 |
def billing_usage():
|
| 546 |
if not check_authorization(request):
|
| 547 |
return jsonify({"error": "Unauthorized"}), 401
|
|
@@ -554,7 +554,7 @@ def billing_usage():
|
|
| 554 |
"total_usage": 0
|
| 555 |
})
|
| 556 |
|
| 557 |
-
@app.route('/
|
| 558 |
def billing_subscription():
|
| 559 |
if not check_authorization(request):
|
| 560 |
return jsonify({"error": "Unauthorized"}), 401
|
|
@@ -588,8 +588,8 @@ def billing_subscription():
|
|
| 588 |
"system_hard_limit_usd": total_balance
|
| 589 |
})
|
| 590 |
|
| 591 |
-
@app.route('/
|
| 592 |
-
def
|
| 593 |
if not check_authorization(request):
|
| 594 |
return jsonify({"error": "Unauthorized"}), 401
|
| 595 |
|
|
@@ -669,8 +669,8 @@ def handsome_embeddings():
|
|
| 669 |
except requests.exceptions.RequestException as e:
|
| 670 |
return jsonify({"error": str(e)}), 500
|
| 671 |
|
| 672 |
-
@app.route('/
|
| 673 |
-
def
|
| 674 |
if not check_authorization(request):
|
| 675 |
return jsonify({"error": "Unauthorized"}), 401
|
| 676 |
|
|
@@ -779,8 +779,8 @@ def handsome_images_generations():
|
|
| 779 |
else:
|
| 780 |
return jsonify({"error": "Unsupported model"}), 400
|
| 781 |
|
| 782 |
-
@app.route('/
|
| 783 |
-
def
|
| 784 |
if not check_authorization(request):
|
| 785 |
return jsonify({"error": "Unauthorized"}), 401
|
| 786 |
|
|
|
|
| 491 |
|
| 492 |
return jsonify({"rpm": rpm, "tpm": tpm, "rpd": rpd, "tpd": tpd})
|
| 493 |
|
| 494 |
+
@app.route('/ai/v1/models', methods=['GET'])
|
| 495 |
def list_models():
|
| 496 |
if not check_authorization(request):
|
| 497 |
return jsonify({"error": "Unauthorized"}), 401
|
|
|
|
| 541 |
"data": detailed_models
|
| 542 |
})
|
| 543 |
|
| 544 |
+
@app.route('/ai/v1/dashboard/billing/usage', methods=['GET'])
|
| 545 |
def billing_usage():
|
| 546 |
if not check_authorization(request):
|
| 547 |
return jsonify({"error": "Unauthorized"}), 401
|
|
|
|
| 554 |
"total_usage": 0
|
| 555 |
})
|
| 556 |
|
| 557 |
+
@app.route('/ai/v1/dashboard/billing/subscription', methods=['GET'])
|
| 558 |
def billing_subscription():
|
| 559 |
if not check_authorization(request):
|
| 560 |
return jsonify({"error": "Unauthorized"}), 401
|
|
|
|
| 588 |
"system_hard_limit_usd": total_balance
|
| 589 |
})
|
| 590 |
|
| 591 |
+
@app.route('/ai/v1/embeddings', methods=['POST'])
|
| 592 |
+
def ai_embeddings():
|
| 593 |
if not check_authorization(request):
|
| 594 |
return jsonify({"error": "Unauthorized"}), 401
|
| 595 |
|
|
|
|
| 669 |
except requests.exceptions.RequestException as e:
|
| 670 |
return jsonify({"error": str(e)}), 500
|
| 671 |
|
| 672 |
+
@app.route('/ai/v1/images/generations', methods=['POST'])
|
| 673 |
+
def ai_images_generations():
|
| 674 |
if not check_authorization(request):
|
| 675 |
return jsonify({"error": "Unauthorized"}), 401
|
| 676 |
|
|
|
|
| 779 |
else:
|
| 780 |
return jsonify({"error": "Unsupported model"}), 400
|
| 781 |
|
| 782 |
+
@app.route('/ai/v1/chat/completions', methods=['POST'])
|
| 783 |
+
def ai_chat_completions():
|
| 784 |
if not check_authorization(request):
|
| 785 |
return jsonify({"error": "Unauthorized"}), 401
|
| 786 |
|