49 lines
1.7 KiB
PHP
49 lines
1.7 KiB
PHP
<?php
|
|
header("Content-Type: application/json");
|
|
$out = [];
|
|
|
|
// 1. Image generation endpoints available
|
|
$candidates = [
|
|
"/var/www/html/api/wevia-image-gen.php",
|
|
"/var/www/html/api/qwen-image.php",
|
|
"/var/www/html/api/image-gen.php",
|
|
"/var/www/html/api/opus-image-gen.php",
|
|
];
|
|
$out["image_endpoints"] = [];
|
|
foreach (glob("/var/www/html/api/*image*.php") as $f) {
|
|
$out["image_endpoints"][] = basename($f);
|
|
}
|
|
foreach (glob("/var/www/html/api/*qwen*.php") as $f) {
|
|
$out["image_endpoints"][] = basename($f);
|
|
}
|
|
foreach (glob("/var/www/html/api/*dalle*.php") as $f) {
|
|
$out["image_endpoints"][] = basename($f);
|
|
}
|
|
|
|
// 2. Web/search endpoints
|
|
$out["search_endpoints"] = [];
|
|
foreach (glob("/var/www/html/api/*search*.php") as $f) $out["search_endpoints"][] = basename($f);
|
|
foreach (glob("/var/www/html/api/*web*.php") as $f) $out["search_endpoints"][] = basename($f);
|
|
foreach (glob("/var/www/html/api/*scrap*.php") as $f) $out["search_endpoints"][] = basename($f);
|
|
|
|
// 3. Check available API providers
|
|
$secrets = @file_get_contents("/etc/weval/secrets.env");
|
|
if ($secrets) {
|
|
preg_match_all("/^([A-Z_]+_API_KEY)=/m", $secrets, $m);
|
|
$out["api_keys_available"] = array_slice($m[1] ?? [], 0, 30);
|
|
}
|
|
|
|
// 4. Qwen / image providers
|
|
$providers_with_image = [];
|
|
if ($secrets) {
|
|
foreach (["DASHSCOPE", "QWEN", "TOGETHER", "REPLICATE", "OPENAI", "STABILITY", "FAL", "HUGGINGFACE", "ALIBABA"] as $p) {
|
|
if (preg_match("/^{$p}[A-Z_]*_API_KEY=\S{5,}/m", $secrets)) $providers_with_image[] = $p;
|
|
}
|
|
}
|
|
$out["providers_with_image_capable"] = $providers_with_image;
|
|
|
|
// 5. Pollinations.ai (FREE image gen, no auth)
|
|
$out["free_image_gen"] = ["pollinations.ai (no key)", "image.pollinations.ai/prompt/*"];
|
|
|
|
echo json_encode($out, JSON_PRETTY_PRINT|JSON_UNESCAPED_SLASHES);
|