NeuraSutra API Management Overview

NeuraSutra API Management is a FastAPI-based middleware for managing access to multiple AI service providers with centralized API key management, real-time token tracking, and cost analysis.

URL for the hosted server: NeuraSutra API Management

What It Does

  • Centralized API Access: Single interface to multiple AI providers (Google Gemini, OpenAI, Anthropic, DeepSeek)
  • Cost Tracking: Real-time token counting and cost calculation per request
  • Rate Limiting: Configurable soft warnings and hard blocks at hourly/daily/monthly levels
  • Usage Analytics: Comprehensive logging and audit trails
  • Secure Key Management: Encrypted storage of provider API keys

Supported Providers

Provider Module Capabilities
Google Gemini google.gemini_text Text, vision, audio, video, streaming
Google Gemini google.gemini_image Image generation, editing
OpenAI openai.chat GPT models, vision, streaming
Anthropic anthropic.claude Claude models, streaming
DeepSeek deepseek.chat DeepSeek models

Architecture

┌─────────────────┐      ┌─────────────────────────────┐     ┌──────────────┐
│  Your Python    │─────>│  NeuraSutra API Management  │────>│  AI Provider │
│  Application    │<─────│  (FastAPI Middleware)       │<────│  (Gemini,    │
└─────────────────┘      │                             │     │   OpenAI)    │
                         │  • Auth & Rate Limiting     │     └──────────────┘
                         │  • Cost Tracking            │
                         │  • Usage Logging            │
                         └─────────────────────────────┘

Key Concepts

Services

A Service is a configured connection to an AI provider. Each service has:

  • Provider API key (encrypted)
  • Enabled models list
  • Rate limits (warn/block thresholds)
  • Cost tracking

API Keys

API Keys are issued to client applications. Each key has:

  • Unique identifier (prefixed with sk_)
  • Associated service permissions
  • Individual rate limits
  • Usage tracking

Modules

Modules implement provider-specific logic:

  • Input/output format conversion
  • Streaming support
  • Token counting
  • Cost calculation

Quick Start

  1. Set up the API Management server (see Setup Guide)
  2. Create a Service for your AI provider
  3. Generate an API Key
  4. Use the API Key in your Python code

Documentation Index

Guide Description
Setup Guide Server installation and configuration
Creating Endpoints How to create services and API keys
Monitoring Usage Track costs and usage analytics
Python Integration Code examples for image models
Streaming Responses Real-time response handling
Troubleshooting Common issues and solutions