Getting Started

Find API documentation, guides, and resources quickly using the search below.

Bineric API Documentation

Bineric API Platform is a high-performance generative AI inference platform designed for seamless model access customization, and scalability—delivering industry-leading speed and production-ready reliability.

Introduction

Bineric provides a comprehensive suite of AI APIs that enable you to integrate advanced language processing, file conversion, and monitoring capabilities into your applications. Our APIs are designed to be easy to use while providing powerful functionality.

Base URL

bash
https://api.bineric.com/api/v1

Authentication

🔑API Key Setup

Create an Account

Visit the Bineric platform and sign up for an account:

Click theGet Startedbutton to register.

Access Your API Key

Access your API keys on the dashboard using these provided steps:

Go to the API Key tab > generate your key.
Go to the Billing tab > add payment method.
Securely store your API key for future use.

Pay-Per-Use Access

Flexible Usage

Access all features with our simple pay-per-use model:

Pay only for what you use
No monthly commitments
Access to all models and features

Usage Benefits

Everything included with your API access:

Full access to all AI models
Flexible usage scaling
Technical support included

Available Models API

GET/ai/models

Get information about all available AI models

Response Format

json
{
    "success": true,
    "count": number,
    "data": [
      {
        "id": string,
        "name": string,
        "description": string,
        "type": string,
        "capabilities": string[],
        "provider": string,
        "pricing": {
          "input": string,
          "output": string,
          "cost_per_image": string,
          "currency": string
        },
        "limits": {
          "max_response_length": number
        },
        "file_support": {
          "image": object,
          "document": object,
          "max_files": number,
          "total_max_size_mb": number
        },
        "features": {
          "streaming": boolean,
          "vision": boolean,
          "image_generation": boolean,
          "nordic_support": boolean
        }
      }
    ]
  }

Code Examples

python
import requests
  
api_key = 'YOUR_API_KEY'
headers = {
    'api-key': api_key
}

response = requests.get(
    'https://api.bineric.com/api/v1/ai/models',
    headers=headers
)

models = response.json()
print(models)

File Conversion API

POST/media/base64

Convert various file types to base64 format with detailed metadata

File Support & Requirements

Audio Formats

  • MP3 (.mp3)
  • WAV (.wav)
  • M4A (.m4a)
  • OGG (.ogg)
  • AAC (.aac)
  • FLAC (.flac)
  • WMA (.wma)

Image Formats

  • JPEG/JPG (.jpg, .jpeg)
  • PNG (.png)
  • GIF (.gif)
  • WebP (.webp)

Document Formats

  • PDF (.pdf)
  • Word (.doc, .docx)
  • Excel (.xls, .xlsx)
  • Text (.txt)
  • CSV (.csv)

Size & Upload Limits

  • Maximum file size: 50MB
  • Single file per request
  • Authenticated requests only

Code Examples

python
import requests
  
  api_key = 'YOUR_API_KEY'
  
  # Example 1: Converting an image
  image_files = {
      'file': ('image.png', open('image.png', 'rb'), 'image/png')
  }
  response = requests.post(
      'https://api.bineric.com/api/v1/media/base64',
      headers={'api-key': api_key},
      files=image_files
  )
  
  # Example 2: Converting a document
  doc_files = {
      'file': ('document.pdf', open('document.pdf', 'rb'), 'application/pdf')
  }
  response = requests.post(
      'https://api.bineric.com/api/v1/media/base64',
      headers={'api-key': api_key},
      files=doc_files
  )
  
  result = response.json()
  print(result)

Response Format

json
{
    "success": true,
    "request_id": "req_1234567890",
    "data": {
      "base64String": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgA...",
      "originalName": "example.png",
      "fileInfo": {
        "extension": ".png",
        "mimeType": "image/png",
        "category": "image"
      },
      "size": {
        "original": 1234567,
        "base64": 1645678
      }
    }
}

Error Responses

Validation Error (400)

json
{
    "success": false,
    "request_id": "req_1234567890",
    "error": {
      "type": "ValidationError",
      "message": "File size exceeds 50MB",
      "code": 400
    }
  }

Server Error (500)

