Getting Started
Authentication
All API requests require authentication using an API Token. When you sign up for MCP GNNAIS services, you'll receive an API Token that grants you access to the API.
Authorization Header Example:
Authorization: Bearer YOUR_API_TOKEN
Environment Setup
We provide a Postman Collection for easy API testing and integration. Follow these steps to set up your environment:
- Download the MCP GNNAIS API Postman Collection (Download Now)
- Import the collection into Postman
- Set up your environment variables:
Variable Description baseUrl https://mcp.gnnais.com/api API_KEY Your personal API key received after signing up
Making Your First Request
Let's make a simple request to the Cognition API using OpenAI integration:
Request Example:
{
"generative_source": "open-ai",
"model": "gpt-4.1-nano-2025-04-14",
"instruction": "You are a helpful AI assistant that provides accurate and concise information.",
"prompt": "What is artificial intelligence?"
}
API Reference
Cognition API
The Cognition API provides endpoints for text-based AI processing using various OpenAI models.
Text Completion (OpenAI)
POSTGenerate text completions based on a prompt using various OpenAI models.
/cognition/make-completion
Request Body
{
"generative_source": "open-ai",
"model": "gpt-4.1-nano-2025-04-14",
"instruction": "You are a helpful AI assistant that provides accurate and concise information.",
"prompt": "whats is www.mcp.gnnais.com?"
}
Parameters
| Parameter | Type | Description |
|---|---|---|
| generative_source | string | The AI provider (use "open-ai" for OpenAI models) |
| model | string | The specific model to use (e.g., "gpt-4.1-nano-2025-04-14") |
| instruction | string | System message to guide the model's behavior |
| prompt | string | The user's question or input text |
Response
{
"success": true,
"http_code": 200,
"completion": "MCP GNNAIS (www.mcp.gnnais.com) is a next-generation AI integration platform that provides multicognitive processing capabilities. It integrates various generative AI models to process and solve complex user requests through a REST API interface. The platform allows users to access different AI models, including OpenAI models, through a secure authentication system.",
"usage": {
"prompt_tokens": 29,
"completion_tokens": 178,
"total_tokens": 207
},
"generative_source": "open-ai",
"model": "gpt-4.1-nano-2025-04-14"
}
Vision API
The Vision API provides endpoints for image-based AI processing using OpenAI models.
Image Interpretation (OpenAI)
POSTAnalyze and interpret images using OpenAI's Vision model.
/vision/image-interpreter
Request Body
{
"generative_source": "open-ai",
"model": "gpt-4.1-mini",
"instruction": "You are a helpful AI assistant that provides accurate and concise information.",
"prompt": "What objects can you see in this image? Provide a detailed description.",
"image": "https://mcp.gnnais.com/sx/assets/mcp-icon.png"
}
Parameters
| Parameter | Type | Description |
|---|---|---|
| generative_source | string | The AI provider (use "open-ai" for OpenAI models) |
| model | string | The specific model to use (e.g., "gpt-4.1-mini") |
| instruction | string | System message to guide the model's behavior |
| prompt | string | The user's question about the image |
| image | string | URL of the image to analyze |
Response
{
"success": true,
"http_code": 200,
"analysis": "In this image, I can see the MCP GNNAIS logo. It appears to be a stylized icon with a modern, minimalist design that likely represents the company's focus on AI and technology. The icon uses a purple or blue gradient color scheme, which is common in tech and AI branding to convey innovation and creativity. The design seems to have abstract elements that might symbolize neural networks or AI processing capabilities.",
"usage": {
"prompt_tokens": 53,
"completion_tokens": 163,
"total_tokens": 216
},
"generative_source": "open-ai",
"model": "gpt-4.1-mini"
}
Available OpenAI Models
MCP GNNAIS API supports all OpenAI models. You must specify which model you want to use in your request. Below are some of the popular models available:
| Model | Description |
|---|---|
| gpt-4.1 | Latest OpenAI model with advanced capabilities |
| gpt-4.1-nano | Fastest GPT-4.1 model variant |
| gpt-4.1-mini | Compact GPT-4.1 model with good performance |
| gpt-4o | GPT-4 Omni model with text and image capabilities |
| gpt-4o-mini | Smaller version of GPT-4o with lower cost |
| gpt-4 | OpenAI's high-capacity text model |
| gpt-3.5-turbo | Balanced model for most text generation tasks |
When making API requests, simply specify your preferred model in the "model" parameter. Our system will automatically route your request to the appropriate OpenAI model.
Rate Limits & Error Handling
Rate Limits
Rate limits vary based on your subscription plan. If you exceed your rate limit, the API will return a 429 Too Many Requests response.
Error Handling
Our API uses standard HTTP response codes. Here are some common error codes:
| Status Code | Description |
|---|---|
| 200 | Success |
| 400 | Bad Request - The request was malformed |
| 401 | Unauthorized - Authentication failed |
| 403 | Forbidden - You don't have permission |
| 429 | Too Many Requests - Rate limit exceeded |
| 500 | Internal Server Error - Something went wrong on our end |