Nyari AI Developer API
Welcome to the Nyari AI API documentation! Our API provides a standard REST interface, making it seamless to integrate Nyari AI into your existing applications, Discord bots, or websites.
Base URL
All API requests should be prefixed with our production endpoint:
https://api-url.blackflamestudio.online/v1Authentication
The API uses API keys to authenticate requests. You can view and manage your API keys in your dashboard.
Warning: Your API keys carry many privileges, so be sure to keep them secure! Do not share your secret API keys in publicly accessible areas such as GitHub or client-side code.
All API requests must include your API key in an Authorization HTTP header, or alternatively using the x-api-market-key header as follows:
Authorization: Bearer YOUR_API_KEY
# OR
x-api-market-key: YOUR_API_KEYUsing with Node.js
You can easily integrate Nyari AI into your Node.js applications using native fetch:
const response = await fetch("https://api-url.blackflamestudio.online/v1/chat/completions", {
method: "POST",
headers: {
"x-api-market-key": "YOUR_API_KEY", // Or use Authorization: Bearer YOUR_API_KEY
"Content-Type": "application/json"
},
body: JSON.stringify({
model: "nyari-ai",
messages: [{ role: "user", content: "Hello!" }]
})
});
const data = await response.json();
console.log(data.choices[0].message.content);Endpoints
1. List Models
Lists the currently available models. This is useful for dynamically fetching the model ID required for chat completions.
- URL:
/v1/models - Method:
GET - Authentication Required: Yes
curl https://api-url.blackflamestudio.online/v1/models \
-H "x-api-market-key: YOUR_API_KEY"2. Chat Completions
Given a list of messages comprising a conversation, the model will return a response.
- URL:
/v1/chat/completions - Method:
POST - Authentication Required: Yes
Request Body Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
| messages | Array | Yes | A list of messages comprising the conversation so far. Each message needs a role and content. |
| temperature | Number | No | Sampling temperature. Higher values (0.8) make output random, lower values (0.2) make it deterministic. |
curl -X POST https://api-url.blackflamestudio.online/v1/chat/completions \
-H "Content-Type: application/json" \
-H "x-api-market-key: YOUR_API_KEY" \
-d '{
"messages": [
{
"role": "user",
"content": "Hello Nyari, how are you doing today?"
}
]
}'Native Features
Real-Time & Web Search Integration
Our API natively supports autonomous web searching. If your prompts require live information (weather, news), current date/time, or images, Nyari AI will automatically search the web and return the up-to-date context alongside related Markdown images in the response. No extra flags or parameters are required.
Limits and Errors
If a request fails, you will receive an error response in JSON format along with standard HTTP status codes:
- 401 Unauthorized: Missing or invalid API Key.
- 403 Forbidden: API key exists but token limits have been exceeded.
- 400 Bad Request: Malformed request body.
- 429 Too Many Requests: You have exceeded your rate limit.
- 500 Internal Server Error: An unexpected server error occurred.