json
{
    "success": false,
    "request_id": "req_1234567890",
    "error": {
      "type": "ConversionError",
      "message": "Failed to convert file",
      "details": "Error message details",
      "code": 500
    }
  }

Chat Completions API

POST/ai/chat/completions

AI-powered comprehensive web research with detailed reports and citations

Available Models

Pay Per Use
ModelCapabilities
GPT-4New
Most powerful GPT-4 model. Hosted in the EU (Stockholm).
gpt-4
TextCodeAnalysisVision
Deep ResearchNew
AI-powered comprehensive web research with detailed reports and citations.
deep-research
TextWeb ResearchAnalysisCitations
O1New
Advanced AI model with improved reasoning and efficiency.
o1
TextCodeAnalysisVision
o3-miniNew
Lightweight reasoning model optimized for speed and efficiency. Hosted in the EU (Stockholm).
o3-mini
TextCodeAnalysis
Gemini 1.5 Flash
Google's advanced AI
gemini-1.5-flash
TextCodeVision
Gemini 2.0 FlashNew
Best for Multimodal understanding, Native tool use.
gemini-2.0-flash
TextCodeVision
Gemini 2.5 FlashNew
Best for Large scale processing, low latency, high volume tasks, Agentic use cases.
gemini-2.5-flash-preview-04-17
TextCodeVision
Gemini 2.5 ProNew
Best for Coding, Reasoning, Multimodal understanding.
gemini-2.5-pro
TextCodeVision
NorskGPT
Nordic language specialist
norskgpt
TextCodeAnalysisNordic
Meta Llama 3.1 8B
Improved reasoning, optimized for dialogue and AI training.
meta-llama-3.1-8b
TextCode
Meta Llama 3.1 405B
Meta's language model
meta-llama
TextCode
Meta Llama 3.3 70B
High-performance AI with advanced language understanding.
meta-llama-3.3-70b
TextCode
Claude 3.7 SonnetNew
Anthropic's most advanced model. Hosted in the EU (Frankfurt).
claude-3.7-sonnet
TextCodeAnalysisVision
DeepSeek-v3New
DeepSeek 671B model. Hosted in the EU
deepseek-v3
TextCodeAnalysis
DeepSeek-R1New
DeepSeek's new reasoning model. Hosted in the EU
deepseek-r1
TextCodeAnalysis
Speech to Text
Audio transcription service. Hosted in the EU (Stockholm).
speech-to-text
Speech-to-TextDiarization
Text to SpeechNew
High-quality speech synthesis service. Hosted in the EU (Stockholm).
text-to-speech
Text-to-SpeechMultiple LanguagesVoice Control
Stability AI
Image generation specialist
stability-ai
Image Generation
Mistral Large 24.02New
The most advanced model by Mistral. Hosted in the EU (Paris).
mistral_large_24_02
TextCodeAnalysisRAGAgents
Llama 4 MaverickNew
A 17 billion model with 128 experts for text and image tasks.
llama4-maverick
TextCodeAnalysisVision
Llama 4 ScoutNew
A 17 billion model with 16 experts for text and image tasks.
llama4-scout
TextCodeAnalysisVision

Request Format

json
{
  "model": string,       // Required: Model identifier
  "messages": [         // Required: Array of messages
    {
      "role": string,   // "user" or "assistant" 
      "content": string,
      "attachments": string[]  // Optional: Array of base64-encoded files
    }
  ],
  "options": {
    "temperature": number,  // 0-1, default: 0.7  
    "max_response_length": number,  // Varies by model
    "top_p": number       // 0-1, default: 0.95
  }
}

File Support

Image Files

  • Supported formats: JPEG, PNG, WebP, GIF, HEIC
  • Max file size: 20MB (varies by model)
  • Max dimensions: 4096x4096 (varies by model)
  • Files are automatically optimized (resized/compressed)
json
{
  "messages": [{
    "role": "user",
    "content": "What's in this image?",
    "attachments": [
      "data:image/jpeg;base64,/9j/4AAQSkZJRg..." // Base64 encoded image 
    ]
  }]
}

