Getting Started
Welcome to the official Ikalas API documentation. You will find here all the necessary information to use the Ikalas API.
Ikalas offers a unified API that gives you access to hundreds of AI models through a single entry point. Here’s how to get started.
Create your Ikalas account
Go to https://ikalas.com and create your account.
Create your API key
Go to https://dashboard.ikalas.com/_api and create your API key.
Read this documentation to learn how to use the API
Start using the API
A simple example to get started
Ask the AI for a 100-word biography of Napoleon Bonaparte.
// Import the axios library to make HTTP requests
const axios = require("axios");
// Prepare the data to send to the API
let data = JSON.stringify({
system: "You are a useful assistant", // System message that defines the AI's behavior
prompt: "Biography of Napoleon Bonaparte in 100 words", // Your question or request to the AI
models: "meta-llama/llama-3.3-70b-instruct:free", // The AI model to use
response_format: "default", // Desired response format
});
// HTTP request configuration
let config = {
method: "post", // HTTP method: POST to send data
maxBodyLength: Infinity, // No limit on request body size
url: "https://ikalas.com/api/v1/api-llm", // Ikalas API endpoint URL
headers: {
accept: "application/json", // Accepted response type
apikey: "YOUR_API_KEY_HERE", // Your API key (replace with your actual key)
"content-type": "application/json", // Content type being sent
},
data: data, // Data to send (defined above)
};
// Execute the request with response handling
axios
.request(config)
.then((response) => {
// On success, display the API response
console.log(JSON.stringify(response.data));
})
.catch((error) => {
// On error, display error details
console.log(error);
});
Detailed code explanations
1. Axios import:
const axios = require("axios");
Axios is a popular JavaScript library for making HTTP requests. It simplifies sending requests to APIs.
2. Data preparation:
let data = JSON.stringify({
system: "You are a useful assistant",
prompt: "Biography of Napoleon Bonaparte in 100 words",
models: "meta-llama/llama-3.3-70b-instruct:free",
response_format: "default",
});
system
: Defines the role or behavior of the AIprompt
: Your specific question or requestmodels
: The AI model to use (here Llama 3.3 70B free)response_format
: Desired response format
3. Request configuration:
let config = {
method: "post",
maxBodyLength: Infinity,
url: "https://ikalas.com/api/v1/api-llm-ia",
headers: {
accept: "application/json",
apikey: "YOUR_API_KEY_HERE",
"content-type": "application/json",
},
data: data,
};
method: "post"
: Uses the POST method to send dataurl
: The Ikalas API endpointheaders
: Request metadata including your API keydata
: Data to send to the API
Important notes
- Replace
"YOUR_API_KEY_HERE"
with your actual API key obtained from the dashboard - The
meta-llama/llama-3.3-70b-instruct:free
model is free, use any AI model available on Ikalas. - You can change the
prompt
to ask your own questions
Last updated on