SAI Marine AI GATEWAY
G
Guest
Sign in to chat
Sign In / Register
Low-price AI active Get Started
Back to Blog List
How to Create & Manage OpenAI-Compatible API Keys Across Every SDK & Framework

How to Create & Manage OpenAI-Compatible API Keys Across Every SDK & Framework

22/11/2026 04:51 • 220 reads • Author: SAI Marine Engineering

1. The OpenAI REST Standard: Universal Compatibility

Virtually every modern AI library, agent framework, and workflow platform — from LangChain, LlamaIndex, AutoGen, and CrewAI to the Vercel AI SDK, Dify, and FastGPT — natively speaks the OpenAI REST API specification. Because SAI Marine is 100% OpenAI-compatible, you can point any existing application to SAI Marine in seconds without rewriting your business logic.

2. Creating a New API Key on SAI Marine

  1. Sign in to your SAI Marine Dashboard.
  2. Open API Keys from the left navigation sidebar.
  3. Click + Create New Key.
  4. Give your key a descriptive name (e.g., Cursor Production, Telegram Bot, Staging App) and optional rate/quota limits.
  5. Copy your sk-sm-xxxxxxxxxxxxxxxxxxxx secret key immediately and store it in a secure secret manager or .env file.

3. Integrating with Popular Languages

Python (Official openai SDK)

import os
from openai import OpenAI

client = OpenAI(
 base_url="https://sai-marine.com/v1",
 api_key="sk-sm-your-api-key-here"
)

response = client.chat.completions.create(
 model="claude-3-5-sonnet-20241022",
 messages=[
 {"role": "system", "content": "You are a senior cloud solutions architect."},
 {"role": "user", "content": "Outline key AI infrastructure trends for 2026."}
 ],
 temperature=0.7
)

print(response.choices[0].message.content)

Node.js / TypeScript

import OpenAI from 'openai';

const openai = new OpenAI({
  baseURL: 'https://sai-marine.com/v1',
  apiKey: process.env.SAI_MARINE_API_KEY,
});

async function main() {
  const completion = await openai.chat.completions.create({
 messages: [{ role: 'user', content: 'Explain Zero-Copy networking in Linux.' }],
 model: 'deepseek-chat',
  });

  console.log(completion.choices[0].message.content);
}

main();

4. Essential API Key Security Best Practices

  • Never commit API keys to Git: Store keys in environment variables (.env) and ensure .env is listed in .gitignore.
  • Isolate environments per key: Create separate keys for Development, Staging, and Production, and configure per-key RPM/TPM limits, allowed models, and IP whitelists.
  • Rotate or revoke compromised keys immediately: If a key is ever exposed, revoke it with one click in the API Keys dashboard without disrupting your other services.
Experience the SAI Marine Routing Gateway Today

OpenAI-compatible. Direct integration with Cursor IDE, Cline, Next.js and low-price models from $0.05 / 1 million tokens.

Related keywords: OpenAI API Key API Integration LangChain LlamaIndex Python AI SDK Next.js AI SDK Token Management
API Integration Specs
OpenAI-Standard Endpoint:
https://sai-marine.com/v1
  • Compatible with Cursor IDE & Cline
  • Prompt Caching: cache-read price per model
  • 56 Sai-Marine models
  • Real measured latency on the Model Health page
View Detailed Documentation