Document Files

  • Supported formats: PDF, DOCX, DOC, XLSX, XLS, TXT, CSV, MD, JSON, HTML
  • Max file size: 15MB (varies by model)
  • Max pages: 150 (varies by model)
  • Text extraction is automatic for supported formats
json
{
  "messages": [{
    "role": "user", 
    "content": "Summarize this document",
    "attachments": [
      "data:application/pdf;base64,JVBERi0xLj..." // Base64 encoded PDF
    ]  
  }]
}

Audio Files

  • Max file size: 200MB
  • Audio is automatically processed for optimal transcription
json
{
  "messages": [{
    "role": "user",
    "content": "Transcribe this audio",
    "attachments": [
      "data:audio/wav;base64,UklGRiQ..." // Base64 encoded audio 
    ]
  }]  
}

Text to Speech

  • High-quality 24khz/160kbps audio output
  • Multiple language and voice support (including Norwegian)
  • SSML support for advanced voice control
  • Returns base64 encoded MP3 audio

Supported Languages and Voices

Supported Languages

🇳🇴
Norwegian
NOnb-NO
🇺🇸
English (US)
USen-US
🇬🇧
English (UK)
GBen-GB
🇸🇪
Swedish
SEsv-SE
🇩🇰
Danish
DKda-DK

Norwegian Voices

Male Voices

Finn
NOnb-NO-FinnNeural

Female Voices

Iselin
NOnb-NO-IselinNeural
Pernille
NOnb-NO-PernilleNeural
json

{
  "messages": [{
    "role": "user",
    "content": "Convert this text to speech" 
  }],
  "options": {
    "language": "nb-NO",          // Norwegian
    "voice": "nb-NO-PernilleNeural", // Female Norwegian voice
    "pitch": "+10%",              // Optional pitch adjustment 
    "rate": "0.9",               // Optional speech rate
    "volume": "+20%"             // Optional volume adjustment
  }  
}

Audio Playback

The API returns base64 encoded audio that can be played directly in the browser.

json
// Play Base64 MP3 Audio

function playBase64Audio (base64Audio) => {
  const audioBase64 = base64Audio.replace(/^data:audio\/mp3;base64,/, '');

  const byteCharacters = atob(audioBase64);
  const byteArrays = [];

  for (let i = 0; i < byteCharacters.length; i++) {
    byteArrays.push(byteCharacters.charCodeAt(i));
  }

  const byteArray = new Uint8Array(byteArrays);
  const blob = new Blob([byteArray], { type: 'audio/mp3' });

  const audioUrl = URL.createObjectURL(blob);  
  const audio = new Audio(audioUrl);
  audio.play();
};

// Usage Example:
const base64AudioResponse = '...'; // Base64 string from API
playBase64Audio(base64AudioResponse);  
      

Code Examples

python
import requests
import base64

api_key = 'YOUR_API_KEY'
headers = {
    'api-key': api_key,
    'Content-Type': 'application/json'
}

# Function to encode file to base64
def encode_file(file_path):
    with open(file_path, 'rb') as file:
        return base64.b64encode(file.read()).decode('utf-8')

# Example with image attachment  
image_base64 = encode_file('image.jpg')
data = {
    'model': 'gpt-4',
    'messages': [
        {
            'role': 'user',
            'content': 'What's in this image?',
            'attachments': [f'data:image/jpeg;base64,{image_base64}'] 
        }
    ],
    'options': {
        'temperature': 0.7,
        'max_response_length': 800  
    }
}

response = requests.post(
    'https://api.bineric.com/api/v1/ai/chat/completions',
    headers=headers,
    json=data
)

result = response.json()
print(result)

Response Format

json
{
  "success": true,
  "request_id": "req_1234567890",
  "model": "gpt-4",
  "response": "Generated text response...", 
  "usage": {
    "prompt_tokens": 124,
    "completion_tokens": 356,  
    "total_tokens": 480,
    "total_cost": 0.00738,
    "response_time_ms": 2150,
    "account_info": {
      "type": "paid",           // "paid" or "free" 
      "balance": 95.26,         // Only for paid users
      "model_cost": {           // Only for paid users
        "input_cost_per_1k": 0.005,
        "output_cost_per_1k": 0.015
      }  
    },
    "current_usage": {          // Daily usage statistics
      "requests_made": 5,  
      "total_input_tokens": 1240,
      "total_output_tokens": 3560,
      "total_cost": 0.03738
    }
  }
}

