API Keys
Retrieve or create yur API Key from the dashboard. Learn more about it here.
sk_live for production and sk_test for our test environment (coming soon).
cURL
curl -X GET https://api.bitgpt.xyz/auth/debug_token \
-H "Authorization: Bearer YOUR_API_KEY"
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
$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;
?>
import requests
headers = {
'Authorization': 'Bearer YOUR_API_KEY'
}
response = requests.get('https://api.bitgpt.xyz/auth/debug_token', headers=headers)
print(response.json())
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());
}
}
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();
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))
}
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(())
}

