开发者文档

从这些内容开始

搜索标题与正文↑ ↓ 选择 · Enter 打开 · Esc 关闭

Migration from OpenAI

Move an OpenAI-compatible integration to uouo cloud with minimal code changes.

Overview

Most OpenAI-compatible clients only need two changes: the base URL and the API key. Model IDs may also need to be adjusted depending on provider availability.

Step 1: change the base URL

ts
const client = new OpenAI({
  apiKey: process.env.UOUODUO_API_KEY,
  baseURL: "https://uouo.cloud/v1",
});

Step 2: change the API key

Create a key in /app/keys and store it as a server-side secret:

bash
export UOUODUO_API_KEY="sk-xxx..."

Step 3: verify model IDs

Open /models or call /v1/models to confirm model IDs. If a direct OpenAI model ID is unavailable, choose an equivalent model from another provider.

Behavioral differences

  • Routing may choose a different upstream provider than your previous direct integration.
  • Streaming chunks follow OpenAI-compatible SSE format, but provider-specific details can vary.
  • Usage and cost should be verified in /app/logs.
  • Tool calling and structured output support can differ by model.

Migration checklist

  1. Update base URL and API key.
  2. Run a short non-streaming request.
  3. Run a streaming request.
  4. Test error handling for 401, 429, and 5xx.
  5. Review logs, usage, and cost.
  6. Roll out to staging before production.
Migration from OpenAI · uouo cloud