Error Handling

json
{
  "success": false,
  "request_id": "req_1234567890", 
  "error": {
    "type": "ValidationError", 
    "message": "Detailed error message",
    "code": 400
  }
}

Common Errors

  • ValidationError: Invalid request parameters (400)
  • AuthError: Invalid or missing API key (401)
  • PaidFeatureError: Attempt to use paid features with free tier (403)
  • RateLimitError: Free tier daily limit exceeded (429)
  • InsufficientBalance: Insufficient funds for paid tier (402)
  • ProcessingError: Model processing failed (500)

Deep Research API

POST/ai/chat/completions

AI-powered comprehensive web research with detailed reports and citations

Overview

The Deep Research API provides AI-powered comprehensive web research capabilities. It performs extensive web searches on any topic, analyzes the information, and returns a detailed report with proper citations. This feature is fully integrated into the Unified API with both standard and streaming response options.

Request Format

json
{
  "model": "deep-research",
  "messages": [
    {
      "role": "user",
      "content": "What are the latest advancements in quantum computing?"
    }
  ],
  "options": {
    "stream": false, // Optional: Enable streaming for real-time updates (default: false)
    "maxDepth": 5, // Optional: Number of research iterations (default: 5)
    "timeLimit": 180, // Optional: Time limit in seconds (default: 180)
    "maxUrls": 5 // Optional: Maximum URLs to analyze (default: 5)
  }
}

Required Parameters

  • model: Must be set to "deep-research" to use this feature
  • messages: An array of message objects. The last user message will be used as the research query

Optional Parameters

ParameterTypeDefaultDescription
streambooleanfalseWhether to return results as a stream of events
maxDepthnumber5Number of research iterations to perform
timeLimitnumber180Maximum time in seconds for the research
maxUrlsnumber5Maximum number of URLs to analyze

Response Types

The Deep Research API supports two response types:

  1. Standard Response (Non-Streaming)

    When using the default stream: false option, the API returns a single JSON response after the research completes:

    json
    {
      "success": true,
      "request_id": "req_1234567890_abcdef",
      "model": "Deep Research",
      "response": "Detailed research analysis...",
      "citations": [
        {
          "title": "Source Title",
          "url": "https://example.com/article",
          "snippet": "Relevant excerpt from the source"
        }
        // More sources...
      ],
      "activities": [
        {
          "type": "searching",
          "message": "Searching for latest quantum computing research"
        }
        // More activities...
      ],
      "deep_research_info": {
        "usage_count": 5,
        "usage_limit": 50,
        "usage_left": 45
      },
      "usage": {
        "prompt_tokens": 20,
        "completion_tokens": 1500,
        "total_tokens": 1520,
        "total_cost": 0.25,
        "response_time_ms": 12345,
        "account_info": {
          "type": "paid",
          "balance": 9.75,
          "model_cost": {
            "cost_per_call": 0.25,
            "pricing_model": "fixed_cost_per_call"
          }
        },
        "current_usage": {
          "requests_made": 6,
          "total_input_tokens": 120,
          "total_output_tokens": 9000,
          "total_cost": 1.5
        }
      }
    }
  2. Streaming Response

    When using stream: true, the API returns a stream of Server-Sent Events (SSE) with the following event types:

    a. Info Event (start of research)
    javascript
    event: info
    data: {
      "request_id": "req_1234567890_abcdef",
      "model": "Deep Research",
      "message": "Deep research started"
    }
    b. Activity Events (progress updates)
    javascript
    event: activity
    data: {
      "type": "searching",
      "message": "Searching for latest quantum computing research",
      "request_id": "req_1234567890_abcdef"
    }

    Activity types include:

    • search: Information about search queries and results
    • analyze: Updates about analysis of search results
    • synthesis: Status of final report generation
    c. Complete Event (final results)
    javascript
    event: complete
    data: {
      "success": true,
      "request_id": "req_1234567890_abcdef",
      "model": "Deep Research",
      "response": "Detailed research analysis...",
      "citations": [
        {
          "title": "Source Title",
          "url": "https://example.com/article",
          "snippet": "Relevant excerpt from the source"
        }
      ],
      "activities": [...],
      "deep_research_info": {
        "usage_count": 5,
        "usage_limit": 50,
        "usage_left": 45
      },
      "usage": {
        "prompt_tokens": 20,
        "completion_tokens": 1500,
        "total_tokens": 1520,
        "total_cost": 0.25,
        "response_time_ms": 12345,
        "account_info": {
          "type": "paid",
          "balance": 9.75,
          "model_cost": {
            "cost_per_call": 0.25,
            "pricing_model": "fixed_cost_per_call"
          }
        },
        "current_usage": {
          "requests_made": 6,
          "total_input_tokens": 120,
          "total_output_tokens": 9000,
          "total_cost": 1.50
        }
      }
    }
    d. Error Event (if an error occurs)
    javascript
    event: error
    data: {
      "success": false,
      "request_id": "req_1234567890_abcdef",
      "error": {
        "type": "ProcessingError",
        "message": "An error occurred during research",
        "code": 500
      }
    }

