> ## Documentation Index
> Fetch the complete documentation index at: https://docs.apolloai.lol/llms.txt
> Use this file to discover all available pages before exploring further.

# Health Check

> Check the health and latency of the API

Retrieve the current status of the API, along with latency and timestamp information.

### Headers

<ParamField header="x-api-key" type="string">
  Your Apollo AI API key (optional for health check).
</ParamField>

### Response

<ResponseField name="status" type="string">
  The status of the API (e.g., `success`).
</ResponseField>

<ResponseField name="latency" type="string">
  The time taken to process the request.
</ResponseField>

<ResponseField name="timestamp" type="string">
  The ISO timestamp of the request.
</ResponseField>

<RequestExample>
  ```bash Curl theme={null}
  curl -X GET "https://apolloai.lol/v1/health"
  ```

  ```python Python theme={null}
  import requests

  url = "https://apolloai.lol/v1/health"
  response = requests.get(url)
  print(response.json())
  ```

  ```javascript JavaScript theme={null}
  fetch("https://apolloai.lol/v1/health")
    .then(response => response.json())
    .then(console.log);
  ```

  ```go Go theme={null}
  package main

  import (
  	"fmt"
  	"net/http"
      "io/ioutil"
  )

  func main() {
  	url := "https://apolloai.lol/v1/health"
  	resp, _ := http.Get(url)
      defer resp.Body.Close()
      
      body, _ := ioutil.ReadAll(resp.Body)
  	fmt.Println(string(body))
  }
  ```

  ```java Java theme={null}
  import java.net.URI;
  import java.net.http.HttpClient;
  import java.net.http.HttpRequest;
  import java.net.http.HttpResponse;
  import java.net.http.HttpResponse.BodyHandlers;

  public class Main {
      public static void main(String[] args) throws Exception {
          String url = "https://apolloai.lol/v1/health";

          HttpClient client = HttpClient.newHttpClient();
          HttpRequest request = HttpRequest.newBuilder()
              .uri(URI.create(url))
              .GET()
              .build();

          client.sendAsync(request, BodyHandlers.ofString())
              .thenApply(HttpResponse::body)
              .thenAccept(System.out::println)
              .join();
      }
  }
  ```

  ```ruby Ruby theme={null}
  require 'uri'
  require 'net/http'

  url = URI("https://apolloai.lol/v1/health")

  http = Net::HTTP.new(url.host, url.port)
  http.use_ssl = true

  request = Net::HTTP::Get.new(url)

  response = http.request(request)
  puts response.read_body
  ```

  ```c C theme={null}
  #include <stdio.h>
  #include <curl/curl.h>

  int main(void) {
    CURL *curl;
    CURLcode res;

    curl = curl_easy_init();
    if(curl) {
      curl_easy_setopt(curl, CURLOPT_URL, "https://apolloai.lol/v1/health");
      res = curl_easy_perform(curl);
      curl_easy_cleanup(curl);
    }
    return 0;
  }
  ```

  ```rust Rust theme={null}
  use reqwest::Client;

  #[tokio::main]
  async fn main() -> Result<(), Box<dyn std::error::Error>> {
      let client = Client::new();
      let res = client.get("https://apolloai.lol/v1/health")
          .send()
          .await?;

      let body = res.text().await?;
      println!("{}", body);
      Ok(())
  }
  ```
</RequestExample>

<ResponseExample>
  ```json 200 OK theme={null}
  {
    "status": "success",
    "latency": "1.23ms",
    "timestamp": "2024-01-27T23:32:17.000Z"
  }
  ```
</ResponseExample>
