import type { Metadata } from "next";
import { BreadcrumbJsonLd, WebPageJsonLd } from "@/components/seo";
import ApiContent from "./ApiContent";

const BASE_URL = "https://llmhosts.com";

export const metadata: Metadata = {
  title: "API Reference — OpenAI and Anthropic Compatible Endpoints",
  description:
    "Complete API reference for LLMHosts. OpenAI-compatible chat completions and models endpoints, Anthropic messages API, authentication, and response headers.",
  alternates: {
    canonical: `${BASE_URL}/docs/api`,
  },
  openGraph: {
    title: "LLMHosts API Reference",
    description:
      "OpenAI and Anthropic compatible API endpoints with authentication, request/response examples, and custom headers.",
    url: `${BASE_URL}/docs/api`,
    siteName: "LLMHosts",
    type: "website",
    images: [
      {
        url: `${BASE_URL}/og?page=docs`,
        width: 1200,
        height: 630,
        alt: "LLMHosts API Reference",
      },
    ],
  },
  twitter: {
    card: "summary_large_image",
    title: "LLMHosts API Reference",
    description: "OpenAI + Anthropic compatible endpoints, auth, and headers.",
    images: [`${BASE_URL}/og?page=docs`],
  },
};

export default function ApiPage() {
  return (
    <>
      <BreadcrumbJsonLd
        items={[
          { name: "Home", url: BASE_URL },
          { name: "Documentation", url: `${BASE_URL}/docs` },
          { name: "API Reference", url: `${BASE_URL}/docs/api` },
        ]}
      />
      <WebPageJsonLd
        name="LLMHosts API Reference"
        description="Complete API reference for LLMHosts. OpenAI and Anthropic compatible endpoints."
        url={`${BASE_URL}/docs/api`}
      />
      <ApiContent />
    </>
  );
}