Error Responses

The API returns structured error responses with the following format:

json
{
  "success": false,
  "request_id": "req_1234567890_abcdef",
  "error": {
    "type": "ErrorType",
    "message": "Error message details",
    "code": 400
  }
}

Common error types:

TypeCodeDescription
ValidationError400Invalid request parameters
EligibilityError403User not eligible for Deep Research
RateLimitError429Too many requests or rate limit exceeded
ProcessingError500Server error during processing

Usage Limits and Pricing

  • Fixed price: $0.25 USD per call
  • Usage limits:
    • Regular users: 50 calls per month
    • Team accounts: 70 calls per month
  • Unused calls do not roll over to the next month

Code Examples

javascript
// Example using EventSource for streaming
function performStreamingDeepResearch(query, callbacks) {
  // Set up default callbacks
  const {
    onStart = () => {},
    onActivity = () => {},
    onComplete = () => {},
    onError = () => {},
  } = callbacks || {};

  // Set up the request
  const body = JSON.stringify({
    model: 'deep-research',
    messages: [{ role: 'user', content: query }],
    options: {
      stream: true,
      maxDepth: 5,
      timeLimit: 180,
      maxUrls: 5,
    },
  });

  // Create a unique request ID for the EventSource URL
  const requestId = `req_${Date.now()}_${Math.random().toString(36).slice(2)}`;

  // Use fetch to start a streaming connection
  fetch('https://api.bineric.com/api/v1/ai/chat/completions', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
      'api-key': 'YOUR_API_KEY',
      Accept: 'text/event-stream',
    },
    body: body,
  })
    .then((response) => {
      if (!response.ok) {
        throw new Error(`HTTP error! status: ${response.status}`);
      }

      // Create event source from response body
      const reader = response.body.getReader();
      const decoder = new TextDecoder();
      let buffer = '';

      function processEvents(result) {
        if (result.done) return;

        // Decode and append to buffer
        buffer += decoder.decode(result.value, { stream: true });

        // Process events in buffer
        const lines = buffer.split('\n\n');
        buffer = lines.pop() || ''; // Keep the last potentially incomplete event

        for (const eventData of lines) {
          if (!eventData.trim()) continue;

          // Parse the event
          const eventLines = eventData.split('\n');
          const eventType = eventLines[0].replace('event: ', '');
          const data = JSON.parse(eventLines[1].replace('data: ', ''));

          // Handle different event types
          switch (eventType) {
            case 'info':
              onStart(data);
              break;
            case 'activity':
              onActivity(data);
              break;
            case 'complete':
              onComplete(data);
              return; // End processing
            case 'error':
              onError(data.error);
              return; // End processing
            default:
              console.warn('Unknown event type:', eventType);
          }
        }

        // Continue reading
        reader.read().then(processEvents);
      }

      // Start reading the stream
      reader.read().then(processEvents);
    })
    .catch((error) => {
      onError({ type: 'ConnectionError', message: error.message });
    });
}

