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

# Send an API Request

<Card title="API Keys" icon="key" href="/developer-resources/get-started/api-keys" arrow="true">
  Retrieve or create yur API Key from the dashboard. Learn more about it here.
</Card>

Your API key starts with `sk_live` for production and `sk_test` for our test environment (coming soon).

<CodeGroup dropdown>
  ```bash cURL theme={"system"}
  curl -X GET https://api.bitgpt.xyz/auth/debug_token \
    -H "Authorization: Bearer YOUR_API_KEY"
  ```

  ```javascript Example.js lines wrap theme={"system"}
  const fetch = require('node-fetch');

  fetch('https://api.bitgpt.xyz/auth/debug_token', {
    method: 'GET',
    headers: {
      'Authorization': 'Bearer YOUR_API_KEY'
    }
  })
  .then(res => res.json())
  .then(data => console.log(data));
  ```

  ```php Example.php lines wrap theme={"system"}
  <?php

  $ch = curl_init('https://api.bitgpt.xyz/auth/debug_token');
  curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'Authorization: Bearer YOUR_API_KEY'
  ]);
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  $response = curl_exec($ch);
  curl_close($ch);
  echo $response;

  ?>
  ```

  ```python Example.py lines wrap theme={"system"}
  import requests

  headers = {
    'Authorization': 'Bearer YOUR_API_KEY'
  }

  response = requests.get('https://api.bitgpt.xyz/auth/debug_token', headers=headers)
  print(response.json())
  ```

  ```java Example.java lines wrap theme={"system"}
  import java.io.BufferedReader;
  import java.io.InputStreamReader;
  import java.net.HttpURLConnection;
  import java.net.URL;

  public class AuthCheck {
    public static void main(String[] args) throws Exception {
      URL url = new URL("https://api.bitgpt.xyz/auth/debug_token");
      HttpURLConnection con = (HttpURLConnection) url.openConnection();
      con.setRequestMethod("GET");
      con.setRequestProperty("Authorization", "Bearer YOUR_API_KEY");

      BufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream()));
      String inputLine;
      StringBuffer content = new StringBuffer();

      while ((inputLine = in.readLine()) != null) {
        content.append(inputLine);
      }
      in.close();

      System.out.println(content.toString());
    }
  }
  ```

  ```typescript Example.ts wrap lines theme={"system"}
  import fetch from 'node-fetch';

  async function checkAuth() {
    const res = await fetch('https://api.bitgpt.xyz/auth/debug_token', {
      method: 'GET',
      headers: {
        'Authorization': 'Bearer YOUR_API_KEY'
      }
    });

    const data = await res.json();
    console.log(data);
  }

  checkAuth();
  ```

  ```go Example.go wrap lines theme={"system"}
  package main

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

  func main() {
    client := &http.Client{}
    req, _ := http.NewRequest("GET", "https://api.bitgpt.xyz/auth/debug_token", nil)
    req.Header.Add("Authorization", "Bearer YOUR_API_KEY")

    res, err := client.Do(req)
    if err != nil {
      panic(err)
    }
    defer res.Body.Close()

    body, _ := io.ReadAll(res.Body)
    fmt.Println(string(body))
  }
  ```

  ```rust Example.rs wrap lines theme={"system"}
  use reqwest::blocking::Client;

  fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = Client::new();
    let res = client
      .get("https://api.bitgpt.xyz/auth/debug_token")
      .header("Authorization", "Bearer YOUR_API_KEY")
      .send()?
      .text()?;

    println!("{}", res);
    Ok(())
  }

  ```
</CodeGroup>
