Skip to content

Enterprise API: Getting Started

1. Get Your API Key

API keys are provisioned manually during onboarding. To get your key:

  1. Sign up at gridbank.io or contact support@gridbank.io
  2. The GridBank team will issue your API key (starts with apik_) and send it to you directly
  3. Keep this key secure; never commit it to version control

2. Choose Your SDK

GridBank provides official SDKs for Python and JavaScript:

pip install gridbank-api

Works with Python 3.9+

npm install @gridbank/api-js

Requires Node.js 14+ or modern browser with ES2020 support

3. Make Your First Request

from gridbank_api import EnterpriseClient

# Initialize client
client = EnterpriseClient(api_key="apik_your_key_here")

# Search for videos
results = client.search_videos(q="nature", per_page=5)

for video in results.videos:
    print(f"{video.title} ({video.duration}s)")
import { EnterpriseClient } from '@gridbank/api-js';

// Initialize client
const client = new EnterpriseClient({ apiKey: 'apik_your_key_here' });

// Search for videos
const results = await client.searchVideos({ q: 'nature', perPage: 5 });

results.videos.forEach(video => {
  console.log(`${video.title} (${video.duration}s)`);
});

4. Handle Errors

All SDK methods raise exceptions on non-2xx responses. Always wrap API calls in try-catch:

from gridbank_api import EnterpriseClient, EnterpriseAPIError

client = EnterpriseClient(api_key="apik_...")

try:
    results = client.search_videos(q="test")
except EnterpriseAPIError as e:
    print(f"Error {e.code}: {e.message}")
    if e.details:
        print(f"Details: {e.details}")
const client = new EnterpriseClient({ apiKey: 'apik_...' });

try {
  const results = await client.searchVideos({ q: 'test' });
} catch (error) {
  if (error.code) {
    console.error(`Error ${error.code}: ${error.message}`);
  } else {
    console.error('Unexpected error:', error);
  }
}

5. Check Your Usage

Monitor your subscription tier and remaining quota:

usage = client.usage_summary()
print(f"Tier: {usage.tier}")
print(f"Downloads used: {usage.downloads_this_period}")
print(f"Period ends: {usage.lease_period_end}")
const usage = await client.usageSummary();
console.log(`Tier: ${usage.tier}`);
console.log(`Downloads used: ${usage.downloads_this_period}`);
console.log(`Period ends: ${usage.lease_period_end}`);

Subscription Tiers

Tier Description
Starter Entry-level tier for development and testing
Growth Mid-tier for scaling applications
Scale High-volume tier for production use
Enterprise Custom limits and dedicated support

Next Steps

Support

Stuck? Reach out: