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_tokens": 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

Generate AI responses using various models.

Available Models

Pay Per Use
ModelCapabilities
GPT-4New
Most powerful GPT-4 model. Hosted in the EU (Stockholm).
gpt-4
TextCodeAnalysisVision
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
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_tokens": 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_tokens': 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)

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
        }
      }
    }
  }