Skip to content

OPEN-SOURCE API INFRASTRUCTURE

API gateway forOpenAI, Claudeand DeepSeek.

Route requests across API keys. Manage model access, usage, and billing in one workspace. Use your existing OpenAI and Anthropic SDKs, for DeepSeek models too.

MIT licensed · Self-hostable

SUPPORTED APIS

OpenAIResponses / Chat Completions
AnthropicMessages / Streaming
DeepSeekOfficial API · OpenAI & Anthropic formats
ROUTING SIMULATORCompare load and budget routing.

Key selection

Simulation
Provider
Route by
Key 01
72/100RPM used
Budget left$240
Available
Key 02
24/100RPM used
Budget left$90
Available
Key 03
100/100RPM used
Budget left$400
At RPM limit
A key at its RPM limit is excluded from routing.

Illustrative data. Other limits assumed available. Budgets are local caps, not provider balances. No API calls.

INTEGRATION

Native SDKs. Shared routing.

Set your RelayPine key and the provider's base URL. Requests and responses keep their original format.

  1. 01

    Create an API key

    Assign model access and a request limit to your application.

  2. 02

    Set the base URL

    Choose the endpoint for your OpenAI or Anthropic SDK.

  3. 03

    Monitor usage

    Check token usage, request latency, and wallet charges.

QuickstartTypeScript
quickstart.ts
import OpenAI from "openai";

const client = new OpenAI({
  apiKey: process.env.RELAYPINE_API_KEY,
  baseURL: "https://relaypine.com/openai/v1",
});

const response = await client.responses.create({
  model: "MODEL_ID",
  input: "Hello from RelayPine",
});

Set RELAYPINE_API_KEY to a key created in the console. Replace MODEL_ID with an enabled model ID from Models & rates.

GATEWAY CONTROLS

Routing, access, and usage accounting.

Configure upstream connections and application permissions separately. Inspect usage at the request level.

Multi-key routing

Select eligible keys by load or remaining budget. RPM, TPM, and cooldowns determine which keys can receive a request.

RPM / TPM / local budgets

Per-request billing

Record input, output, and cached tokens for each request. Track charges and balance changes in the wallet ledger.

Request logs / usage / ledger

Scoped credentials

Set application model permissions and rate limits. Connect the official OpenAI, Anthropic and DeepSeek APIs or compatible hosts, with an optional SOCKS5 proxy per upstream key.

Model permissions / per-key proxy

SOURCE CODE

Inspect the code. Run your own gateway.

RelayPine is open source under the MIT license. Review the implementation, deploy an instance, or contribute on GitHub.

View on GitHubMIT LICENSE GITHUB

Connect your application.

Sign in with an email verification code to create a workspace.

New workspaces start with a $0.00 balance. An administrator adds credit before requests run.