Portkey + Meridian

Route Meridian through Portkey's AI gateway for unified observability, load balancing, and virtual key management across providers.

Virtual Key Configuration

Create a virtual key in your Portkey dashboard and map it to Meridian's base URL. All requests flow through Portkey's gateway with full logging and rate limiting.

Store this key in your environment as PORTKEY_API_KEY

Provider Setup

import Portkey from 'portkey-ai';

const portkey = new Portkey({
  apiKey: process.env.PORTKEY_API_KEY,
  virtualKey: "meridian-vk-xxx",
  config: {
    strategy: { mode: "loadbalance" },
    targets: [{
      provider: "meridian",
      apiKey: process.env.MERIDIAN_API_KEY,
      overrideParams: { baseURL: "https://api.getnimbus.net/v1" }
    }]
  }
});

const response = await portkey.chat.completions.create({
  model: "meridian-1",
  messages: [{ role: "user", content: "Hello" }]
});

Gateway Benefits

Unified Logging

All requests traced in one dashboard with latency and token metrics.

Automatic Failover

Fallback providers kick in if Meridian is unreachable.

Rate Limiting

Enforce per-key quotas without modifying Meridian config.

Caching

Semantic cache reduces redundant calls and saves credits.