Tutorial OpenAI Migration

Drop-in Replacement: Migrating from OpenAI to FlintAPI in 5 Minutes

2026-06-255 min read

If you're using OpenAI's API, you can switch to FlintAPI in less than 5 minutes — and immediately gain access to DeepSeek, Qwen, GLM, Kimi, and 18+ other models at significantly lower costs.

Why Migrate?

**Cost savings**: Chinese LLMs cost 50-80% less than equivalent OpenAI models for comparable quality.

**Model diversity**: Instead of being locked into one provider, access the best model for each specific task.

**No vendor lock-in**: Your code stays the same. If you ever want to switch back, just change one line.

Step 1: Get Your API Key

Sign up at flintapi.ai, go to Settings, and generate an API key. Load your account with credits — pricing starts at $0.14 per million tokens.

Step 2: Change One Line of Code

**Before (OpenAI):**

```python

from openai import OpenAI

client = OpenAI(api_key='sk-...')

```

**After (FlintAPI):**

```python

from openai import OpenAI

client = OpenAI(

api_key='fl-...',

base_url='https://api.flintapi.ai/v1'

)

```

That's it. All your existing code — chat completions, streaming, function calling — works exactly the same.

Step 3: Choose Your Models

Use deepseek-v4-pro for coding and complex reasoning, qwen3.5-plus for multilingual tasks, glm-5.1 for math and logic. Or just use flint-smart and let the platform auto-route for you.

JavaScript / TypeScript

Same pattern. Change baseURL in your OpenAI client config:

```javascript

const openai = new OpenAI({

apiKey: 'fl-...',

baseURL: 'https://api.flintapi.ai/v1',

});

```

Streaming Works Too

Streaming responses work identically. Set stream: true and process chunks as you normally would. FlintAPI handles the proxy transparently.

What About Existing Integrations?

Any tool, library, or framework that supports custom OpenAI-compatible endpoints works with FlintAPI: LangChain, LlamaIndex, Vercel AI SDK, Continue.dev, Cursor, and more.

Next Steps

1. Sign up at flintapi.ai

2. Generate an API key

3. Change base_url in your OpenAI client

4. Start experimenting with Chinese LLMs at 5x lower cost