Best Practices

  1. Use Streaming for Long Queries: For complex research topics that may take more than a few seconds, use streaming mode to provide real-time feedback to users
  2. Handle Errors Gracefully: Implement proper error handling to provide helpful feedback to users when research fails
  3. Limit Query Length: Keep research queries clear and focused for best results
  4. Manage Rate Limits: Track the user's remaining Deep Research usage and inform them when they're running low
  5. Display Citations Properly: Always display source citations alongside research results for proper attribution

Limitations

  • Maximum of 5 parallel search queries by default
  • Research may take up to 3 minutes for complex topics
  • Usage is limited to 50/70 calls per month depending on account type
  • Research is conducted only in languages supported by the search engine

Decoded Base64 API

POST/decode-base64

Decode Base64 content and return the original file.

Code Examples

python
import requests

headers = {
    'api-key': 'YOUR_API_KEY',
    'Content-Type': 'application/json'
}

response = requests.post(
    'https://api.bineric.com/api/v1/decode-base64',
    json={ 'data': 'data:image/png;base64,//' },
    headers=headers
)

with open("output_file.png", "wb") as file:
    file.write(response.content)

Response Format

json
// Returns binary file with headers:
Content-Type: detected mime type
Content-Disposition: inline; filename="file.ext"

Usage Statistics API

GET/monitoring/usage

Get detailed usage statistics for AI model interactions.

Query Parameters

ParameterTypeRequiredDescription
startDatestringNoStart date for statistics (YYYY-MM-DD)
endDatestringNoEnd date for statistics (YYYY-MM-DD)

Code Examples

python
import requests
  
  api_key = 'YOUR_API_KEY'
  headers = {
      'api-key': api_key
  }
  
  params = {
      'startDate': '2024-01-01',
      'endDate': '2024-01-31'
  }
  
  response = requests.get(
      'https://api.bineric.com/api/v1/monitoring/usage',
      headers=headers,
      params=params
  )
  
  stats = response.json()
  print(stats)

Response Format

json
{
  "success": true,
    "data": {
      "by_model": [
        {
          "model": string,
          "usage": {
            "input_tokens": number,
            "output_tokens": number,
            "total_cost": number,
            "request_count": number
          }
        }
      ],
      "total_usage": {
        "total_cost": number,
        "total_tokens": number,
        "total_requests": number
      },
      "period": {
        "start": string,
        "end": string
      }
    }
  }

Daily Usage Status API

GET/monitoring/daily-usage

Get daily usage metrics and payment status.

Code Examples

python
import requests
  
api_key = 'YOUR_API_KEY'
headers = {
    'api-key': api_key
}

response = requests.get(
    'https://api.bineric.com/api/v1/monitoring/daily-usage',
    headers=headers
)

usage = response.json()
print(usage)

Response Format

json
{
    "success": true,
    "data": {
      "payment_status": {
        "active": boolean,
        "expires_at": "2024-12-31T23:59:59.999Z"  // Only included if payment is active
      },
      "today_usage": {
        "requests": number,
        "input_tokens": number,
        "output_tokens": number,
        "total_cost": number
      },
      "last_request": {
        "time": "2024-12-31T23:59:59.999Z",
        "model": string,
        "cost": number
      }
    }
}

Balance and Usage API

GET/monitoring/balance

Get detailed balance and usage information.

Code Examples

python
import requests
  
api_key = 'YOUR_API_KEY'
headers = {
    'api-key': api_key
}

response = requests.get(
    'https://api.bineric.com/api/v1/monitoring/balance',
    headers=headers
)

balance = response.json()
print(balance)

Response Format

json
{
    "success": true,
    "data": {
      "balance": number,
      "inputTokens": number,
      "outputTokens": number,
      "lastUpdated": "2024-12-31T23:59:59.999Z",
      "payment_status": {
        "active": boolean,
        "expires": "2024-12-31T23:59:59.999Z"  // Only included if payment is active
      },
      "usage": {
        "daily": {
          "requests": number,
          "tokens": {
            "input": number,
            "output": number
          },
          "cost": number
        },
        "total": {
          "input_tokens": number,
          "output_tokens": number
        }
      }
    }
}