import { env } from '@/lib/env';
export interface Endpoint {
  method: string;
  path: string;
  description: string;
  price: string;
}

export interface Service {
  id: string;
  name: string;
  serviceUrl: string;
  description: string;
  chain: string;
  currency: string;
  categories: string[];
  logo: string;
  endpoints: Endpoint[];
}

const BASE_URL = env.NEXT_PUBLIC_GATEWAY_URL ?? 'https://mpp.t2000.ai';

export const services: Service[] = [
  {
    id: 'openai',
    name: 'OpenAI',
    serviceUrl: `${BASE_URL}/openai`,
    description: 'Chat, embeddings, images, and audio.',
    chain: 'sui',
    currency: 'USDC',
    categories: ['ai', 'media'],
    logo: '/logos/openai.svg',
    endpoints: [
      { method: 'POST', path: '/v1/chat/completions', description: 'Chat completions (GPT-4o, o1, etc.)', price: '0.01' },
      { method: 'POST', path: '/v1/embeddings', description: 'Create embeddings', price: '0.001' },
      { method: 'POST', path: '/v1/images/generations', description: 'Generate images with gpt-image-1', price: '0.05' },
      { method: 'POST', path: '/v1/audio/transcriptions', description: 'Transcribe audio with Whisper', price: '0.01' },
      { method: 'POST', path: '/v1/audio/speech', description: 'Text-to-speech', price: '0.02' },
    ],
  },
  {
    id: 'anthropic',
    name: 'Anthropic',
    serviceUrl: `${BASE_URL}/anthropic`,
    description: 'Claude models — Sonnet, Opus, Haiku.',
    chain: 'sui',
    currency: 'USDC',
    categories: ['ai'],
    logo: '/logos/anthropic.svg',
    endpoints: [
      { method: 'POST', path: '/v1/messages', description: 'Chat completions (Sonnet, Opus, Haiku)', price: '0.01' },
    ],
  },
  {
    id: 'fal',
    name: 'fal.ai',
    serviceUrl: `${BASE_URL}/fal`,
    description: 'Image and audio generation — Flux, Recraft, Whisper.',
    chain: 'sui',
    currency: 'USDC',
    categories: ['ai', 'media'],
    logo: '/logos/fal.svg',
    endpoints: [
      { method: 'POST', path: '/fal-ai/flux/dev', description: 'Flux Dev image generation', price: '0.03' },
      { method: 'POST', path: '/fal-ai/flux-pro', description: 'Flux Pro image generation', price: '0.05' },
      { method: 'POST', path: '/fal-ai/flux-realism', description: 'Flux Realism (photorealistic)', price: '0.03' },
      { method: 'POST', path: '/fal-ai/recraft-20b', description: 'Recraft 20B image generation', price: '0.03' },
      { method: 'POST', path: '/fal-ai/whisper', description: 'Speech-to-text transcription', price: '0.01' },
    ],
  },
  {
    id: 'firecrawl',
    name: 'Firecrawl',
    serviceUrl: `${BASE_URL}/firecrawl`,
    description: 'Scrape, crawl, map, and extract from any website.',
    chain: 'sui',
    currency: 'USDC',
    categories: ['web', 'data'],
    logo: '/logos/firecrawl.svg',
    endpoints: [
      { method: 'POST', path: '/v1/scrape', description: 'Scrape a URL to structured data', price: '0.01' },
      { method: 'POST', path: '/v1/crawl', description: 'Crawl a website', price: '0.05' },
      { method: 'POST', path: '/v1/map', description: 'Discover URLs on a site', price: '0.01' },
      { method: 'POST', path: '/v1/extract', description: 'Extract structured data with LLM', price: '0.02' },
    ],
  },
  {
    id: 'gemini',
    name: 'Google Gemini',
    serviceUrl: `${BASE_URL}/gemini`,
    description: 'Gemini chat, reasoning, and embeddings.',
    chain: 'sui',
    currency: 'USDC',
    categories: ['ai'],
    logo: '/logos/gemini.svg',
    endpoints: [
      { method: 'POST', path: '/v1beta/models/gemini-2.5-flash', description: 'Gemini 2.5 Flash (fast, multimodal)', price: '0.005' },
      { method: 'POST', path: '/v1beta/models/gemini-2.5-pro', description: 'Gemini 2.5 Pro (reasoning)', price: '0.02' },
      { method: 'POST', path: '/v1beta/models/embedding-001', description: 'Text embeddings', price: '0.001' },
    ],
  },
  {
    id: 'groq',
    name: 'Groq',
    serviceUrl: `${BASE_URL}/groq`,
    description: 'Ultra-fast LLM inference — Llama, Mixtral, Gemma.',
    chain: 'sui',
    currency: 'USDC',
    categories: ['ai'],
    logo: '/logos/groq.svg',
    endpoints: [
      { method: 'POST', path: '/v1/chat/completions', description: 'Chat completions (Llama 3, Mixtral, Gemma)', price: '0.005' },
      { method: 'POST', path: '/v1/audio/transcriptions', description: 'Audio transcription (Whisper)', price: '0.005' },
    ],
  },
  {
    id: 'perplexity',
    name: 'Perplexity',
    serviceUrl: `${BASE_URL}/perplexity`,
    description: 'AI search with real-time web citations.',
    chain: 'sui',
    currency: 'USDC',
    categories: ['ai', 'search'],
    logo: '/logos/perplexity.svg',
    endpoints: [
      { method: 'POST', path: '/v1/chat/completions', description: 'Sonar search (web-grounded answers)', price: '0.01' },
    ],
  },
  {
    id: 'brave',
    name: 'Brave Search',
    serviceUrl: `${BASE_URL}/brave`,
    description: 'Web, image, news, and video search with AI summaries.',
    chain: 'sui',
    currency: 'USDC',
    categories: ['search'],
    logo: '/logos/brave.svg',
    endpoints: [
      { method: 'POST', path: '/v1/web/search', description: 'Web search results', price: '0.005' },
      { method: 'POST', path: '/v1/images/search', description: 'Image search', price: '0.005' },
      { method: 'POST', path: '/v1/news/search', description: 'News search', price: '0.005' },
      { method: 'POST', path: '/v1/videos/search', description: 'Video search', price: '0.005' },
      { method: 'POST', path: '/v1/summarizer/search', description: 'AI-summarized search', price: '0.01' },
    ],
  },
  {
    id: 'deepseek',
    name: 'DeepSeek',
    serviceUrl: `${BASE_URL}/deepseek`,
    description: 'DeepSeek reasoning and chat models.',
    chain: 'sui',
    currency: 'USDC',
    categories: ['ai'],
    logo: '/logos/deepseek.svg',
    endpoints: [
      { method: 'POST', path: '/v1/chat/completions', description: 'Chat completions (DeepSeek-V3, R1 reasoning)', price: '0.005' },
    ],
  },
  {
    id: 'resend',
    name: 'Resend',
    serviceUrl: `${BASE_URL}/resend`,
    description: 'Transactional and batch email delivery.',
    chain: 'sui',
    currency: 'USDC',
    categories: ['communication'],
    logo: '/logos/resend.svg',
    endpoints: [
      { method: 'POST', path: '/v1/emails', description: 'Send an email', price: '0.005' },
      { method: 'POST', path: '/v1/emails/batch', description: 'Send batch emails (up to 100)', price: '0.01' },
    ],
  },
  {
    id: 'together',
    name: 'Together AI',
    serviceUrl: `${BASE_URL}/together`,
    description: 'Open-source models — Llama, Qwen, Mixtral, FLUX.',
    chain: 'sui',
    currency: 'USDC',
    categories: ['ai', 'media'],
    logo: '/logos/together.svg',
    endpoints: [
      { method: 'POST', path: '/v1/chat/completions', description: 'Chat completions (Llama 4, Qwen, Mixtral)', price: '0.005' },
      { method: 'POST', path: '/v1/images/generations', description: 'Image generation (FLUX, Stable Diffusion)', price: '0.03' },
      { method: 'POST', path: '/v1/embeddings', description: 'Text embeddings', price: '0.001' },
    ],
  },
  {
    id: 'elevenlabs',
    name: 'ElevenLabs',
    serviceUrl: `${BASE_URL}/elevenlabs`,
    description: 'AI voice synthesis, cloning, and sound effects.',
    chain: 'sui',
    currency: 'USDC',
    categories: ['ai', 'media'],
    logo: '/logos/elevenlabs.svg',
    endpoints: [
      { method: 'POST', path: '/v1/text-to-speech/:voiceId', description: 'Text-to-speech (any voice)', price: '0.05' },
      { method: 'POST', path: '/v1/sound-generation', description: 'AI sound effects generation', price: '0.05' },
    ],
  },
  {
    id: 'openweather',
    name: 'OpenWeather',
    serviceUrl: `${BASE_URL}/openweather`,
    description: 'Current weather, forecasts, and climate data.',
    chain: 'sui',
    currency: 'USDC',
    categories: ['data'],
    logo: '/logos/openweather.svg',
    endpoints: [
      { method: 'POST', path: '/v1/weather', description: 'Current weather by city or coordinates', price: '0.005' },
      { method: 'POST', path: '/v1/forecast', description: '5-day / 3-hour forecast', price: '0.005' },
    ],
  },
  {
    id: 'googlemaps',
    name: 'Google Maps',
    serviceUrl: `${BASE_URL}/googlemaps`,
    description: 'Geocoding, places search, and directions.',
    chain: 'sui',
    currency: 'USDC',
    categories: ['data'],
    logo: '/logos/googlemaps.svg',
    endpoints: [
      { method: 'POST', path: '/v1/geocode', description: 'Address to coordinates (and reverse)', price: '0.01' },
      { method: 'POST', path: '/v1/places', description: 'Text-based places search', price: '0.01' },
      { method: 'POST', path: '/v1/directions', description: 'Route directions between locations', price: '0.01' },
    ],
  },
  {
    id: 'judge0',
    name: 'Judge0',
    serviceUrl: `${BASE_URL}/judge0`,
    description: 'Execute code in 70+ programming languages.',
    chain: 'sui',
    currency: 'USDC',
    categories: ['compute'],
    logo: '/logos/judge0.svg',
    endpoints: [
      { method: 'POST', path: '/v1/submissions', description: 'Submit and execute code', price: '0.005' },
      { method: 'POST', path: '/v1/languages', description: 'List supported languages', price: '0.001' },
    ],
  },
  {
    id: 'lob',
    name: 'Lob',
    serviceUrl: `${BASE_URL}/lob`,
    description: 'Send physical mail — postcards, letters, and address verification.',
    chain: 'sui',
    currency: 'USDC',
    categories: ['commerce'],
    logo: '/logos/lob.svg',
    endpoints: [
      { method: 'POST', path: '/v1/postcards', description: 'Send a physical postcard', price: '1.00' },
      { method: 'POST', path: '/v1/letters', description: 'Send a physical letter', price: '1.50' },
      { method: 'POST', path: '/v1/verify', description: 'Verify a US address', price: '0.01' },
    ],
  },
  {
    id: 'coingecko',
    name: 'CoinGecko',
    serviceUrl: `${BASE_URL}/coingecko`,
    description: 'Crypto prices, market data, and trending coins.',
    chain: 'sui',
    currency: 'USDC',
    categories: ['data'],
    logo: '/logos/coingecko.svg',
    endpoints: [
      { method: 'POST', path: '/v1/price', description: 'Get price for coins (by ID, vs currencies)', price: '0.005' },
      { method: 'POST', path: '/v1/markets', description: 'Market data — price, cap, volume, sparkline', price: '0.005' },
      { method: 'POST', path: '/v1/trending', description: 'Trending coins and searches', price: '0.005' },
    ],
  },
  {
    id: 'alphavantage',
    name: 'Alpha Vantage',
    serviceUrl: `${BASE_URL}/alphavantage`,
    description: 'Stock quotes, time series, and symbol search.',
    chain: 'sui',
    currency: 'USDC',
    categories: ['data'],
    logo: '/logos/alphavantage.svg',
    endpoints: [
      { method: 'POST', path: '/v1/quote', description: 'Real-time stock quote (price, change, volume)', price: '0.005' },
      { method: 'POST', path: '/v1/daily', description: 'Daily time series (OHLCV)', price: '0.005' },
      { method: 'POST', path: '/v1/search', description: 'Search for stock symbols by keyword', price: '0.005' },
    ],
  },
  {
    id: 'newsapi',
    name: 'NewsAPI',
    serviceUrl: `${BASE_URL}/newsapi`,
    description: 'Breaking news and article search across 150k+ sources.',
    chain: 'sui',
    currency: 'USDC',
    categories: ['data', 'search'],
    logo: '/logos/newsapi.svg',
    endpoints: [
      { method: 'POST', path: '/v1/headlines', description: 'Top headlines by country, category, or source', price: '0.005' },
      { method: 'POST', path: '/v1/search', description: 'Search articles by keyword, date range, language', price: '0.005' },
    ],
  },
  {
    id: 'deepl',
    name: 'DeepL',
    serviceUrl: `${BASE_URL}/deepl`,
    description: 'AI-powered translation across 30+ languages.',
    chain: 'sui',
    currency: 'USDC',
    categories: ['translation'],
    logo: '/logos/deepl.svg',
    endpoints: [
      { method: 'POST', path: '/v1/translate', description: 'Translate text with context-aware AI', price: '0.005' },
    ],
  },
  {
    id: 'exa',
    name: 'Exa',
    serviceUrl: `${BASE_URL}/exa`,
    description: 'AI-native semantic search — finds content by meaning.',
    chain: 'sui',
    currency: 'USDC',
    categories: ['search', 'ai'],
    logo: '/logos/exa.svg',
    endpoints: [
      { method: 'POST', path: '/v1/search', description: 'Semantic search with optional content extraction', price: '0.01' },
      { method: 'POST', path: '/v1/contents', description: 'Extract clean content from URLs', price: '0.01' },
    ],
  },
  {
    id: 'jina',
    name: 'Jina Reader',
    serviceUrl: `${BASE_URL}/jina`,
    description: 'Convert any URL to clean LLM-ready markdown.',
    chain: 'sui',
    currency: 'USDC',
    categories: ['web', 'data'],
    logo: '/logos/jina.svg',
    endpoints: [
      { method: 'POST', path: '/v1/read', description: 'Read a URL and return clean markdown', price: '0.005' },
    ],
  },
  {
    id: 'serper',
    name: 'Serper',
    serviceUrl: `${BASE_URL}/serper`,
    description: 'Google Search results as structured JSON — fast and cheap.',
    chain: 'sui',
    currency: 'USDC',
    categories: ['search'],
    logo: '/logos/serper.svg',
    endpoints: [
      { method: 'POST', path: '/v1/search', description: 'Google web search with rich snippets', price: '0.005' },
      { method: 'POST', path: '/v1/images', description: 'Google image search results', price: '0.005' },
    ],
  },
  {
    id: 'screenshot',
    name: 'ScreenshotOne',
    serviceUrl: `${BASE_URL}/screenshot`,
    description: 'Capture any webpage as PNG, JPEG, or PDF.',
    chain: 'sui',
    currency: 'USDC',
    categories: ['web'],
    logo: '/logos/screenshot.svg',
    endpoints: [
      { method: 'POST', path: '/v1/capture', description: 'Screenshot a URL (configurable viewport, format)', price: '0.01' },
    ],
  },
  {
    id: 'pdfshift',
    name: 'PDFShift',
    serviceUrl: `${BASE_URL}/pdfshift`,
    description: 'Convert HTML or URLs to professional PDF documents.',
    chain: 'sui',
    currency: 'USDC',
    categories: ['web', 'data'],
    logo: '/logos/pdfshift.svg',
    endpoints: [
      { method: 'POST', path: '/v1/convert', description: 'Convert HTML source or URL to PDF', price: '0.01' },
    ],
  },
  {
    id: 'qrcode',
    name: 'QR Code',
    serviceUrl: `${BASE_URL}/qrcode`,
    description: 'Generate QR codes for any URL or text.',
    chain: 'sui',
    currency: 'USDC',
    categories: ['data'],
    logo: '/logos/qrcode.svg',
    endpoints: [
      { method: 'POST', path: '/v1/generate', description: 'Generate a QR code image (PNG, SVG)', price: '0.005' },
    ],
  },
  {
    id: 'replicate',
    name: 'Replicate',
    serviceUrl: `${BASE_URL}/replicate`,
    description: 'Run any open-source ML model — Llama, SDXL, Whisper, and thousands more.',
    chain: 'sui',
    currency: 'USDC',
    categories: ['ai', 'media'],
    logo: '/logos/replicate.svg',
    endpoints: [
      { method: 'POST', path: '/v1/predictions', description: 'Run a model (sync — waits for result)', price: '0.02' },
      { method: 'POST', path: '/v1/predictions/status', description: 'Check prediction status by ID', price: '0.001' },
    ],
  },
  {
    id: 'stability',
    name: 'Stability AI',
    serviceUrl: `${BASE_URL}/stability`,
    description: 'Image generation and editing — Stable Diffusion 3, search-and-replace.',
    chain: 'sui',
    currency: 'USDC',
    categories: ['ai', 'media'],
    logo: '/logos/stability.svg',
    endpoints: [
      { method: 'POST', path: '/v1/generate', description: 'Generate an image from text (SD3)', price: '0.03' },
      { method: 'POST', path: '/v1/edit', description: 'Search-and-replace edit on an image', price: '0.03' },
    ],
  },
  {
    id: 'assemblyai',
    name: 'AssemblyAI',
    serviceUrl: `${BASE_URL}/assemblyai`,
    description: 'Advanced transcription — speaker labels, summaries, chapters.',
    chain: 'sui',
    currency: 'USDC',
    categories: ['ai', 'media'],
    logo: '/logos/assemblyai.svg',
    endpoints: [
      { method: 'POST', path: '/v1/transcribe', description: 'Submit audio URL for transcription', price: '0.02' },
      { method: 'POST', path: '/v1/result', description: 'Get transcription result by ID (free — paid on submit)', price: '0.001' },
    ],
  },
  {
    id: 'hunter',
    name: 'Hunter.io',
    serviceUrl: `${BASE_URL}/hunter`,
    description: 'Find professional email addresses by domain or verify deliverability.',
    chain: 'sui',
    currency: 'USDC',
    categories: ['data'],
    logo: '/logos/hunter.svg',
    endpoints: [
      { method: 'POST', path: '/v1/search', description: 'Find emails by domain name', price: '0.02' },
      { method: 'POST', path: '/v1/verify', description: 'Verify an email address', price: '0.02' },
    ],
  },
  {
    id: 'ipinfo',
    name: 'IPinfo',
    serviceUrl: `${BASE_URL}/ipinfo`,
    description: 'IP geolocation, ASN, company, and VPN detection.',
    chain: 'sui',
    currency: 'USDC',
    categories: ['data'],
    logo: '/logos/ipinfo.svg',
    endpoints: [
      { method: 'POST', path: '/v1/lookup', description: 'Look up IP address details (geo, ASN, company)', price: '0.005' },
    ],
  },
  {
    id: 'translate',
    name: 'Google Translate',
    serviceUrl: `${BASE_URL}/translate`,
    description: 'Translation and language detection — 130+ languages.',
    chain: 'sui',
    currency: 'USDC',
    categories: ['translation'],
    logo: '/logos/translate.svg',
    endpoints: [
      { method: 'POST', path: '/v1/translate', description: 'Translate text between languages', price: '0.005' },
      { method: 'POST', path: '/v1/detect', description: 'Detect the language of text', price: '0.005' },
    ],
  },
  {
    id: 'serpapi',
    name: 'SerpAPI',
    serviceUrl: `${BASE_URL}/serpapi`,
    description: 'Google, Bing, YouTube search results with structured data.',
    chain: 'sui',
    currency: 'USDC',
    categories: ['search'],
    logo: '/logos/serpapi.svg',
    endpoints: [
      { method: 'POST', path: '/v1/search', description: 'Google search with rich structured results', price: '0.01' },
      { method: 'POST', path: '/v1/flights', description: 'Google Flights search — routes, prices, airlines', price: '0.01' },
      { method: 'POST', path: '/v1/locations', description: 'Search locations for geo-targeted queries', price: '0.005' },
    ],
  },
  {
    id: 'printful',
    name: 'Printful',
    serviceUrl: `${BASE_URL}/printful`,
    description: 'Print-on-demand — shirts, mugs, posters, shipped to any address.',
    chain: 'sui',
    currency: 'USDC',
    categories: ['commerce'],
    logo: '/logos/printful.svg',
    endpoints: [
      { method: 'POST', path: '/v1/products', description: 'Browse catalog — all products, or by ID for sizes/colors', price: '0.005' },
      { method: 'POST', path: '/v1/estimate', description: 'Get shipping and cost estimate for an order', price: '0.005' },
      { method: 'POST', path: '/v1/order', description: 'Place a print-on-demand order (dynamic price: cost + 5%)', price: 'dynamic' },
    ],
  },
  {
    id: 'pushover',
    name: 'Pushover',
    serviceUrl: `${BASE_URL}/pushover`,
    description: 'Instant push notifications to iOS, Android, and desktop.',
    chain: 'sui',
    currency: 'USDC',
    categories: ['messaging'],
    logo: '/logos/pushover.svg',
    endpoints: [
      { method: 'POST', path: '/v1/push', description: 'Send a push notification', price: '0.005' },
    ],
  },
  {
    id: 'mistral',
    name: 'Mistral',
    serviceUrl: `${BASE_URL}/mistral`,
    description: 'European AI models — Mistral Large, Codestral, Mixtral.',
    chain: 'sui',
    currency: 'USDC',
    categories: ['ai'],
    logo: '/logos/mistral.svg',
    endpoints: [
      { method: 'POST', path: '/v1/chat/completions', description: 'Chat completions (Mistral Large, Codestral, Mixtral)', price: '0.005' },
      { method: 'POST', path: '/v1/embeddings', description: 'Generate text embeddings', price: '0.005' },
    ],
  },
  {
    id: 'cohere',
    name: 'Cohere',
    serviceUrl: `${BASE_URL}/cohere`,
    description: 'Embeddings, reranking, and RAG-optimized models.',
    chain: 'sui',
    currency: 'USDC',
    categories: ['ai'],
    logo: '/logos/cohere.svg',
    endpoints: [
      { method: 'POST', path: '/v1/chat', description: 'Chat with Command models', price: '0.005' },
      { method: 'POST', path: '/v1/embed', description: 'Generate text embeddings', price: '0.005' },
      { method: 'POST', path: '/v1/rerank', description: 'Rerank search results by relevance', price: '0.005' },
    ],
  },
  {
    id: 'virustotal',
    name: 'VirusTotal',
    serviceUrl: `${BASE_URL}/virustotal`,
    description: 'URL and file security scanning — 70+ antivirus engines.',
    chain: 'sui',
    currency: 'USDC',
    categories: ['security'],
    logo: '/logos/virustotal.svg',
    endpoints: [
      { method: 'POST', path: '/v1/scan', description: 'Scan a URL or file hash for threats', price: '0.01' },
    ],
  },
  {
    id: 'exchangerate',
    name: 'ExchangeRate',
    serviceUrl: `${BASE_URL}/exchangerate`,
    description: 'Live forex rates for 160+ currencies.',
    chain: 'sui',
    currency: 'USDC',
    categories: ['finance'],
    logo: '/logos/exchangerate.svg',
    endpoints: [
      { method: 'POST', path: '/v1/rates', description: 'Get exchange rates for a base currency', price: '0.005' },
      { method: 'POST', path: '/v1/convert', description: 'Convert an amount between two currencies', price: '0.005' },
    ],
  },
  {
    id: 'shortio',
    name: 'Short.io',
    serviceUrl: `${BASE_URL}/shortio`,
    description: 'URL shortening with click analytics.',
    chain: 'sui',
    currency: 'USDC',
    categories: ['utility'],
    logo: '/logos/shortio.svg',
    endpoints: [
      { method: 'POST', path: '/v1/shorten', description: 'Shorten a URL', price: '0.005' },
    ],
  },
];
