🔑 Authentication
To authenticate with the API, you need to specify your API key in X-API-KEY
header of your http request.
This is how you would set the X-API-KEY
header in different languages:
Curl
curl --location --request GET 'https://api.neurolabs.ai/endpoint' \
--header 'X-API-KEY: YOUR_API_KEY'
Python
import requests
headers = {'X-API-KEY': 'YOUR_API_KEY'}
response = requests.get('https://api.neurolabs.ai/endpoint', headers=headers)
JavaScript (Node.js)
const axios = require('axios');
axios.get('https://api.neurolabs.ai/endpoint', {
headers: { 'X-API-KEY': 'YOUR_API_KEY' }
})
.then(response => {
console.log(response.data);
})
.catch(error => {
console.log(error);
});
Java
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
Request request = new Request.Builder()
.url("https://api.neurolabs.ai/endpoint")
.method("GET", null)
.addHeader("X-API-KEY", "YOUR_API_KEY")
.build();
Response response = client.newCall(request).execute();
C#
using System;
using System.Net.Http;
using System.Net.Http.Headers;
var client = new HttpClient();
client.DefaultRequestHeaders.Add("X-API-KEY", "YOUR_API_KEY");
var response = await client.GetAsync("https://api.neurolabs.ai/endpoint");
if (response.IsSuccessStatusCode)
{
var result = await response.Content.ReadAsStringAsync();
Console.WriteLine(result);
}
else
{
Console.WriteLine("Error: " + response.StatusCode);
}