API Documentation
Welcome to the NextGenDeepAI API documentation. Our API allows you to integrate state-of-the-art language models directly into your applications with ease.
Authentication
All API requests require a valid API key. You can generate and manage your API keys from the Dashboard.
Generate Text
POSThttps://nextgendeepai.com/api/llm/v1/generate
Headers
| Name | Value | Description |
|---|---|---|
| Content-Type | application/json | Required |
| X-API-Key | <your_api_key> | Your unique API key |
Body Parameters
| Parameter | Type | Description |
|---|---|---|
| prompt | string | The input text for the model. |
| model | string | Model ID (default: "qwen:0.5b"). |
| stream | boolean | Whether to stream the response. |
Available Models
We support a variety of open-source small language models optimized for different use cases.
| Model Name | Parameters | Context Length | Best For |
|---|---|---|---|
| qwen:0.5b | 0.5B | 32k | General purpose, extremely fast inference, low latency. |
| llama3 | 8B | 8k | High quality reasoning, creative writing, complex tasks. |
| mistral | 7B | 8k | Balanced performance, strong instruction following, coding. |
| gemma | 2B / 7B | 8k | Lightweight, efficient, Google's open model family. |
Code Examples
Curl
curl -X POST https://nextgendeepai.com/api/llm/v1/generate \
-H "Content-Type: application/json" \
-H "X-API-Key: YOUR_API_KEY" \
-d '{
"model": "qwen:0.5b",
"prompt": "Explain quantum computing",
"stream": false
}'Python
import requests
url = "https://nextgendeepai.com/api/llm/v1/generate"
headers = {
"Content-Type": "application/json",
"X-API-Key": "YOUR_API_KEY"
}
data = {
"model": "qwen:0.5b",
"prompt": "Explain quantum computing",
"stream": False
}
response = requests.post(url, json=data, headers=headers)
print(response.json())Java
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Main {
public static void main(String[] args) throws Exception {
String apiKey = "YOUR_API_KEY";
String jsonBody = "{\"model\":\"qwen:0.5b\",\"prompt\":\"Explain quantum computing\",\"stream\":false}";
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://nextgendeepai.com/api/llm/v1/generate"))
.header("Content-Type", "application/json")
.header("X-API-Key", apiKey)
.POST(HttpRequest.BodyPublishers.ofString(jsonBody))
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}