OpenAI SDK Setup: Python, Node.js & cURL Base URL

Point the official OpenAI Python, Node.js or cURL client to https://api.modelseed.dev/v1 and call DeepSeek, GPT, Qwen, GLM & Kimi in 3 lines of code.

Modelseed ·

One address for text requests

For an OpenAI-compatible text model, set https://api.modelseed.dev/v1 and your modelseed key. Set the exact ID in model. The example uses Chat Completions; additional parameters depend on the route.

# Python
python -m pip install openai

# Node.js
npm install openai

Store MODELSEED_API_KEY in the server environment. In Python, use os.environ["MODELSEED_API_KEY"] instead of YOUR_API_KEY. Run this code on your server or locally, where website visitors cannot access the key.

Python, JavaScript & cURL examples

curl https://api.modelseed.dev/v1/chat/completions \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "deepseek-v4-1-flash",
    "messages": [{"role": "user", "content": "Hello!"}]
  }'

Streaming & tools

OpenAI SDK compatibility does not imply support for every OpenAI feature. Verify stream, tool calls, JSON and Responses API separately for the chosen model. Text requests cannot automatically be reused for Seedance or Seedream.

When migrating an application, update the address and key, and retain your budget controls and error handling. Avoid uncontrolled retries: the first generation may have completed before a network interruption.

BUILD WITH MODELSEED

From an idea to your first request.

One key and a familiar API. New verified accounts receive a random $1–$2 welcome bonus (1,000–2,000 credits) to test requests before topping up.

Get API key + bonus